diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md index 2613ba9e9ea4..3b9ad52ae879 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md @@ -1,14 +1,1490 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0-beta.1 (2026-05-28) -### 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 api-version 2026-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ExpandMsixImageList` was removed + +#### `models.HostPoolList` was removed + +#### `models.SessionHostList` was removed + +#### `models.StartMenuItemList` was removed + +#### `models.ResourceIdentityType` was removed + +#### `models.ScalingPlanPersonalScheduleList` was removed + +#### `models.ResourceModelWithAllowedPropertySetPlan` was removed + +#### `models.MsixPackageList` was removed + +#### `models.ResourceProviderOperationList` was removed + +#### `models.ResourceModelWithAllowedPropertySet` was removed + +#### `models.WorkspaceList` was removed + +#### `models.ApplicationList` was removed + +#### `models.ApplicationGroupList` was removed + +#### `models.Identity` was removed + +#### `models.ScalingPlanPooledScheduleList` was removed + +#### `models.AppAttachPackageList` was removed + +#### `models.PrivateLinkResourceListResult` was removed + +#### `models.ScalingScheduleDaysOfWeekItem` was removed + +#### `models.PrivateEndpointConnectionListResultWithSystemData` was removed + +#### `models.ScalingPlanList` was removed + +#### `models.ResourceModelWithAllowedPropertySetIdentity` was removed + +#### `models.UserSessionList` was removed + +#### `models.DesktopList` was removed + +#### `models.ResourceModelWithAllowedPropertySetSku` was removed + +#### `models.ScalingPlanPersonalSchedule$DefinitionStages` was modified + +* Required stage 2 was added + +#### `models.ScalingPlan$DefinitionStages` was modified + +* `withTimeZone(java.lang.String)` was removed in stage 3 + +#### `models.ScalingPlanPooledSchedule$DefinitionStages` was modified + +* Required stage 2 was added + +#### `models.ApplicationGroup$DefinitionStages` was modified + +* `withHostPoolArmPath(java.lang.String)` was removed in stage 3 + +#### `models.MsixPackage$DefinitionStages` was modified + +* Required stage 2 was added + +#### `models.HostPool$DefinitionStages` was modified + +* `withHostPoolType(models.HostPoolType)` was removed in stage 3 + +#### `models.Application$DefinitionStages` was modified + +* `withCommandLineSetting(models.CommandLineSetting)` was removed in stage 2 + +#### `models.PrivateEndpointConnectionWithSystemData` was modified + +* `provisioningState()` was removed +* `privateEndpoint()` was removed +* `groupIds()` was removed +* `privateLinkServiceConnectionState()` was removed + +#### `models.ScalingPlanPooledSchedule$Definition` was modified + +* `withRampDownStartTime(models.Time)` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed +* `withPeakStartTime(models.Time)` was removed +* `withRampDownStopHostsWhen(models.StopHostsWhen)` was removed +* `withOffPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withRampUpLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownMinimumHostsPct(java.lang.Integer)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampUpMinimumHostsPct(java.lang.Integer)` was removed +* `withPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownWaitTimeMinutes(java.lang.Integer)` was removed +* `withRampDownForceLogoffUsers(java.lang.Boolean)` was removed +* `withRampDownNotificationMessage(java.lang.String)` was removed +* `withDaysOfWeek(java.util.List)` was removed + +#### `models.ImportPackageInfoRequest` was modified + +* `validate()` was removed + +#### `models.UserSession` was modified + +* `objectId()` was removed +* `activeDirectoryUsername()` was removed +* `applicationType()` was removed +* `sessionState()` was removed +* `createTime()` was removed +* `userPrincipalName()` was removed + +#### `models.SessionHostHealthCheckReport` was modified + +* `SessionHostHealthCheckReport()` was changed to private access +* `validate()` was removed + +#### `models.RegistrationInfoPatch` was modified + +* `validate()` was removed + +#### `models.ScalingPlanPooledSchedule$Update` was modified + +* `withDaysOfWeek(java.util.List)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withOffPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withRampDownForceLogoffUsers(java.lang.Boolean)` was removed +* `withRampUpMinimumHostsPct(java.lang.Integer)` was removed +* `withRampDownStopHostsWhen(models.StopHostsWhen)` was removed +* `withRampDownLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownWaitTimeMinutes(java.lang.Integer)` was removed +* `withPeakStartTime(models.Time)` was removed +* `withPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampUpLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownMinimumHostsPct(java.lang.Integer)` was removed +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampDownNotificationMessage(java.lang.String)` was removed + +#### `models.HostPool$Update` was modified + +* `withMaxSessionLimit(java.lang.Integer)` was removed +* `withAgentUpdate(models.AgentUpdatePatchProperties)` was removed +* `withSsoClientSecretKeyVaultPath(java.lang.String)` was removed +* `withRing(java.lang.Integer)` was removed +* `withCustomRdpProperty(java.lang.String)` was removed +* `withSsoSecretType(models.SsoSecretType)` was removed +* `withSsoadfsAuthority(java.lang.String)` was removed +* `withVmTemplate(java.lang.String)` was removed +* `withLoadBalancerType(models.LoadBalancerType)` was removed +* `withSsoClientId(java.lang.String)` was removed +* `withRegistrationInfo(models.RegistrationInfoPatch)` was removed +* `withStartVMOnConnect(java.lang.Boolean)` was removed +* `withDescription(java.lang.String)` was removed +* `withPersonalDesktopAssignmentType(models.PersonalDesktopAssignmentType)` was removed +* `withPreferredAppGroupType(models.PreferredAppGroupType)` was removed +* `withPublicNetworkAccess(models.HostpoolPublicNetworkAccess)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withValidationEnvironment(java.lang.Boolean)` was removed + +#### `models.ScalingPlan$Update` was modified + +* `withSchedules(java.util.List)` was removed +* `withHostPoolReferences(java.util.List)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withTimeZone(java.lang.String)` was removed +* `withExclusionTag(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.AppAttachPackagePatch` was modified + +* `validate()` was removed + +#### `models.StartMenuItem` was modified + +* `iconPath()` was removed +* `iconIndex()` was removed +* `commandLineArguments()` was removed +* `filePath()` was removed +* `appAlias()` was removed + +#### `models.OperationProperties` was modified + +* `OperationProperties()` was changed to private access +* `validate()` was removed +* `withServiceSpecification(models.ServiceSpecification)` was removed + +#### `models.AppAttachPackagePatchProperties` was modified + +* `validate()` was removed + +#### `models.WorkspacePatch` was modified + +* `withDescription(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `validate()` was removed +* `withApplicationGroupReferences(java.util.List)` was removed +* `description()` was removed +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed +* `friendlyName()` was removed +* `applicationGroupReferences()` was removed +* `publicNetworkAccess()` was removed + +#### `models.ScalingPlanPersonalSchedule` was modified + +* `rampDownActionOnLogoff()` was removed +* `offPeakActionOnLogoff()` was removed +* `peakStartVMOnConnect()` was removed +* `offPeakMinutesToWaitOnDisconnect()` was removed +* `rampDownActionOnDisconnect()` was removed +* `rampUpStartVMOnConnect()` was removed +* `peakActionOnDisconnect()` was removed +* `rampUpActionOnDisconnect()` was removed +* `rampUpMinutesToWaitOnLogoff()` was removed +* `peakMinutesToWaitOnLogoff()` was removed +* `rampUpActionOnLogoff()` was removed +* `rampUpAutoStartHosts()` was removed +* `rampUpMinutesToWaitOnDisconnect()` was removed +* `offPeakActionOnDisconnect()` was removed +* `peakMinutesToWaitOnDisconnect()` was removed +* `peakStartTime()` was removed +* `rampDownStartTime()` was removed +* `rampDownMinutesToWaitOnDisconnect()` was removed +* `offPeakStartTime()` was removed +* `peakActionOnLogoff()` was removed +* `rampDownStartVMOnConnect()` was removed +* `offPeakMinutesToWaitOnLogoff()` was removed +* `rampDownMinutesToWaitOnLogoff()` was removed +* `rampUpStartTime()` was removed +* `daysOfWeek()` was removed +* `offPeakStartVMOnConnect()` was removed + +#### `models.ScalingPlanPersonalSchedule$Definition` was modified + +* `withRampDownActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampUpActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withOffPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampUpStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withOffPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampDownActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampDownStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampDownMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampUpActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampUpMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withOffPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withPeakStartTime(models.Time)` was removed +* `withPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampDownMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withOffPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withOffPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampUpAutoStartHosts(models.StartupBehavior)` was removed + +#### `models.MsixPackage$Update` was modified + +* `withIsRegularRegistration(java.lang.Boolean)` was removed +* `withIsActive(java.lang.Boolean)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.Workspace` was modified + +* `applicationGroupReferences()` was removed +* `description()` was removed +* `friendlyName()` was removed +* `publicNetworkAccess()` was removed +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `cloudPcResource()` was removed +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `privateEndpointConnections()` was removed +* `objectId()` was removed +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.MsixPackage$Definition` was modified + +* `withPackageDependencies(java.util.List)` was removed +* `withIsActive(java.lang.Boolean)` was removed +* `withPackageRelativePath(java.lang.String)` was removed +* `withPackageFamilyName(java.lang.String)` was removed +* `withPackageName(java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withImagePath(java.lang.String)` was removed +* `withPackageApplications(java.util.List)` was removed +* `withVersion(java.lang.String)` was removed +* `withLastUpdated(java.time.OffsetDateTime)` was removed +* `withIsRegularRegistration(java.lang.Boolean)` was removed + +#### `models.ScalingHostPoolReference` was modified + +* `validate()` was removed + +#### `models.DesktopPatch` was modified + +* `withFriendlyName(java.lang.String)` was removed +* `description()` was removed +* `validate()` was removed +* `tags()` was removed +* `withTags(java.util.Map)` was removed +* `friendlyName()` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.Application` was modified + +* `commandLineSetting()` was removed +* `iconPath()` was removed +* `objectId()` was removed +* `iconIndex()` was removed +* `applicationType()` was removed +* `friendlyName()` was removed +* `commandLineArguments()` was removed +* `iconContent()` was removed +* `showInPortal()` was removed +* `msixPackageApplicationId()` was removed +* `iconHash()` was removed +* `msixPackageFamilyName()` was removed +* `description()` was removed +* `filePath()` was removed + +#### `models.PrivateEndpoint` was modified + +* `validate()` was removed + +#### `models.AppAttachPackageInfoProperties` was modified + +* `validate()` was removed + +#### `models.ScalingSchedule` was modified + +* `validate()` was removed + +#### `models.Application$Update` was modified + +* `withShowInPortal(java.lang.Boolean)` was removed +* `withCommandLineArguments(java.lang.String)` was removed +* `withFilePath(java.lang.String)` was removed +* `withTags(java.util.Map)` was removed +* `withCommandLineSetting(models.CommandLineSetting)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withIconIndex(java.lang.Integer)` was removed +* `withApplicationType(models.RemoteApplicationType)` was removed +* `withDescription(java.lang.String)` was removed +* `withMsixPackageApplicationId(java.lang.String)` was removed +* `withIconPath(java.lang.String)` was removed +* `withMsixPackageFamilyName(java.lang.String)` was removed + +#### `models.MsixPackageApplications` was modified + +* `appUserModelId()` was removed +* `validate()` was removed +* `withAppUserModelId(java.lang.String)` was removed + +#### `models.Application$Definition` was modified + +* `withIconPath(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withShowInPortal(java.lang.Boolean)` was removed +* `withMsixPackageApplicationId(java.lang.String)` was removed +* `withCommandLineSetting(models.CommandLineSetting)` was removed +* `withMsixPackageFamilyName(java.lang.String)` was removed +* `withApplicationType(models.RemoteApplicationType)` was removed +* `withCommandLineArguments(java.lang.String)` was removed +* `withFilePath(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withIconIndex(java.lang.Integer)` was removed + +#### `models.ApplicationGroup` was modified + +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `objectId()` was removed +* `cloudPcResource()` was removed +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `workspaceArmPath()` was removed +* `friendlyName()` was removed +* `applicationGroupType()` was removed +* `description()` was removed +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `hostPoolArmPath()` was removed +* `showInFeed()` was removed + +#### `models.HostPool` was modified + +* `hostPoolType()` was removed +* `appAttachPackageReferences()` was removed +* `description()` was removed +* `models.RegistrationTokenList listRegistrationTokens()` -> `com.azure.core.http.rest.PagedIterable listRegistrationTokens()` +* `cloudPcResource()` was removed +* `preferredAppGroupType()` was removed +* `ssoClientId()` was removed +* `startVMOnConnect()` was removed +* `ssoSecretType()` was removed +* `publicNetworkAccess()` was removed +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `maxSessionLimit()` was removed +* `customRdpProperty()` was removed +* `privateEndpointConnections()` was removed +* `friendlyName()` was removed +* `personalDesktopAssignmentType()` was removed +* `ssoClientSecretKeyVaultPath()` was removed +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `validationEnvironment()` was removed +* `ring()` was removed +* `applicationGroupReferences()` was removed +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `vmTemplate()` was removed +* `listRegistrationTokensWithResponse(com.azure.core.util.Context)` was removed +* `registrationInfo()` was removed +* `agentUpdate()` was removed +* `objectId()` was removed +* `ssoadfsAuthority()` was removed +* `loadBalancerType()` was removed + +#### `models.HostPoolPatch` was modified + +* `vmTemplate()` was removed +* `registrationInfo()` was removed +* `withDescription(java.lang.String)` was removed +* `validationEnvironment()` was removed +* `withSsoSecretType(models.SsoSecretType)` was removed +* `withCustomRdpProperty(java.lang.String)` was removed +* `loadBalancerType()` was removed +* `validate()` was removed +* `withSsoadfsAuthority(java.lang.String)` was removed +* `preferredAppGroupType()` was removed +* `withSsoClientSecretKeyVaultPath(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withStartVMOnConnect(java.lang.Boolean)` was removed +* `ssoClientId()` was removed +* `description()` was removed +* `withLoadBalancerType(models.LoadBalancerType)` was removed +* `withAgentUpdate(models.AgentUpdatePatchProperties)` was removed +* `withSsoClientId(java.lang.String)` was removed +* `personalDesktopAssignmentType()` was removed +* `withPublicNetworkAccess(models.HostpoolPublicNetworkAccess)` was removed +* `ssoadfsAuthority()` was removed +* `maxSessionLimit()` was removed +* `ssoSecretType()` was removed +* `startVMOnConnect()` was removed +* `customRdpProperty()` was removed +* `withRing(java.lang.Integer)` was removed +* `withPersonalDesktopAssignmentType(models.PersonalDesktopAssignmentType)` was removed +* `withValidationEnvironment(java.lang.Boolean)` was removed +* `friendlyName()` was removed +* `withRegistrationInfo(models.RegistrationInfoPatch)` was removed +* `ssoClientSecretKeyVaultPath()` was removed +* `ring()` was removed +* `withPreferredAppGroupType(models.PreferredAppGroupType)` was removed +* `publicNetworkAccess()` was removed +* `withVmTemplate(java.lang.String)` was removed +* `agentUpdate()` was removed +* `withMaxSessionLimit(java.lang.Integer)` was removed + +#### `models.PrivateEndpointConnections` was modified + +* `updateByWorkspace(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection)` was removed +* `updateByHostPool(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection)` was removed +* `updateByWorkspaceWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection,com.azure.core.util.Context)` was removed +* `updateByHostPoolWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PrivateEndpointConnection,com.azure.core.util.Context)` was removed + +#### `models.ScalingPlanPersonalSchedule$Update` was modified + +* `withRampUpMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampDownActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withPeakStartTime(models.Time)` was removed +* `withRampDownMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withOffPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampUpActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `withOffPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withOffPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampDownStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampDownMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withOffPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withRampUpAutoStartHosts(models.StartupBehavior)` was removed +* `withOffPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withRampUpActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampDownActionOnDisconnect(models.SessionHandlingOperation)` was removed + +#### `models.ResourceProviderOperationDisplay` was modified + +* `ResourceProviderOperationDisplay()` was changed to private access +* `validate()` was removed +* `withDescription(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed + +#### `models.SessionHostHealthCheckFailureDetails` was modified + +* `SessionHostHealthCheckFailureDetails()` was changed to private access +* `validate()` was removed + +#### `models.PrivateLinkResource` was modified + +* `groupId()` was removed +* `requiredMembers()` was removed +* `requiredZoneNames()` was removed + +#### `DesktopVirtualizationManager` was modified + +* `fluent.DesktopVirtualizationApiClient serviceClient()` -> `fluent.DesktopVirtualizationManagementClient serviceClient()` + +#### `models.PrivateEndpointConnection` was modified + +* `PrivateEndpointConnection()` was changed to private access +* `privateEndpoint()` was removed +* `privateLinkServiceConnectionState()` was removed +* `validate()` was removed +* `withPrivateLinkServiceConnectionState(models.PrivateLinkServiceConnectionState)` was removed +* `withPrivateEndpoint(models.PrivateEndpoint)` was removed +* `provisioningState()` was removed +* `groupIds()` was removed + +#### `models.AppAttachPackages` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.AgentUpdateProperties` was modified + +* `validate()` was removed + +#### `models.LogSpecification` was modified + +* `LogSpecification()` was changed to private access +* `withDisplayName(java.lang.String)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed +* `withBlobDuration(java.lang.String)` was removed + +#### `models.SendMessage` was modified + +* `validate()` was removed + +#### `models.AppAttachPackageProperties` was modified + +* `validate()` was removed + +#### `models.AgentUpdatePatchProperties` was modified + +* `validate()` was removed + +#### `models.ScalingPlanPooledSchedulePatch` was modified + +* `withRampUpLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampDownCapacityThresholdPct()` was removed +* `rampDownStopHostsWhen()` was removed +* `withRampDownWaitTimeMinutes(java.lang.Integer)` was removed +* `withPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `withRampDownForceLogoffUsers(java.lang.Boolean)` was removed +* `peakStartTime()` was removed +* `rampDownNotificationMessage()` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `validate()` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withRampDownMinimumHostsPct(java.lang.Integer)` was removed +* `offPeakStartTime()` was removed +* `offPeakLoadBalancingAlgorithm()` was removed +* `withRampUpStartTime(models.Time)` was removed +* `rampUpCapacityThresholdPct()` was removed +* `withPeakStartTime(models.Time)` was removed +* `withOffPeakLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampUpMinimumHostsPct()` was removed +* `withRampDownNotificationMessage(java.lang.String)` was removed +* `withRampDownStopHostsWhen(models.StopHostsWhen)` was removed +* `withRampUpMinimumHostsPct(java.lang.Integer)` was removed +* `withRampDownStartTime(models.Time)` was removed +* `rampDownWaitTimeMinutes()` was removed +* `rampUpLoadBalancingAlgorithm()` was removed +* `daysOfWeek()` was removed +* `peakLoadBalancingAlgorithm()` was removed +* `rampDownStartTime()` was removed +* `rampUpStartTime()` was removed +* `withRampDownCapacityThresholdPct(java.lang.Integer)` was removed +* `withRampDownLoadBalancingAlgorithm(models.SessionHostLoadBalancingAlgorithm)` was removed +* `rampDownMinimumHostsPct()` was removed +* `rampDownForceLogoffUsers()` was removed +* `rampDownLoadBalancingAlgorithm()` was removed +* `withRampUpCapacityThresholdPct(java.lang.Integer)` was removed + +#### `models.Desktop` was modified + +* `friendlyName()` was removed +* `description()` was removed +* `iconHash()` was removed +* `iconContent()` was removed +* `objectId()` was removed + +#### `models.SessionHostPatch` was modified + +* `withFriendlyName(java.lang.String)` was removed +* `withAssignedUser(java.lang.String)` was removed +* `assignedUser()` was removed +* `withAllowNewSession(java.lang.Boolean)` was removed +* `friendlyName()` was removed +* `validate()` was removed +* `allowNewSession()` was removed + +#### `models.MsixPackagePatch` was modified + +* `withIsRegularRegistration(java.lang.Boolean)` was removed +* `displayName()` was removed +* `withDisplayName(java.lang.String)` was removed +* `isActive()` was removed +* `isRegularRegistration()` was removed +* `validate()` was removed +* `withIsActive(java.lang.Boolean)` was removed + +#### `models.MsixImageUri` was modified + +* `validate()` was removed + +#### `models.ApplicationGroup$Definition` was modified + +* `withApplicationGroupType(models.ApplicationGroupType)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withHostPoolArmPath(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withShowInFeed(java.lang.Boolean)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed + +#### `models.MsixPackage` was modified + +* `packageFamilyName()` was removed +* `packageName()` was removed +* `version()` was removed +* `isRegularRegistration()` was removed +* `packageApplications()` was removed +* `packageRelativePath()` was removed +* `lastUpdated()` was removed +* `displayName()` was removed +* `isActive()` was removed +* `packageDependencies()` was removed +* `imagePath()` was removed + +#### `models.ApplicationGroupPatch` was modified + +* `showInFeed()` was removed +* `withDescription(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `validate()` was removed +* `withShowInFeed(java.lang.Boolean)` was removed +* `friendlyName()` was removed +* `description()` was removed + +#### `models.HostPool$Definition` was modified + +* `withMaxSessionLimit(java.lang.Integer)` was removed +* `withSsoSecretType(models.SsoSecretType)` was removed +* `withPersonalDesktopAssignmentType(models.PersonalDesktopAssignmentType)` was removed +* `withSsoClientId(java.lang.String)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withHostPoolType(models.HostPoolType)` was removed +* `withLoadBalancerType(models.LoadBalancerType)` was removed +* `withRegistrationInfo(fluent.models.RegistrationInfoInner)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withValidationEnvironment(java.lang.Boolean)` was removed +* `withDescription(java.lang.String)` was removed +* `withAgentUpdate(models.AgentUpdateProperties)` was removed +* `withSsoadfsAuthority(java.lang.String)` was removed +* `withVmTemplate(java.lang.String)` was removed +* `withSsoClientSecretKeyVaultPath(java.lang.String)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withPublicNetworkAccess(models.HostpoolPublicNetworkAccess)` was removed +* `withStartVMOnConnect(java.lang.Boolean)` was removed +* `withCustomRdpProperty(java.lang.String)` was removed +* `withPreferredAppGroupType(models.PreferredAppGroupType)` was removed +* `withRing(java.lang.Integer)` was removed + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `validate()` was removed + +#### `models.MaintenanceWindowProperties` was modified + +* `validate()` was removed + +#### `models.MaintenanceWindowPatchProperties` was modified + +* `validate()` was removed + +#### `models.ScalingPlanPooledSchedule` was modified + +* `rampDownWaitTimeMinutes()` was removed +* `rampDownMinimumHostsPct()` was removed +* `rampUpMinimumHostsPct()` was removed +* `peakStartTime()` was removed +* `offPeakLoadBalancingAlgorithm()` was removed +* `rampDownForceLogoffUsers()` was removed +* `rampDownStartTime()` was removed +* `daysOfWeek()` was removed +* `rampDownLoadBalancingAlgorithm()` was removed +* `rampUpLoadBalancingAlgorithm()` was removed +* `rampDownNotificationMessage()` was removed +* `rampUpCapacityThresholdPct()` was removed +* `rampDownCapacityThresholdPct()` was removed +* `rampUpStartTime()` was removed +* `peakLoadBalancingAlgorithm()` was removed +* `rampDownStopHostsWhen()` was removed +* `offPeakStartTime()` was removed + +#### `models.ScalingPlanPatch` was modified + +* `schedules()` was removed +* `withSchedules(java.util.List)` was removed +* `friendlyName()` was removed +* `timeZone()` was removed +* `withHostPoolReferences(java.util.List)` was removed +* `exclusionTag()` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withExclusionTag(java.lang.String)` was removed +* `withTimeZone(java.lang.String)` was removed +* `validate()` was removed +* `hostPoolReferences()` was removed +* `withDescription(java.lang.String)` was removed +* `description()` was removed + +#### `models.Workspace$Update` was modified + +* `withDescription(java.lang.String)` was removed +* `withApplicationGroupReferences(java.util.List)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed + +#### `models.SessionHost` was modified + +* `sxSStackVersion()` was removed +* `updateState()` was removed +* `objectId()` was removed +* `assignedUser()` was removed +* `resourceId()` was removed +* `updateErrorMessage()` was removed +* `friendlyName()` was removed +* `lastHeartBeat()` was removed +* `sessions()` was removed +* `sessionHostHealthCheckResults()` was removed +* `status()` was removed +* `lastUpdateTime()` was removed +* `statusTimestamp()` was removed +* `agentVersion()` was removed +* `osVersion()` was removed +* `allowNewSession()` was removed +* `virtualMachineId()` was removed + +#### `models.ExpandMsixImage` was modified + +* `packageRelativePath()` was removed +* `isRegularRegistration()` was removed +* `packageFullName()` was removed +* `packageApplications()` was removed +* `packageDependencies()` was removed +* `certificateName()` was removed +* `imagePath()` was removed +* `version()` was removed +* `displayName()` was removed +* `packageAlias()` was removed +* `certificateExpiry()` was removed +* `packageFamilyName()` was removed +* `isActive()` was removed +* `packageName()` was removed +* `lastUpdated()` was removed + +#### `models.ServiceSpecification` was modified + +* `ServiceSpecification()` was changed to private access +* `validate()` was removed +* `withLogSpecifications(java.util.List)` was removed + +#### `models.SessionHosts` was modified + +* `update(java.lang.String,java.lang.String,java.lang.String)` was removed +* `updateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.Boolean,models.SessionHostPatch,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String,java.lang.Integer,java.lang.Boolean,java.lang.Integer,com.azure.core.util.Context)` was removed + +#### `models.Time` was modified + +* `validate()` was removed + +#### `models.ScalingPlanPersonalSchedulePatch` was modified + +* `rampUpActionOnDisconnect()` was removed +* `peakMinutesToWaitOnDisconnect()` was removed +* `withRampUpMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `peakActionOnLogoff()` was removed +* `rampDownStartTime()` was removed +* `withPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withOffPeakActionOnLogoff(models.SessionHandlingOperation)` was removed +* `offPeakActionOnDisconnect()` was removed +* `withOffPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `rampUpStartVMOnConnect()` was removed +* `peakMinutesToWaitOnLogoff()` was removed +* `validate()` was removed +* `withRampDownActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `rampUpMinutesToWaitOnDisconnect()` was removed +* `withRampUpActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `rampUpAutoStartHosts()` was removed +* `rampDownMinutesToWaitOnLogoff()` was removed +* `withPeakStartTime(models.Time)` was removed +* `offPeakMinutesToWaitOnDisconnect()` was removed +* `withRampDownStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `offPeakMinutesToWaitOnLogoff()` was removed +* `withRampDownMinutesToWaitOnDisconnect(java.lang.Integer)` was removed +* `withOffPeakStartTime(models.Time)` was removed +* `withPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `daysOfWeek()` was removed +* `peakActionOnDisconnect()` was removed +* `withDaysOfWeek(java.util.List)` was removed +* `withOffPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `rampDownMinutesToWaitOnDisconnect()` was removed +* `withRampUpStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `withOffPeakActionOnDisconnect(models.SessionHandlingOperation)` was removed +* `withRampDownMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `rampUpMinutesToWaitOnLogoff()` was removed +* `peakStartVMOnConnect()` was removed +* `withRampDownActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `offPeakActionOnLogoff()` was removed +* `withRampDownStartTime(models.Time)` was removed +* `rampUpActionOnLogoff()` was removed +* `rampDownStartVMOnConnect()` was removed +* `withPeakStartVMOnConnect(models.SetStartVMOnConnect)` was removed +* `peakStartTime()` was removed +* `withOffPeakMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `withRampUpMinutesToWaitOnLogoff(java.lang.Integer)` was removed +* `rampUpStartTime()` was removed +* `withRampUpStartTime(models.Time)` was removed +* `withRampUpActionOnLogoff(models.SessionHandlingOperation)` was removed +* `withRampUpAutoStartHosts(models.StartupBehavior)` was removed +* `rampDownActionOnDisconnect()` was removed +* `offPeakStartTime()` was removed +* `offPeakStartVMOnConnect()` was removed +* `rampDownActionOnLogoff()` was removed +* `withPeakMinutesToWaitOnDisconnect(java.lang.Integer)` was removed + +#### `models.MsixPackageDependencies` was modified + +* `validate()` was removed + +#### `models.ScalingPlan` was modified + +* `models.ResourceModelWithAllowedPropertySetSku sku()` -> `models.Sku sku()` +* `timeZone()` was removed +* `hostPoolType()` was removed +* `hostPoolReferences()` was removed +* `exclusionTag()` was removed +* `objectId()` was removed +* `models.ResourceModelWithAllowedPropertySetPlan plan()` -> `models.Plan plan()` +* `friendlyName()` was removed +* `description()` was removed +* `models.ResourceModelWithAllowedPropertySetIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `schedules()` was removed + +#### `models.HostPools` was modified + +* `models.RegistrationTokenList listRegistrationTokens(java.lang.String,java.lang.String)` -> `com.azure.core.http.rest.PagedIterable listRegistrationTokens(java.lang.String,java.lang.String)` +* `listRegistrationTokensWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ScalingPlan$Definition` was modified + +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed +* `withTimeZone(java.lang.String)` was removed +* `withSchedules(java.util.List)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withDescription(java.lang.String)` was removed +* `withExclusionTag(java.lang.String)` was removed +* `withHostPoolType(models.ScalingHostPoolType)` was removed +* `withHostPoolReferences(java.util.List)` was removed +* `withFriendlyName(java.lang.String)` was removed + +#### `models.Workspace$Definition` was modified + +* `withDescription(java.lang.String)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withApplicationGroupReferences(java.util.List)` was removed +* `withIdentity(models.ResourceModelWithAllowedPropertySetIdentity)` was removed +* `withSku(models.ResourceModelWithAllowedPropertySetSku)` was removed +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed +* `withPlan(models.ResourceModelWithAllowedPropertySetPlan)` was removed + +#### `models.ApplicationPatch` was modified + +* `commandLineArguments()` was removed +* `friendlyName()` was removed +* `commandLineSetting()` was removed +* `description()` was removed +* `withFilePath(java.lang.String)` was removed +* `iconIndex()` was removed +* `validate()` was removed +* `msixPackageFamilyName()` was removed +* `withMsixPackageFamilyName(java.lang.String)` was removed +* `filePath()` was removed +* `withCommandLineArguments(java.lang.String)` was removed +* `msixPackageApplicationId()` was removed +* `tags()` was removed +* `iconPath()` was removed +* `withMsixPackageApplicationId(java.lang.String)` was removed +* `withApplicationType(models.RemoteApplicationType)` was removed +* `withCommandLineSetting(models.CommandLineSetting)` was removed +* `withDescription(java.lang.String)` was removed +* `withShowInPortal(java.lang.Boolean)` was removed +* `showInPortal()` was removed +* `withIconIndex(java.lang.Integer)` was removed +* `withIconPath(java.lang.String)` was removed +* `withTags(java.util.Map)` was removed +* `applicationType()` was removed +* `withFriendlyName(java.lang.String)` was removed + +#### `models.Plan` was modified + +* `validate()` was removed + +#### `models.RegistrationTokenMinimal` was modified + +* `RegistrationTokenMinimal()` was removed +* `java.time.OffsetDateTime expirationTime()` -> `java.time.OffsetDateTime expirationTime()` +* `java.lang.String token()` -> `java.lang.String token()` +* `withToken(java.lang.String)` was removed +* `fromJson(com.azure.json.JsonReader)` was removed +* `validate()` was removed +* `toJson(com.azure.json.JsonWriter)` was removed +* `withExpirationTime(java.time.OffsetDateTime)` was removed + +#### `models.ApplicationGroup$Update` was modified + +* `withShowInFeed(java.lang.Boolean)` was removed +* `withFriendlyName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed + +### Features Added + +* `models.MsixPackageProperties` was added + +* `models.VirtualMachineDiskType` was added + +* `models.MarketplaceInfoPatchProperties` was added + +* `models.ApplicationProperties` was added + +* `models.SessionHostManagementProvisioningStatus` 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.ScalingMethodType` was added + +* `models.AllowRDPShortPathWithPrivateLink` was added + +* `models.ManagedDiskProperties` was added + +* `models.SessionHostManagementUpdateStatus` was added + +* `models.PublicUDP` was added + +* `models.DomainInfoPatchProperties` was added + +* `models.ImageInfoPatchProperties` was added + +* `models.SessionHostManagementOperationProgress` was added + +* `models.ScalingPlanPersonalScheduleProperties` was added + +* `models.KeyVaultCredentialsProperties` was added + +* `models.ManagedServiceIdentity` was added + +* `models.SessionHostManagementProvisioningStatusProperties` was added + +* `models.KeyVaultCredentialsPatchProperties` was added + +* `models.SessionHostConfiguration` was added + +* `models.ApplicationGroupProperties` was added + +* `models.DesktopProperties` was added + +* `models.ScalingPlanPooledSchedulePatchProperties` was added + +* `models.DesktopPatchProperties` was added + +* `models.SecurityInfoPatchProperties` was added + +* `models.ActiveSessionHostConfigurationProperties` was added + +* `models.SessionHostProvisioningConfigurationPatchProperties` was added + +* `models.HostPoolPatchProperties` was added + +* `models.BootDiagnosticsInfoProperties` was added + +* `models.ScalingPlanPooledScheduleProperties` was added + +* `models.SessionHostManagementProvisioningOperationProgress` was added + +* `models.ActiveSessionHostConfiguration` was added + +* `models.ApplicationGroupPatchProperties` was added + +* `models.CanaryPolicy` was added + +* `models.ControlSessionHostUpdates` was added + +* `models.DomainInfoProperties` was added + +* `models.CustomInfoPatchProperties` was added + +* `models.ExpandMsixImageProperties` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.SessionHostProvisioningConfigurationProperties` was added + +* `models.SessionHost$DefinitionStages` was added + +* `models.ActiveSessionHostConfigurations` was added + +* `models.SessionHostManagementProvisioningStatuses` was added + +* `models.SessionHostConfigurationPatch` was added + +* `models.SessionHostManagementPatch` was added + +* `models.BootDiagnosticsInfoPatchProperties` was added + +* `models.HostPoolProvisioningControlParameter` was added + +* `models.DirectUDP` was added + +* `models.WorkspacePatchProperties` was added + +* `models.ScalingPlanPatchProperties` was added + +* `models.NetworkInfoPatchProperties` was added + +* `models.SessionHostConfigurationProperties` was added + +* `models.SessionHostManagement` was added + +* `models.MarketplaceInfoProperties` was added + +* `models.SecurityInfoProperties` was added + +* `models.PrivateEndpointConnectionProperties` was added + +* `models.PrivateLinkResourceProperties` was added + +* `models.HostPoolUpdateAction` was added + +* `models.WorkspaceProperties` was added + +* `models.DiffDiskOption` was added + +* `models.ManagedPrivateUDP` was added + +* `models.UpdateSessionHostsRequestBody` was added + +* `models.InitiateSessionHostUpdates` was added + +* `models.ProvisioningStateSHC` was added + +* `models.HostPoolUpdateControlParameter` was added + +* `models.UpdateStatus` was added + +* `models.SessionHost$Definition` was added + +* `models.ImageInfoProperties` was added + +* `models.DeploymentScope` was added + +* `models.ScopedRegistrationTokenProperties` was added + +* `models.DiffDiskProperties` was added + +* `models.HostPoolUpdateConfigurationProperties` was added + +* `models.SessionHostPatchProperties` was added + +* `models.SessionHostManagementUpdateStatuses` was added + +* `models.NetworkInfoProperties` was added + +* `models.SessionHostConfigurationPatchProperties` was added + +* `models.VirtualMachineSecurityType` was added + +* `models.SessionHostProperties` was added + +* `models.ManagementType` was added + +* `models.SessionHostManagementPatchProperties` was added + +* `models.SessionHostManagementUpdateStatusProperties` was added + +* `models.HostPoolProvisioningAction` was added + +* `models.RelayUDP` was added + +* `models.SessionHost$Update` was added + +* `models.ActiveDirectoryInfoPatchProperties` was added + +* `models.DomainJoinType` was added + +* `models.ScalingPlanPersonalSchedulePatchProperties` was added + +* `models.UserSessionProperties` was added + +* `models.DiffDiskPlacement` was added + +* `models.HostPoolUpdateConfigurationPatchProperties` was added + +* `models.ApplicationPatchProperties` was added + +* `models.CustomInfoProperties` was added + +* `models.SessionHost$UpdateStages` was added + +* `models.SessionHostManagementProvisioningOperationStatus` was added + +* `models.ScalingPlanProperties` was added + +* `models.SessionHostManagements` was added + +* `models.Type` was added + +* `models.StartMenuItemProperties` was added + +* `models.ControlSessionHostProvisionings` was added + +* `models.CreateDeleteProperties` was added + +* `models.FailedSessionHostCleanupPolicySHC` was added + +* `models.SessionHostManagementProperties` was added + +#### `models.PrivateEndpointConnectionWithSystemData` was modified + +* `properties()` was added + +#### `models.ScalingPlanPooledSchedule$Definition` was modified + +* `withProperties(models.ScalingPlanPooledScheduleProperties)` was added + +#### `models.UserSession` was modified + +* `properties()` was added + +#### `models.ScalingPlanPooledSchedule$Update` was modified + +* `withProperties(models.ScalingPlanPooledSchedulePatchProperties)` was added + +#### `models.HostPool$Update` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added +* `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 + +* `withPackageLookbackUrl(java.lang.String)` was added +* `customData()` was added +* `packageLookbackUrl()` was added +* `withCustomData(java.lang.String)` was added + +#### `models.WorkspacePatch` was modified + +* `properties()` was added +* `withProperties(models.WorkspacePatchProperties)` was added + +#### `models.ScalingPlanPersonalSchedule` was modified + +* `properties()` was added + +#### `models.ScalingPlanPersonalSchedule$Definition` was modified + +* `withProperties(models.ScalingPlanPersonalScheduleProperties)` was added + +#### `models.MsixPackage$Update` was modified + +* `withProperties(models.MsixPackagePatchProperties)` was added + +#### `models.Workspace` was modified + +* `properties()` was added + +#### `models.MsixPackage$Definition` was modified + +* `withProperties(models.MsixPackageProperties)` was added + +#### `models.DesktopPatch` was modified + +* `properties()` was added +* `withProperties(models.DesktopPatchProperties)` was added + +#### `models.Application` was modified + +* `properties()` was added + +#### `models.ScalingSchedule` was modified + +* `createDelete()` was added +* `withCreateDelete(models.CreateDeleteProperties)` was added +* `scalingMethod()` was added +* `withScalingMethod(models.ScalingMethodType)` was added + +#### `models.Application$Update` was modified + +* `withProperties(models.ApplicationPatchProperties)` was added + +#### `models.MsixPackageApplications` was modified + +* `appUserModelID()` was added +* `withAppUserModelID(java.lang.String)` was added + +#### `models.Application$Definition` was modified + +* `withProperties(models.ApplicationProperties)` was added + +#### `models.ApplicationGroup` was modified + +* `properties()` was added + +#### `models.HostPool` was modified + +* `properties()` was added +* `listRegistrationTokens(com.azure.core.util.Context)` was added + +#### `models.HostPoolPatch` was modified + +* `withProperties(models.HostPoolPatchProperties)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `properties()` was added +* `identity()` was added + +#### `models.PrivateEndpointConnections` was modified + +* `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 +* `updateByHostPoolWithResponse(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.HostPoolProperties` was modified + +* `managedPrivateUDP()` was added +* `deploymentScope()` was added +* `publicUDP()` was added +* `oboTenantId()` was added +* `relayUDP()` was added +* `allowRDPShortPathWithPrivateLink()` was added +* `directUDP()` was added +* `managementType()` was added + +#### `DesktopVirtualizationManager` was modified + +* `controlSessionHostUpdates()` was added +* `sessionHostManagements()` was added +* `sessionHostManagementUpdateStatuses()` was added +* `activeSessionHostConfigurations()` was added +* `sessionHostManagementProvisioningStatuses()` was added +* `initiateSessionHostUpdates()` was added +* `controlSessionHostProvisionings()` was added +* `sessionHostConfigurations()` was added + +#### `models.PrivateEndpointConnection` was modified + +* `properties()` was added + +#### `models.ScalingHostPoolType` was modified + +* `PERSONAL` was added + +#### `models.AppAttachPackages` was modified + +* `deleteByIdWithResponse(java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added +* `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 + +#### `models.AppAttachPackage$Update` was modified + +* `withTags(java.util.Map)` was added + +#### `models.AppAttachPackageProperties` was modified + +* `deploymentScope()` was added +* `withPackageLookbackUrl(java.lang.String)` was added +* `customData()` was added +* `withPackageOwnerName(java.lang.String)` was added +* `withDeploymentScope(models.DeploymentScope)` was added +* `withCustomData(java.lang.String)` was added +* `packageLookbackUrl()` was added +* `packageOwnerName()` was added + +#### `models.ScalingPlanPooledSchedulePatch` was modified + +* `properties()` was added +* `withProperties(models.ScalingPlanPooledSchedulePatchProperties)` was added + +#### `models.Desktop` was modified + +* `properties()` was added + +#### `models.SessionHostPatch` was modified + +* `properties()` was added +* `withProperties(models.SessionHostPatchProperties)` was added + +#### `models.MsixPackagePatch` was modified + +* `properties()` was added +* `withProperties(models.MsixPackagePatchProperties)` was added + +#### `models.ApplicationGroup$Definition` was modified + +* `withSku(models.Sku)` was added +* `withProperties(models.ApplicationGroupProperties)` was added +* `withPlan(models.Plan)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.MsixPackage` was modified + +* `properties()` was added + +#### `models.LoadBalancerType` was modified + +* `MULTIPLE_PERSISTENT` was added + +#### `models.ApplicationGroupPatch` was modified + +* `properties()` was added +* `withProperties(models.ApplicationGroupPatchProperties)` was added + +#### `models.HostPool$Definition` was modified + +* `withProperties(fluent.models.HostPoolPropertiesInner)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSku(models.Sku)` was added +* `withPlan(models.Plan)` was added + +#### `models.ScalingPlanPooledSchedule` was modified + +* `properties()` 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 + +* `retryProvisioning()` was added +* `properties()` was added +* `listSingleSessionHostRegistrationTokens(models.ScopedRegistrationTokenProperties,com.azure.core.util.Context)` was added +* `refresh(com.azure.core.util.Context)` was added +* `refresh()` was added +* `update()` was added +* `listSingleSessionHostRegistrationTokens(models.ScopedRegistrationTokenProperties)` was added +* `resourceGroupName()` was added +* `retryProvisioningWithResponse(com.azure.core.util.Context)` was added + +#### `models.ExpandMsixImage` was modified + +* `properties()` was added + +#### `models.SessionHosts` was modified + +* `list(java.lang.String,java.lang.String,java.lang.Integer,java.lang.Boolean,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was added +* `listSingleSessionHostRegistrationTokens(java.lang.String,java.lang.String,java.lang.String,models.ScopedRegistrationTokenProperties,com.azure.core.util.Context)` was added +* `getById(java.lang.String)` was added +* `listSingleSessionHostRegistrationTokens(java.lang.String,java.lang.String,java.lang.String,models.ScopedRegistrationTokenProperties)` was added +* `retryProvisioningWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteByIdWithResponse(java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added +* `deleteById(java.lang.String)` was added +* `define(java.lang.String)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `retryProvisioning(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.ScalingPlanPersonalSchedulePatch` was modified + +* `withProperties(models.ScalingPlanPersonalSchedulePatchProperties)` was added +* `properties()` was added + +#### `models.ScalingPlan` was modified + +* `properties()` was added + +#### `models.HostPools` was modified + +* `listRegistrationTokens(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ScalingPlan$Definition` was modified + +* `withProperties(models.ScalingPlanProperties)` was added +* `withPlan(models.Plan)` was added +* `withSku(models.Sku)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.Workspace$Definition` was modified + +* `withProperties(models.WorkspaceProperties)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withSku(models.Sku)` was added +* `withPlan(models.Plan)` was added + +#### `models.ApplicationPatch` was modified + +* `properties()` was added +* `withProperties(models.ApplicationPatchProperties)` was added + +#### `models.RegistrationTokenMinimal` was modified + +* `innerModel()` 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..ee325af9dcd1 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 api-version 2026-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ DesktopVirtualizationManager manager = DesktopVirtualizationManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md index 904b9a25fb83..62852a9a9631 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,14 @@ - [List](#applications_list) - [Update](#applications_update) +## ControlSessionHostProvisioning + +- [Post](#controlsessionhostprovisioning_post) + +## ControlSessionHostUpdate + +- [Post](#controlsessionhostupdate_post) + ## Desktops - [Get](#desktops_get) @@ -48,6 +61,10 @@ - [RetrieveRegistrationToken](#hostpools_retrieveregistrationtoken) - [Update](#hostpools_update) +## InitiateSessionHostUpdate + +- [Post](#initiatesessionhostupdate_post) + ## MsixImages - [Expand](#msiximages_expand) @@ -106,11 +123,36 @@ - [ListByResourceGroup](#scalingplans_listbyresourcegroup) - [Update](#scalingplans_update) +## SessionHostConfigurations + +- [CreateOrUpdate](#sessionhostconfigurations_createorupdate) +- [Get](#sessionhostconfigurations_get) +- [ListByHostPool](#sessionhostconfigurations_listbyhostpool) +- [Update](#sessionhostconfigurations_update) + +## SessionHostManagementProvisioningStatuses + +- [Get](#sessionhostmanagementprovisioningstatuses_get) + +## SessionHostManagementUpdateStatuses + +- [Get](#sessionhostmanagementupdatestatuses_get) + +## SessionHostManagements + +- [CreateOrUpdate](#sessionhostmanagements_createorupdate) +- [Get](#sessionhostmanagements_get) +- [ListByHostPool](#sessionhostmanagements_listbyhostpool) +- [Update](#sessionhostmanagements_update) + ## SessionHosts +- [Create](#sessionhosts_create) - [Delete](#sessionhosts_delete) - [Get](#sessionhosts_get) - [List](#sessionhosts_list) +- [ListSingleSessionHostRegistrationTokens](#sessionhosts_listsinglesessionhostregistrationtokens) +- [RetryProvisioning](#sessionhosts_retryprovisioning) - [Update](#sessionhosts_update) ## StartMenuItems @@ -134,11 +176,58 @@ - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) - [Update](#workspaces_update) +### ActiveSessionHostConfigurations_Get + +```java +/** + * Samples for ActiveSessionHostConfigurations Get. + */ +public final class ActiveSessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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: 2026-01-01-preview/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.DeploymentScope; import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; @@ -150,9 +239,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_CreateOrUpdate.json */ /** * Sample code: AppAttachPackage_Create. @@ -183,7 +270,7 @@ public final class AppAttachPackageCreateOrUpdateSamples { .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") .withDescription("PackageApplicationDescription") - .withAppUserModelId("AppUserModelId") + .withAppUserModelID("AppUserModelId") .withFriendlyName("FriendlyName") .withIconImageName("Iconimagename") .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) @@ -192,7 +279,8 @@ public final class AppAttachPackageCreateOrUpdateSamples { .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) .withHostPoolReferences(Arrays.asList()) .withKeyVaultUrl("fakeTokenPlaceholder") - .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL)) .create(); } } @@ -206,9 +294,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_Delete.json */ /** * Sample code: AppAttachPackage_Delete. @@ -218,7 +304,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); } } ``` @@ -231,9 +317,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_Get.json */ /** * Sample code: AppAttachPackage_Get. @@ -256,9 +340,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_ListBySubscription.json */ /** * Sample code: AppAttachPackage_ListBySubscription. @@ -280,9 +362,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_ListByResourceGroup.json */ /** * Sample code: AppAttachPackage_ListByResourceGroup. @@ -301,15 +381,20 @@ 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. */ public final class AppAttachPackageUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Update.json + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_Update.json */ /** * Sample code: AppAttachPackage_Update. @@ -321,7 +406,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(); } } ``` @@ -337,9 +453,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/AppAttachPackageInfo_Import.json */ /** * Sample code: AppAttachPackageInfo_Import. @@ -349,8 +463,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); } } ``` @@ -358,6 +474,7 @@ public final class AppAttachPackageInfoImportMethodSamples { ### ApplicationGroups_CreateOrUpdate ```java +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupProperties; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; import java.util.HashMap; import java.util.Map; @@ -367,9 +484,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ApplicationGroups_CreateOrUpdate.json */ /** * Sample code: ApplicationGroup_Create. @@ -382,13 +497,14 @@ public final class ApplicationGroupsCreateOrUpdateSamples { .define("applicationGroup1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") - .withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) + .withProperties(new ApplicationGroupProperties().withDescription("des1") + .withFriendlyName("friendly") + .withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) + .withShowInFeed(true) + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") - .withShowInFeed(true) .create(); } @@ -414,17 +530,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -439,9 +553,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ApplicationGroups_Get.json */ /** * Sample code: ApplicationGroup_Get. @@ -464,9 +576,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ApplicationGroups_ListBySubscription.json */ /** * Sample code: ApplicationGroup_List. @@ -488,9 +598,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ApplicationGroups_ListByResourceGroup.json */ /** * Sample code: ApplicationGroup_ListByResourceGroup. @@ -510,6 +618,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; @@ -518,25 +627,23 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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(); } @@ -557,6 +664,7 @@ public final class ApplicationGroupsUpdateSamples { ### Applications_CreateOrUpdate ```java +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; /** @@ -564,28 +672,26 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withDescription("des1") - .withFriendlyName("friendly") - .withFilePath("path") - .withCommandLineArguments("arguments") - .withShowInPortal(true) - .withIconPath("icon") - .withIconIndex(1) + .withProperties(new ApplicationProperties().withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1)) .create(); } } @@ -599,17 +705,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); @@ -625,17 +729,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -650,9 +752,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Applications_List.json */ /** * Sample code: Applications_List. @@ -671,6 +771,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; @@ -679,35 +780,91 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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(); } } ``` +### ControlSessionHostProvisioning_Post + +```java +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter; + +/** + * Samples for ControlSessionHostProvisioning Post. + */ +public final class ControlSessionHostProvisioningPostSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagements_ControlSessionHostProvisioning_Post.json + */ + /** + * Sample code: SessionHostManagements_ControlSessionHostProvisioning_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsControlSessionHostProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.controlSessionHostProvisionings() + .post("resourceGroup1", "hostPool1", + new HostPoolProvisioningControlParameter().withAction(HostPoolProvisioningAction.CANCEL) + .withCancelMessage("Cancel host pool provisioning"), + com.azure.core.util.Context.NONE); + } +} +``` + +### 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: 2026-01-01-preview/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 @@ -716,17 +873,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -741,17 +896,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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,26 +914,26 @@ public final class DesktopsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; +import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; /** * Samples for Desktops Update. */ public final class DesktopsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Update.json + * x-ms-original-file: 2026-01-01-preview/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); } } @@ -789,15 +942,23 @@ public final class DesktopsUpdateSamples { ### HostPools_CreateOrUpdate ```java +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.AllowRDPShortPathWithPrivateLink; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +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; @@ -810,44 +971,52 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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") .withExistingResourceGroup("resourceGroup1") - .withHostPoolType(HostPoolType.POOLED) - .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) - .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + .withProperties( + new HostPoolPropertiesInner().withFriendlyName("friendly") + .withDescription("des1") + .withHostPoolType(HostPoolType.POOLED) + .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) + .withMaxSessionLimit(999999) + .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) + .withRegistrationInfo(new RegistrationInfoInner() + .withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) + .withVmTemplate("{json:json}") + .withSsoadfsAuthority("https://adfs") + .withSsoClientId("client") + .withSsoClientSecretKeyVaultPath("fakeTokenPlaceholder") + .withSsoSecretType(SsoSecretType.SHARED_KEY) + .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + .withStartVMOnConnect(false) + .withAgentUpdate( + new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUDP(ManagedPrivateUDP.ENABLED) + .withDirectUDP(DirectUDP.ENABLED) + .withPublicUDP(PublicUDP.ENABLED) + .withRelayUDP(RelayUDP.ENABLED) + .withManagementType(ManagementType.AUTOMATED) + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL) + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995") + .withAllowRDPShortPathWithPrivateLink(AllowRDPShortPathWithPrivateLink.ENABLED)) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withFriendlyName("friendly") - .withDescription("des1") - .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) - .withMaxSessionLimit(999999) - .withRegistrationInfo( - new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) - .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) - .withVmTemplate("{json:json}") - .withSsoadfsAuthority("https://adfs") - .withSsoClientId("client") - .withSsoClientSecretKeyVaultPath("https://keyvault/secret") - .withSsoSecretType(SsoSecretType.SHARED_KEY) - .withStartVMOnConnect(false) - .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .create(); } @@ -873,17 +1042,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } } @@ -897,17 +1064,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -922,9 +1087,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/HostPool_Lists.json */ /** * Sample code: HostPool_List. @@ -946,16 +1109,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -970,19 +1131,16 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); + manager.hostPools().listRegistrationTokens("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } ``` @@ -995,16 +1153,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); @@ -1016,13 +1172,19 @@ public final class HostPoolsRetrieveRegistrationTokenSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AllowRDPShortPathWithPrivateLink; 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; @@ -1035,43 +1197,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 + * x-ms-original-file: 2026-01-01-preview/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) + .withAllowRDPShortPathWithPrivateLink(AllowRDPShortPathWithPrivateLink.ENABLED)) .apply(); } @@ -1089,6 +1254,41 @@ 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: 2026-01-01-preview/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 @@ -1099,19 +1299,17 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } } @@ -1122,6 +1320,7 @@ public final class MsixImagesExpandSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; import java.time.OffsetDateTime; import java.util.Arrays; @@ -1130,40 +1329,38 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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") - .withImagePath("imagepath") - .withPackageName("MsixPackage_name") - .withPackageFamilyName("MsixPackage_FamilyName") - .withDisplayName("displayname") - .withPackageRelativePath("packagerelativepath") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") - .withPublisher("PublishedName") - .withMinVersion("version"))) - .withVersion("version") - .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") - .withDescription("application-desc") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("friendlyname") - .withIconImageName("Apptile") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withProperties(new MsixPackageProperties().withImagePath("imagepath") + .withPackageName("MsixPackage_name") + .withPackageFamilyName("MsixPackage_FamilyName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") + .withPublisher("PublishedName") + .withMinVersion("version"))) + .withVersion("version") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") + .withDescription("application-desc") + .withAppUserModelID("AppUserModelId") + .withFriendlyName("friendlyname") + .withIconImageName("Apptile") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes())))) .create(); } } @@ -1177,17 +1374,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -1202,17 +1397,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -1227,17 +1420,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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,15 +1438,14 @@ public final class MsixPackagesListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; /** * Samples for MsixPackages Update. */ public final class MsixPackagesUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Update.json + * x-ms-original-file: 2026-01-01-preview/MSIXPackages_Update.json */ /** * Sample code: MSIXPackage_Update. @@ -1267,7 +1457,11 @@ public final class MsixPackagesUpdateSamples { 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(); } } ``` @@ -1280,17 +1474,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } } @@ -1304,16 +1496,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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", @@ -1330,16 +1520,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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", @@ -1356,16 +1544,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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", @@ -1382,16 +1568,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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", @@ -1408,16 +1592,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); @@ -1433,16 +1615,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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 +1633,8 @@ 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -1462,24 +1643,24 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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 PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None"))), com.azure.core.util.Context.NONE); } } @@ -1488,7 +1669,8 @@ 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -1497,24 +1679,24 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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 PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None"))), com.azure.core.util.Context.NONE); } } @@ -1528,9 +1710,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/PrivateLinkResources_ListByHostPool.json */ /** * Sample code: PrivateLinkResources_ListByHostPool. @@ -1553,9 +1733,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. @@ -1574,6 +1752,7 @@ public final class PrivateLinkResourcesListByWorkspaceSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -1585,9 +1764,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. @@ -1599,33 +1776,34 @@ public final class ScalingPlanPersonalSchedulesCreateSamples { manager.scalingPlanPersonalSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(10) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(10) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(10) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(10) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(10) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(10) - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(10) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(10) + .withProperties(new ScalingPlanPersonalScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(10) + .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnLogoff(10) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(10) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(10) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(10) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(10) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(10) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(10)) .create(); } } @@ -1639,9 +1817,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Delete.json */ /** * Sample code: ScalingPlanPersonalSchedules_Delete. @@ -1665,9 +1841,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Get.json */ /** * Sample code: ScalingPlanPersonalSchedules_Get. @@ -1691,9 +1865,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_List.json */ /** * Sample code: ScalingPlanPersonalSchedules_List. @@ -1712,6 +1884,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; @@ -1721,9 +1894,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. @@ -1737,22 +1908,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(); } } @@ -1761,7 +1933,10 @@ public final class ScalingPlanPersonalSchedulesUpdateSamples { ### ScalingPlanPooledSchedules_Create ```java +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -1771,9 +1946,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. @@ -1785,23 +1958,61 @@ public final class ScalingPlanPooledSchedulesCreateSamples { manager.scalingPlanPooledSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withProperties(new ScalingPlanPooledScheduleProperties() + .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)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_CreateUsingCreateDelete.json + */ + /** + * Sample code: ScalingPlanPooledSchedules_CreateUsingCreateDelete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledSchedulesCreateUsingCreateDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withProperties(new ScalingPlanPooledScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(10) + .withRampUpMinimumHostPoolSize(5) + .withRampDownMaximumHostPoolSize(7) + .withRampDownMinimumHostPoolSize(2)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST)) .create(); } } @@ -1815,9 +2026,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Delete.json */ /** * Sample code: ScalingPlanPooledSchedules_Delete. @@ -1841,9 +2050,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Get.json */ /** * Sample code: ScalingPlanPooledSchedules_Get. @@ -1867,9 +2074,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_List.json */ /** * Sample code: ScalingPlanPooledSchedules_List. @@ -1889,6 +2094,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; @@ -1898,9 +2104,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. @@ -1914,14 +2118,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 +2135,11 @@ 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.ScalingPlanProperties; 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; @@ -1945,9 +2151,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Create.json */ /** * Sample code: ScalingPlans_Create. @@ -1960,34 +2164,33 @@ public final class ScalingPlansCreateSamples { .define("scalingPlan1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") - .withTimeZone("Central Standard Time") + .withProperties(new ScalingPlanProperties().withDescription("Description of Scaling Plan") + .withFriendlyName("Scaling Plan 1") + .withTimeZone("Central Standard Time") + .withHostPoolType(ScalingHostPoolType.POOLED) + .withExclusionTag("value") + .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withScalingPlanEnabled(true)))) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("Description of Scaling Plan") - .withFriendlyName("Scaling Plan 1") - .withHostPoolType(ScalingHostPoolType.POOLED) - .withExclusionTag("value") - .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withScalingPlanEnabled(true))) .create(); } @@ -2013,9 +2216,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Delete.json */ /** * Sample code: ScalingPlans_Delete. @@ -2038,9 +2239,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Get.json */ /** * Sample code: ScalingPlans_Get. @@ -2063,9 +2262,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_ListBySubscription.json */ /** * Sample code: ScalingPlans_ListBySubscription. @@ -2087,16 +2284,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); @@ -2112,9 +2307,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_ListByResourceGroup.json */ /** * Sample code: ScalingPlans_ListByResourceGroup. @@ -2131,16 +2324,23 @@ 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. */ public final class ScalingPlansUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Update.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Update.json */ /** * Sample code: ScalingPlans_Update. @@ -2152,7 +2352,470 @@ 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.ManagedDiskProperties; +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.SessionHostConfigurationProperties; +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: 2026-01-01-preview/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().withProperties(new SessionHostConfigurationProperties() + .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() + .withManagedDisk(new ManagedDiskProperties().withType(VirtualMachineDiskType.STANDARD_LRS))) + .withCustomConfigurationScriptUrl( + "https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoProperties().withJoinType(DomainJoinType.ACTIVE_DIRECTORY) + .withActiveDirectoryInfo(new ActiveDirectoryInfoProperties() + .withDomainCredentials(new KeyVaultCredentialsProperties() + .withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withOuPath("OU=testOU,DC=domain,DC=Domain,DC=com") + .withDomainName("wvdarmtest1.net")) + .withAzureActiveDirectoryInfo(new AzureActiveDirectoryInfoProperties() + .withMdmProviderGuid("bdefabc0-95b4-48b3-b645-8a753a63c4fa"))) + .withSecurityInfo(new SecurityInfoProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SessionHostConfigurations_Get + +```java +/** + * Samples for SessionHostConfigurations Get. + */ +public final class SessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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: 2026-01-01-preview/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.DiffDiskOption; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskPlacement; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +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.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: 2026-01-01-preview/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 DiskInfoProperties() + .withDiffDiskSettings(new DiffDiskProperties().withOption(DiffDiskOption.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK))) + .withCustomConfigurationScriptUrl( + "https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoPatchProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoPatchProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoPatchProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo( + new DomainInfoPatchProperties().withActiveDirectoryInfo(new ActiveDirectoryInfoPatchProperties() + .withDomainCredentials(new KeyVaultCredentialsPatchProperties() + .withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")))) + .withSecurityInfo( + new SecurityInfoPatchProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoPatchProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SessionHostManagementProvisioningStatuses_Get + +```java +/** + * Samples for SessionHostManagementProvisioningStatuses Get. + */ +public final class SessionHostManagementProvisioningStatusesGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagements_SessionHostProvisioningStatuses_Get.json + */ + /** + * Sample code: SessionHostManagements_SessionHostProvisioningStatuses_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsSessionHostProvisioningStatusesGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementProvisioningStatuses() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagementUpdateStatuses_Get + +```java +/** + * Samples for SessionHostManagementUpdateStatuses Get. + */ +public final class SessionHostManagementUpdateStatusesGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagementsUpdateStatus_Get.json + */ + /** + * Sample code: SessionHostManagementsUpdateStatus_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdateStatusGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementUpdateStatuses() + .getWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHostManagements_CreateOrUpdate + +```java +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; + +/** + * Samples for SessionHostManagements CreateOrUpdate. + */ +public final class SessionHostManagementsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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().withProperties( + new SessionHostManagementProperties().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: 2026-01-01-preview/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: 2026-01-01-preview/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: 2026-01-01-preview/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); + } +} +``` + +### SessionHosts_Create + +```java +/** + * Samples for SessionHosts Create. + */ +public final class SessionHostsCreateSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Create.json + */ + /** + * Sample code: SessionHost_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + sessionHostCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .define("sessionHost1.microsoft.com") + .withExistingHostPool("resourceGroup1", "hostPool1") + .create(); } } ``` @@ -2165,9 +2828,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Delete.json */ /** * Sample code: SessionHost_Delete. @@ -2191,9 +2852,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Get.json */ /** * Sample code: SessionHost_Get. @@ -2217,9 +2876,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/SessionHosts_List.json */ /** * Sample code: SessionHost_List. @@ -2228,7 +2885,60 @@ 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_ListSingleSessionHostRegistrationTokens + +```java +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SessionHosts ListSingleSessionHostRegistrationTokens. + */ +public final class SessionHostsListSingleSessionHostRegistrationTokensSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHost_ListSingleSessionHostRegistrationTokens_Post.json + */ + /** + * Sample code: SessionHosts_ListSingleSessionHostRegistrationTokens_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostsListSingleSessionHostRegistrationTokensPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .listSingleSessionHostRegistrationTokens( + "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", new ScopedRegistrationTokenProperties() + .withExpirationTimeInUtc(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### SessionHosts_RetryProvisioning + +```java +/** + * Samples for SessionHosts RetryProvisioning. + */ +public final class SessionHostsRetryProvisioningSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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); } } ``` @@ -2236,16 +2946,15 @@ public final class SessionHostsListSamples { ### SessionHosts_Update ```java -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHost; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; /** * Samples for SessionHosts Update. */ public final class SessionHostsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Update.json + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Update.json */ /** * Sample code: SessionHost_Update. @@ -2254,12 +2963,16 @@ public final class SessionHostsUpdateSamples { */ public static void sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts() - .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - new SessionHostPatch().withAllowNewSession(true) - .withAssignedUser("user1@microsoft.com") - .withFriendlyName("friendly"), - com.azure.core.util.Context.NONE); + SessionHost resource = manager.sessionHosts() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SessionHostPatchProperties().withAllowNewSession(true) + .withAssignedUser("user1@microsoft.com") + .withFriendlyName("friendly")) + .withForce(true) + .apply(); } } ``` @@ -2272,17 +2985,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -2297,9 +3008,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/UserSessions_Delete.json */ /** * Sample code: UserSession_Delete. @@ -2323,9 +3032,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/UserSessions_Disconnect.json */ /** * Sample code: UserSession_Disconnect_Post. @@ -2349,17 +3056,15 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); @@ -2375,9 +3080,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/UserSessions_List.json */ /** * Sample code: UserSession_List. @@ -2401,9 +3104,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/UserSessions_ListByHostPool.json */ /** * Sample code: UserSession_ListByHostPool. @@ -2430,9 +3131,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/UserSessions_SendMessage.json */ /** * Sample code: UserSession_SendMessage_Post. @@ -2451,6 +3150,8 @@ public final class UserSessionsSendMessageSamples { ### Workspaces_CreateOrUpdate ```java +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties; import java.util.HashMap; import java.util.Map; @@ -2459,9 +3160,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Workspaces_CreateOrUpdate.json */ /** * Sample code: Workspace_Create. @@ -2475,8 +3174,10 @@ public final class WorkspacesCreateOrUpdateSamples { .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") + .withProperties(new WorkspaceProperties().withDescription("des1") + .withFriendlyName("friendly") + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995") + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL)) .create(); } @@ -2502,9 +3203,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Workspaces_Delete.json */ /** * Sample code: Workspace_Delete. @@ -2527,9 +3226,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Workspaces_Get.json */ /** * Sample code: Workspace_Get. @@ -2552,16 +3249,14 @@ 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 + * x-ms-original-file: 2026-01-01-preview/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); } @@ -2576,9 +3271,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Workspaces_ListByResourceGroup.json */ /** * Sample code: Workspace_ListByResourceGroup. @@ -2596,6 +3289,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; @@ -2604,9 +3298,7 @@ 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 + * x-ms-original-file: 2026-01-01-preview/Workspaces_Update.json */ /** * Sample code: Workspace_Update. @@ -2620,8 +3312,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 dd4a0f8ab583..07a7933794ae 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -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 api-version 2026-01-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,13 +45,9 @@ UTF-8 0 0 + true - - com.azure - azure-json - 1.5.1 - com.azure azure-core @@ -74,5 +70,10 @@ 1.18.3 test + + com.azure + azure-json + 1.5.1 + 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..4080cea93e05 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization; @@ -11,26 +11,31 @@ 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.fluent.DesktopVirtualizationManagementClient; +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.ControlSessionHostProvisioningsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.ControlSessionHostUpdatesImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationManagementClientBuilder; import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsImpl; -import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationApiClientBuilder; 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 +44,24 @@ 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.SessionHostManagementProvisioningStatusesImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementUpdateStatusesImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsImpl; 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.ControlSessionHostProvisionings; +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 +70,10 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedules; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedules; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlans; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurations; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatuses; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatuses; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagements; import com.azure.resourcemanager.desktopvirtualization.models.SessionHosts; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems; import com.azure.resourcemanager.desktopvirtualization.models.UserSessions; @@ -65,56 +82,74 @@ 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 StartMenuItems startMenuItems; - private PrivateLinkResources privateLinkResources; + private ApplicationGroups applicationGroups; - private ScalingPlans scalingPlans; + private AppAttachPackageInfoes appAttachPackageInfoes; - private ScalingPlanPooledSchedules scalingPlanPooledSchedules; + private MsixImages msixImages; - private ScalingPlanPersonalSchedules scalingPlanPersonalSchedules; + private PrivateLinkResources privateLinkResources; - private ApplicationGroups applicationGroups; + private HostPools hostPools; - private StartMenuItems startMenuItems; + private ScalingPlans scalingPlans; + + private Workspaces workspaces; private Applications applications; private Desktops desktops; - private HostPools hostPools; + private PrivateEndpointConnections privateEndpointConnections; + + private SessionHosts sessionHosts; private UserSessions userSessions; - private SessionHosts sessionHosts; + private ScalingPlanPersonalSchedules scalingPlanPersonalSchedules; + + private ScalingPlanPooledSchedules scalingPlanPooledSchedules; private MsixPackages msixPackages; - private AppAttachPackageInfoes appAttachPackageInfoes; + private ActiveSessionHostConfigurations activeSessionHostConfigurations; - private MsixImages msixImages; + private InitiateSessionHostUpdates initiateSessionHostUpdates; - private AppAttachPackages appAttachPackages; + private ControlSessionHostUpdates controlSessionHostUpdates; - private final DesktopVirtualizationApiClient clientObject; + private ControlSessionHostProvisionings controlSessionHostProvisionings; + + private SessionHostManagements sessionHostManagements; + + private SessionHostConfigurations sessionHostConfigurations; + + private SessionHostManagementUpdateStatuses sessionHostManagementUpdateStatuses; + + private SessionHostManagementProvisioningStatuses sessionHostManagementProvisioningStatuses; + + private final DesktopVirtualizationManagementClient clientObject; private DesktopVirtualizationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new DesktopVirtualizationApiClientBuilder().pipeline(httpPipeline) + this.clientObject = new DesktopVirtualizationManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -161,6 +196,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 +306,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 +346,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,102 +372,112 @@ 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 StartMenuItems. * - * @return Resource collection API of PrivateEndpointConnections. + * @return Resource collection API of StartMenuItems. */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + public StartMenuItems startMenuItems() { + if (this.startMenuItems == null) { + this.startMenuItems = new StartMenuItemsImpl(clientObject.getStartMenuItems(), this); } - return privateEndpointConnections; + return startMenuItems; } /** - * Gets the resource collection API of PrivateLinkResources. + * Gets the resource collection API of ApplicationGroups. It manages ApplicationGroup. * - * @return Resource collection API of PrivateLinkResources. + * @return Resource collection API of ApplicationGroups. */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + public ApplicationGroups applicationGroups() { + if (this.applicationGroups == null) { + this.applicationGroups = new ApplicationGroupsImpl(clientObject.getApplicationGroups(), this); } - return privateLinkResources; + return applicationGroups; } /** - * Gets the resource collection API of ScalingPlans. It manages ScalingPlan. + * Gets the resource collection API of AppAttachPackageInfoes. * - * @return Resource collection API of ScalingPlans. + * @return Resource collection API of AppAttachPackageInfoes. */ - public ScalingPlans scalingPlans() { - if (this.scalingPlans == null) { - this.scalingPlans = new ScalingPlansImpl(clientObject.getScalingPlans(), this); + public AppAttachPackageInfoes appAttachPackageInfoes() { + if (this.appAttachPackageInfoes == null) { + this.appAttachPackageInfoes + = new AppAttachPackageInfoesImpl(clientObject.getAppAttachPackageInfoes(), this); } - return scalingPlans; + return appAttachPackageInfoes; } /** - * Gets the resource collection API of ScalingPlanPooledSchedules. It manages ScalingPlanPooledSchedule. + * Gets the resource collection API of MsixImages. * - * @return Resource collection API of ScalingPlanPooledSchedules. + * @return Resource collection API of MsixImages. */ - public ScalingPlanPooledSchedules scalingPlanPooledSchedules() { - if (this.scalingPlanPooledSchedules == null) { - this.scalingPlanPooledSchedules - = new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this); + public MsixImages msixImages() { + if (this.msixImages == null) { + this.msixImages = new MsixImagesImpl(clientObject.getMsixImages(), this); } - return scalingPlanPooledSchedules; + return msixImages; } /** - * Gets the resource collection API of ScalingPlanPersonalSchedules. It manages ScalingPlanPersonalSchedule. + * Gets the resource collection API of PrivateLinkResources. * - * @return Resource collection API of ScalingPlanPersonalSchedules. + * @return Resource collection API of PrivateLinkResources. */ - public ScalingPlanPersonalSchedules scalingPlanPersonalSchedules() { - if (this.scalingPlanPersonalSchedules == null) { - this.scalingPlanPersonalSchedules - = new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); } - return scalingPlanPersonalSchedules; + return privateLinkResources; } /** - * Gets the resource collection API of ApplicationGroups. It manages ApplicationGroup. + * Gets the resource collection API of HostPools. It manages HostPool. * - * @return Resource collection API of ApplicationGroups. + * @return Resource collection API of HostPools. */ - public ApplicationGroups applicationGroups() { - if (this.applicationGroups == null) { - this.applicationGroups = new ApplicationGroupsImpl(clientObject.getApplicationGroups(), this); + public HostPools hostPools() { + if (this.hostPools == null) { + this.hostPools = new HostPoolsImpl(clientObject.getHostPools(), this); } - return applicationGroups; + return hostPools; } /** - * Gets the resource collection API of StartMenuItems. + * Gets the resource collection API of ScalingPlans. It manages ScalingPlan. * - * @return Resource collection API of StartMenuItems. + * @return Resource collection API of ScalingPlans. */ - public StartMenuItems startMenuItems() { - if (this.startMenuItems == null) { - this.startMenuItems = new StartMenuItemsImpl(clientObject.getStartMenuItems(), this); + public ScalingPlans scalingPlans() { + if (this.scalingPlans == null) { + this.scalingPlans = new ScalingPlansImpl(clientObject.getScalingPlans(), this); } - return startMenuItems; + return scalingPlans; + } + + /** + * Gets the resource collection API of Workspaces. It manages Workspace. + * + * @return Resource collection API of Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; } /** @@ -455,15 +505,28 @@ public Desktops desktops() { } /** - * Gets the resource collection API of HostPools. It manages HostPool. + * Gets the resource collection API of PrivateEndpointConnections. * - * @return Resource collection API of HostPools. + * @return Resource collection API of PrivateEndpointConnections. */ - public HostPools hostPools() { - if (this.hostPools == null) { - this.hostPools = new HostPoolsImpl(clientObject.getHostPools(), this); + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } - return hostPools; + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of SessionHosts. It manages SessionHost. + * + * @return Resource collection API of SessionHosts. + */ + public SessionHosts sessionHosts() { + if (this.sessionHosts == null) { + this.sessionHosts = new SessionHostsImpl(clientObject.getSessionHosts(), this); + } + return sessionHosts; } /** @@ -479,15 +542,29 @@ public UserSessions userSessions() { } /** - * Gets the resource collection API of SessionHosts. + * Gets the resource collection API of ScalingPlanPersonalSchedules. It manages ScalingPlanPersonalSchedule. * - * @return Resource collection API of SessionHosts. + * @return Resource collection API of ScalingPlanPersonalSchedules. */ - public SessionHosts sessionHosts() { - if (this.sessionHosts == null) { - this.sessionHosts = new SessionHostsImpl(clientObject.getSessionHosts(), this); + public ScalingPlanPersonalSchedules scalingPlanPersonalSchedules() { + if (this.scalingPlanPersonalSchedules == null) { + this.scalingPlanPersonalSchedules + = new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); } - return sessionHosts; + 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; } /** @@ -503,49 +580,116 @@ public MsixPackages msixPackages() { } /** - * Gets the resource collection API of AppAttachPackageInfoes. + * Gets the resource collection API of ActiveSessionHostConfigurations. * - * @return Resource collection API of AppAttachPackageInfoes. + * @return Resource collection API of ActiveSessionHostConfigurations. */ - public AppAttachPackageInfoes appAttachPackageInfoes() { - if (this.appAttachPackageInfoes == null) { - this.appAttachPackageInfoes - = new AppAttachPackageInfoesImpl(clientObject.getAppAttachPackageInfoes(), this); + public ActiveSessionHostConfigurations activeSessionHostConfigurations() { + if (this.activeSessionHostConfigurations == null) { + this.activeSessionHostConfigurations + = new ActiveSessionHostConfigurationsImpl(clientObject.getActiveSessionHostConfigurations(), this); } - return appAttachPackageInfoes; + return activeSessionHostConfigurations; } /** - * Gets the resource collection API of MsixImages. + * Gets the resource collection API of InitiateSessionHostUpdates. * - * @return Resource collection API of MsixImages. + * @return Resource collection API of InitiateSessionHostUpdates. */ - public MsixImages msixImages() { - if (this.msixImages == null) { - this.msixImages = new MsixImagesImpl(clientObject.getMsixImages(), this); + public InitiateSessionHostUpdates initiateSessionHostUpdates() { + if (this.initiateSessionHostUpdates == null) { + this.initiateSessionHostUpdates + = new InitiateSessionHostUpdatesImpl(clientObject.getInitiateSessionHostUpdates(), this); } - return msixImages; + return initiateSessionHostUpdates; } /** - * 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 ControlSessionHostProvisionings. + * + * @return Resource collection API of ControlSessionHostProvisionings. + */ + public ControlSessionHostProvisionings controlSessionHostProvisionings() { + if (this.controlSessionHostProvisionings == null) { + this.controlSessionHostProvisionings + = new ControlSessionHostProvisioningsImpl(clientObject.getControlSessionHostProvisionings(), this); + } + return controlSessionHostProvisionings; + } + + /** + * Gets the resource collection API of SessionHostManagements. + * + * @return Resource collection API of SessionHostManagements. + */ + public SessionHostManagements sessionHostManagements() { + if (this.sessionHostManagements == null) { + this.sessionHostManagements + = new SessionHostManagementsImpl(clientObject.getSessionHostManagements(), this); + } + return sessionHostManagements; + } + + /** + * Gets the resource collection API of SessionHostConfigurations. + * + * @return Resource collection API of SessionHostConfigurations. + */ + public SessionHostConfigurations sessionHostConfigurations() { + if (this.sessionHostConfigurations == null) { + this.sessionHostConfigurations + = new SessionHostConfigurationsImpl(clientObject.getSessionHostConfigurations(), this); + } + return sessionHostConfigurations; + } + + /** + * Gets the resource collection API of SessionHostManagementUpdateStatuses. + * + * @return Resource collection API of SessionHostManagementUpdateStatuses. + */ + public SessionHostManagementUpdateStatuses sessionHostManagementUpdateStatuses() { + if (this.sessionHostManagementUpdateStatuses == null) { + this.sessionHostManagementUpdateStatuses = new SessionHostManagementUpdateStatusesImpl( + clientObject.getSessionHostManagementUpdateStatuses(), this); + } + return sessionHostManagementUpdateStatuses; + } + + /** + * Gets the resource collection API of SessionHostManagementProvisioningStatuses. + * + * @return Resource collection API of SessionHostManagementProvisioningStatuses. + */ + public SessionHostManagementProvisioningStatuses sessionHostManagementProvisioningStatuses() { + if (this.sessionHostManagementProvisioningStatuses == null) { + this.sessionHostManagementProvisioningStatuses = new SessionHostManagementProvisioningStatusesImpl( + clientObject.getSessionHostManagementProvisioningStatuses(), this); + } + return sessionHostManagementProvisioningStatuses; } /** - * Gets wrapped service client DesktopVirtualizationApiClient providing direct access to the underlying + * Gets wrapped service client DesktopVirtualizationManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. * - * @return Wrapped service client DesktopVirtualizationApiClient. + * @return Wrapped service client DesktopVirtualizationManagementClient. */ - public DesktopVirtualizationApiClient serviceClient() { + public DesktopVirtualizationManagementClient serviceClient() { return this.clientObject; } } 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..8a9a096c7ecb --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ActiveSessionHostConfigurationsClient. + */ +public interface ActiveSessionHostConfigurationsClient { + /** + * Get 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); + + /** + * 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); +} 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..64989afa5ab9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -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 Information to import 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. @@ -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 Information to import 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. @@ -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 Information to import 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. 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..ab321593c78f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -136,114 +136,117 @@ AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachP AppAttachPackageInner appAttachPackage); /** - * Remove an App Attach Package. + * 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 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 schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName); + Mono> updateWithResponseAsync(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch); /** - * Remove an App Attach Package. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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) - Mono deleteAsync(String resourceGroupName, String appAttachPackageName); + Mono updateAsync(String resourceGroupName, String appAttachPackageName); /** - * Remove an App Attach Package. + * 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 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 schema for App Attach Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context); + Response updateWithResponse(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch, Context context); /** - * Remove an App Attach Package. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void delete(String resourceGroupName, String appAttachPackageName); + AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName); /** - * Update an App Attach Package. + * 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 appAttachPackagePatch Object containing App Attach Package definition. + * @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 schema for App Attach Package properties 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 appAttachPackageName, - AppAttachPackagePatch appAttachPackagePatch); + Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, Boolean force); /** - * Update an App Attach Package. + * 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 schema for App Attach Package properties 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 appAttachPackageName); + Mono deleteAsync(String resourceGroupName, String appAttachPackageName); /** - * Update an App Attach Package. + * 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 appAttachPackagePatch Object containing App Attach Package definition. + * @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 schema for App Attach Package properties along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String appAttachPackageName, - AppAttachPackagePatch appAttachPackagePatch, Context context); + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context); /** - * Update an App Attach Package. + * 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 schema for App Attach Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName); + void delete(String resourceGroupName, String appAttachPackageName); /** * List App Attach packages in resource group. @@ -253,7 +256,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); @@ -265,7 +268,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); @@ -277,7 +280,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -291,7 +294,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); @@ -304,7 +307,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String filter); @@ -314,7 +317,7 @@ Response updateWithResponse(String resourceGroupName, Str * * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -324,7 +327,7 @@ Response updateWithResponse(String resourceGroupName, Str * * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -338,7 +341,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, Context context); 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..3fed31bdb690 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -136,114 +136,114 @@ ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicatio ApplicationGroupInner applicationGroup); /** - * Remove an applicationGroup. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName); + Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup); /** - * Remove an applicationGroup. + * 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 A {@link Mono} that completes when a successful response is received. + * @return represents a ApplicationGroup definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String applicationGroupName); + Mono updateAsync(String resourceGroupName, String applicationGroupName); /** - * Remove an applicationGroup. + * 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 the {@link Response}. + * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context); /** - * Remove an applicationGroup. + * 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 represents a ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGroupName); + ApplicationGroupInner update(String resourceGroupName, String applicationGroupName); /** - * Update an applicationGroup. + * 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 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 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 applicationGroupName, - ApplicationGroupPatch applicationGroup); + Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName); /** - * Update an applicationGroup. + * 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 represents a ApplicationGroup 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 applicationGroupName); + Mono deleteAsync(String resourceGroupName, String applicationGroupName); /** - * Update an applicationGroup. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String applicationGroupName, - ApplicationGroupPatch applicationGroup, Context context); + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context); /** - * Update an applicationGroup. + * 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 represents a ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGroupInner update(String resourceGroupName, String applicationGroupName); + void delete(String resourceGroupName, String applicationGroupName); /** * List applicationGroups. @@ -256,7 +256,7 @@ Response updateWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer pageSize, @@ -269,7 +269,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); @@ -281,7 +281,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -298,7 +298,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, @@ -311,7 +311,7 @@ PagedIterable listByResourceGroup(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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String filter); @@ -321,7 +321,7 @@ PagedIterable listByResourceGroup(String resourceGroupNam * * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -331,7 +331,7 @@ PagedIterable listByResourceGroup(String resourceGroupNam * * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -344,7 +344,7 @@ PagedIterable listByResourceGroup(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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, Context context); 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..6ef777da8b39 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -143,22 +143,23 @@ ApplicationInner createOrUpdate(String resourceGroupName, String applicationGrou ApplicationInner application); /** - * Remove an application. + * 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 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 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> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application); /** - * Remove an application. + * Update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -166,29 +167,30 @@ Mono> deleteWithResponseAsync(String resourceGroupName, String ap * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 updateAsync(String resourceGroupName, String applicationGroupName, String applicationName); /** - * Remove an application. + * 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 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 schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, - Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application, Context context); /** - * Remove an application. + * Update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -196,28 +198,28 @@ 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 schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String applicationGroupName, String applicationName); + ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName); /** - * Update an application. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationPatch application); + Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName); /** - * Update an application. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -225,30 +227,29 @@ 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 schema for Application properties 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 applicationGroupName, String applicationName); + Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName); /** - * Update an application. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationPatch application, Context context); + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** - * Update an application. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -256,10 +257,9 @@ Response updateWithResponse(String resourceGroupName, String a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName); + void delete(String resourceGroupName, String applicationGroupName, String applicationName); /** * List applications. @@ -272,7 +272,7 @@ Response updateWithResponse(String resourceGroupName, String a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Application definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, @@ -286,7 +286,7 @@ PagedFlux listAsync(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 applicationList as paginated response with {@link PagedFlux}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName); @@ -299,7 +299,7 @@ PagedFlux listAsync(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 applicationList as paginated response with {@link PagedIterable}. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -316,7 +316,7 @@ PagedFlux listAsync(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 applicationList as paginated response with {@link PagedIterable}. + * @return list of Application 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/ControlSessionHostProvisioningsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostProvisioningsClient.java new file mode 100644 index 000000000000..cfea9f5b787a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostProvisioningsClient.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.HostPoolProvisioningControlParameter; +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 ControlSessionHostProvisioningsClient. + */ +public interface ControlSessionHostProvisioningsClient { + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context); +} 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..883f5f06472e --- /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) TypeSpec 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/DesktopVirtualizationManagementClient.java similarity index 66% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationManagementClient.java index 12f17ea6865b..bd166520b0ef 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/DesktopVirtualizationManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for DesktopVirtualizationApiClient class. + * The interface for DesktopVirtualizationManagementClient class. */ -public interface DesktopVirtualizationApiClient { +public interface DesktopVirtualizationManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -54,60 +54,67 @@ 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 StartMenuItemsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the StartMenuItemsClient object. */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + StartMenuItemsClient getStartMenuItems(); /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the ApplicationGroupsClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the ApplicationGroupsClient object. */ - PrivateLinkResourcesClient getPrivateLinkResources(); + ApplicationGroupsClient getApplicationGroups(); /** - * Gets the ScalingPlansClient object to access its operations. + * Gets the AppAttachPackageInfoesClient object to access its operations. * - * @return the ScalingPlansClient object. + * @return the AppAttachPackageInfoesClient object. */ - ScalingPlansClient getScalingPlans(); + AppAttachPackageInfoesClient getAppAttachPackageInfoes(); /** - * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * Gets the MsixImagesClient object to access its operations. * - * @return the ScalingPlanPooledSchedulesClient object. + * @return the MsixImagesClient object. */ - ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules(); + MsixImagesClient getMsixImages(); /** - * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the ScalingPlanPersonalSchedulesClient object. + * @return the PrivateLinkResourcesClient object. */ - ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules(); + PrivateLinkResourcesClient getPrivateLinkResources(); /** - * Gets the ApplicationGroupsClient object to access its operations. + * Gets the HostPoolsClient object to access its operations. * - * @return the ApplicationGroupsClient object. + * @return the HostPoolsClient object. */ - ApplicationGroupsClient getApplicationGroups(); + HostPoolsClient getHostPools(); /** - * Gets the StartMenuItemsClient object to access its operations. + * Gets the ScalingPlansClient object to access its operations. * - * @return the StartMenuItemsClient object. + * @return the ScalingPlansClient object. */ - StartMenuItemsClient getStartMenuItems(); + ScalingPlansClient getScalingPlans(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); /** * Gets the ApplicationsClient object to access its operations. @@ -124,11 +131,18 @@ public interface DesktopVirtualizationApiClient { DesktopsClient getDesktops(); /** - * Gets the HostPoolsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the HostPoolsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - HostPoolsClient getHostPools(); + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the SessionHostsClient object to access its operations. + * + * @return the SessionHostsClient object. + */ + SessionHostsClient getSessionHosts(); /** * Gets the UserSessionsClient object to access its operations. @@ -138,11 +152,18 @@ public interface DesktopVirtualizationApiClient { UserSessionsClient getUserSessions(); /** - * Gets the SessionHostsClient object to access its operations. + * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. * - * @return the SessionHostsClient object. + * @return the ScalingPlanPersonalSchedulesClient object. */ - SessionHostsClient getSessionHosts(); + ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules(); + + /** + * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * + * @return the ScalingPlanPooledSchedulesClient object. + */ + ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules(); /** * Gets the MsixPackagesClient object to access its operations. @@ -152,23 +173,58 @@ public interface DesktopVirtualizationApiClient { MsixPackagesClient getMsixPackages(); /** - * Gets the AppAttachPackageInfoesClient object to access its operations. + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. * - * @return the AppAttachPackageInfoesClient object. + * @return the ActiveSessionHostConfigurationsClient object. */ - AppAttachPackageInfoesClient getAppAttachPackageInfoes(); + ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations(); /** - * Gets the MsixImagesClient object to access its operations. + * Gets the InitiateSessionHostUpdatesClient object to access its operations. * - * @return the MsixImagesClient object. + * @return the InitiateSessionHostUpdatesClient object. */ - MsixImagesClient getMsixImages(); + InitiateSessionHostUpdatesClient getInitiateSessionHostUpdates(); /** - * 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 ControlSessionHostProvisioningsClient object to access its operations. + * + * @return the ControlSessionHostProvisioningsClient object. + */ + ControlSessionHostProvisioningsClient getControlSessionHostProvisionings(); + + /** + * Gets the SessionHostManagementsClient object to access its operations. + * + * @return the SessionHostManagementsClient object. + */ + SessionHostManagementsClient getSessionHostManagements(); + + /** + * Gets the SessionHostConfigurationsClient object to access its operations. + * + * @return the SessionHostConfigurationsClient object. + */ + SessionHostConfigurationsClient getSessionHostConfigurations(); + + /** + * Gets the SessionHostManagementUpdateStatusesClient object to access its operations. + * + * @return the SessionHostManagementUpdateStatusesClient object. + */ + SessionHostManagementUpdateStatusesClient getSessionHostManagementUpdateStatuses(); + + /** + * Gets the SessionHostManagementProvisioningStatusesClient object to access its operations. + * + * @return the SessionHostManagementProvisioningStatusesClient object. + */ + SessionHostManagementProvisioningStatusesClient getSessionHostManagementProvisioningStatuses(); } 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..f3de4741e0c7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -83,7 +83,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 +113,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. @@ -149,7 +149,7 @@ Response updateWithResponse(String resourceGroupName, String appli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Desktop definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, @@ -163,7 +163,7 @@ PagedFlux listAsync(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 desktopList as paginated response with {@link PagedFlux}. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String applicationGroupName); @@ -176,7 +176,7 @@ PagedFlux listAsync(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 desktopList as paginated response with {@link PagedIterable}. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -193,7 +193,7 @@ PagedFlux listAsync(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 desktopList as paginated response with {@link PagedIterable}. + * @return list of Desktop 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/HostPoolsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java index b8f2b9c69a58..f206c44429b8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -12,7 +12,7 @@ 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.fluent.models.RegistrationTokenListInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; import reactor.core.publisher.Mono; @@ -134,115 +134,115 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool); /** - * Remove a host pool. + * 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 force Force flag to delete sessionHost. + * @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 the {@link Response} 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) - Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force); + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool); /** - * Remove a host pool. + * 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 A {@link Mono} that completes when a successful response is received. + * @return represents a HostPool definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostPoolName); + Mono updateAsync(String resourceGroupName, String hostPoolName); /** - * Remove a host pool. + * 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 force Force flag to delete sessionHost. + * @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 the {@link Response}. + * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, + Context context); /** - * Remove a host pool. + * 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 represents a HostPool definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hostPoolName); + HostPoolInner update(String resourceGroupName, String hostPoolName); /** - * Update a host pool. + * 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 hostPool Object containing HostPool definitions. + * @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 represents a HostPool 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, - HostPoolPatch hostPool); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force); /** - * Update a host pool. + * 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 represents a HostPool 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); + Mono deleteAsync(String resourceGroupName, String hostPoolName); /** - * Update a host pool. + * 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 hostPool Object containing HostPool definitions. + * @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 represents a HostPool definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, - Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, Context context); /** - * Update a host pool. + * 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 represents a HostPool definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - HostPoolInner update(String resourceGroupName, String hostPoolName); + void delete(String resourceGroupName, String hostPoolName); /** * List hostPools. @@ -254,7 +254,7 @@ Response updateWithResponse(String resourceGroupName, String 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 hostPoolList as paginated response with {@link PagedFlux}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, @@ -267,7 +267,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); @@ -279,7 +279,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -295,7 +295,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, @@ -310,7 +310,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); @@ -320,7 +320,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integ * * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -330,7 +330,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integ * * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -345,41 +345,39 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of RegistrationToken definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, - String hostPoolName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRegistrationTokens(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,10 +385,10 @@ 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRegistrationTokens(String resourceGroupName, String hostPoolName, Context context); /** @@ -401,40 +399,28 @@ Response retrieveRegistrationTokenWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName); - - /** - * 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 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 +428,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..112be0df5ae2 --- /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) TypeSpec 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..9ffe40ceb402 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -18,47 +18,53 @@ 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, - MsixImageUri msixImageUri); + 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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); + 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 Represents URI referring to MSIX Image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, + 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/fluent/MsixPackagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java index 5a00acdae0e4..11f70535a5dc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -143,81 +143,87 @@ MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, S MsixPackageInner msixPackage); /** - * Remove an MSIX Package. + * Update 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 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 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> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage); /** - * Remove an MSIX Package. + * Update 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 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 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 updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage); /** - * Remove an MSIX Package. + * Update 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 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. * @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 updateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage, Context context); /** - * Remove an MSIX Package. + * Update 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 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) - void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); + MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage); /** - * Update an MSIX Package. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackagePatch msixPackage); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName); /** - * Update an MSIX Package. + * 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. @@ -225,30 +231,29 @@ 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 schema for MSIX Package properties 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 msixPackageFullName); + Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** - * Update an MSIX Package. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackagePatch msixPackage, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** - * Update an MSIX Package. + * 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. @@ -256,10 +261,9 @@ 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 schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName); + void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName); /** * List MSIX packages in hostpool. @@ -272,7 +276,7 @@ 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 msixPackageList as paginated response with {@link PagedFlux}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, @@ -286,7 +290,7 @@ PagedFlux listAsync(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 msixPackageList as paginated response with {@link PagedFlux}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String hostPoolName); @@ -299,7 +303,7 @@ PagedFlux listAsync(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 msixPackageList as paginated response with {@link PagedIterable}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String hostPoolName); @@ -316,7 +320,7 @@ PagedFlux listAsync(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 msixPackageList as paginated response with {@link PagedIterable}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, 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..b6b8f17bb9b7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -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..780a6998e380 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -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,250 +18,194 @@ */ 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 listByWorkspaceAsync(String resourceGroupName, - String workspaceName); - - /** - * List private endpoint connections. - * - * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName); - - /** - * List private endpoint connections. - * - * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context); - - /** - * Get a private endpoint connection. - * - * @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 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> getByWorkspaceWithResponseAsync( - 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 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName); + 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 along with {@link Response}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, + PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * Remove a connection. + * Approve or reject a private endpoint connection. * * @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 {@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> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName); + Mono> updateByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Approve or reject a private endpoint connection. * * @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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName); + Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a connection. + * Approve or reject a private endpoint connection. * * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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. + * Approve or reject a private endpoint connection. * * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + 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 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> updateByWorkspaceWithResponseAsync( - 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 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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection); + 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 along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** * List private endpoint connections associated with hostpool. @@ -275,8 +218,8 @@ PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByHostPoolAsync(String resourceGroupName, @@ -290,8 +233,8 @@ PagedFlux listByHostPoolAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByHostPoolAsync(String resourceGroupName, @@ -305,8 +248,8 @@ PagedFlux listByHostPoolAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHostPool(String resourceGroupName, @@ -324,210 +267,246 @@ PagedIterable listByHostPool(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ @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 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. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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); + + /** + * List private endpoint connections associated with 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName); + + /** + * List private endpoint connections associated with 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); + + /** + * List private endpoint connections associated with 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); } 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..b57bf287d4db 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -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..8d8b301d1945 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -146,22 +146,24 @@ ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scaling String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule); /** - * Remove a ScalingPlanPersonalSchedule. + * 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 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 ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName); + Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule); /** - * Remove a ScalingPlanPersonalSchedule. + * Update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -169,29 +171,31 @@ Mono> deleteWithResponseAsync(String resourceGroupName, String sc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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) - Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Remove a ScalingPlanPersonalSchedule. + * 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 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 ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context); /** - * Remove a ScalingPlanPersonalSchedule. + * Update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -199,29 +203,29 @@ 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 represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Update a ScalingPlanPersonalSchedule. + * 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 scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule 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 scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule); + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Update a ScalingPlanPersonalSchedule. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -229,31 +233,29 @@ Mono> updateWithResponseAsync(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 represents a ScalingPlanPersonalSchedule 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 scalingPlanName, - String scalingPlanScheduleName); + Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * Update a ScalingPlanPersonalSchedule. + * 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 scalingPlanSchedule Object containing ScalingPlanPersonalSchedule 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 ScalingPlanPersonalSchedule definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * Update a ScalingPlanPersonalSchedule. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -261,11 +263,9 @@ Response updateWithResponse(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName); + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** * List ScalingPlanPersonalSchedules. @@ -278,7 +278,7 @@ ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scaling * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String scalingPlanName, @@ -292,7 +292,7 @@ PagedFlux listAsync(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 scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String scalingPlanName); @@ -305,7 +305,7 @@ PagedFlux listAsync(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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String scalingPlanName); @@ -322,7 +322,7 @@ PagedFlux listAsync(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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String scalingPlanName, 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..baaf5d300a38 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -146,22 +146,24 @@ ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPl String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule); /** - * Remove a ScalingPlanPooledSchedule. + * 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 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 ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName); + Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule); /** - * Remove a ScalingPlanPooledSchedule. + * Update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -169,29 +171,31 @@ Mono> deleteWithResponseAsync(String resourceGroupName, String sc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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) - Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Remove a ScalingPlanPooledSchedule. + * 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 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 ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, - Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context); /** - * Remove a ScalingPlanPooledSchedule. + * Update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -199,29 +203,29 @@ 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 represents a ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Update a ScalingPlanPooledSchedule. + * 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 scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule 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 scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule); + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** - * Update a ScalingPlanPooledSchedule. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -229,31 +233,29 @@ Mono> updateWithResponseAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName); + Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** - * Update a ScalingPlanPooledSchedule. + * 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 scalingPlanSchedule Object containing ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** - * Update a ScalingPlanPooledSchedule. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -261,11 +263,9 @@ Response updateWithResponse(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName); + void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); /** * List ScalingPlanPooledSchedules. @@ -278,7 +278,7 @@ ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String scalingPlanName, @@ -292,7 +292,7 @@ PagedFlux listAsync(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 scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String scalingPlanName); @@ -305,7 +305,7 @@ PagedFlux listAsync(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 scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String scalingPlanName); @@ -322,7 +322,7 @@ PagedFlux listAsync(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 scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String scalingPlanName, 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..e2cd6bcdb545 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -82,7 +82,8 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, @@ -97,7 +98,7 @@ Mono> createWithResponseAsync(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 scalingPlan on successful completion of {@link Mono}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono createAsync(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); @@ -112,7 +113,7 @@ Mono> createWithResponseAsync(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 scalingPlan along with {@link Response}. + * @return represents a scaling plan definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createWithResponse(String resourceGroupName, String scalingPlanName, @@ -127,119 +128,120 @@ Response createWithResponse(String resourceGroupName, String 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 scalingPlan. + * @return represents a scaling plan definition. */ @ServiceMethod(returns = ReturnType.SINGLE) ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); /** - * Remove a scaling plan. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName); + Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan); /** - * Remove a scaling plan. + * 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 A {@link Mono} that completes when a successful response is received. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String scalingPlanName); + Mono updateAsync(String resourceGroupName, String scalingPlanName); /** - * Remove a scaling plan. + * 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 the {@link Response}. + * @return represents a scaling plan definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context); /** - * Remove a scaling plan. + * 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 represents a scaling plan definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String scalingPlanName); + ScalingPlanInner update(String resourceGroupName, String scalingPlanName); /** - * Update a scaling plan. + * Remove 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan); + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName); /** - * Update a scaling plan. + * Remove 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String scalingPlanName); + Mono deleteAsync(String resourceGroupName, String scalingPlanName); /** - * Update a scaling plan. + * Remove 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String scalingPlanName, - ScalingPlanPatch scalingPlan, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context); /** - * Update a scaling plan. + * Remove 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanInner update(String resourceGroupName, String scalingPlanName); + void delete(String resourceGroupName, String scalingPlanName); /** * List scaling plans. @@ -251,7 +253,7 @@ Response updateWithResponse(String resourceGroupName, String 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 PagedFlux}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, @@ -264,7 +266,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, I * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); @@ -276,7 +278,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, I * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -292,7 +294,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, I * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, @@ -307,7 +309,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, In * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip); @@ -317,7 +319,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, In * * @throws com.azure.core.management.exception.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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -327,7 +329,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, In * * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -342,7 +344,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, In * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -358,7 +360,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, In * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, @@ -372,7 +374,7 @@ 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); @@ -385,7 +387,7 @@ 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); @@ -402,7 +404,7 @@ 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, 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..e05ce9b0eaab --- /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) TypeSpec 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 { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementProvisioningStatusesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementProvisioningStatusesClient.java new file mode 100644 index 000000000000..5a1021e0e175 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementProvisioningStatusesClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostManagementProvisioningStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SessionHostManagementProvisioningStatusesClient. + */ +public interface SessionHostManagementProvisioningStatusesClient { + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String hostPoolName, Context context); + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementProvisioningStatusInner get(String resourceGroupName, String hostPoolName); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementUpdateStatusesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementUpdateStatusesClient.java new file mode 100644 index 000000000000..cd933ccee48f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementUpdateStatusesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 SessionHostManagementUpdateStatusesClient. + */ +public interface SessionHostManagementUpdateStatusesClient { + /** + * 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/SessionHostManagementsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsClient.java new file mode 100644 index 000000000000..c71f339e5506 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SessionHostManagementsClient. + */ +public interface SessionHostManagementsClient { + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostManagementInner get(String resourceGroupName, String hostPoolName); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement 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); + + /** + * 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); +} 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..0b80127a12f2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -10,7 +10,9 @@ 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.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; import reactor.core.publisher.Mono; @@ -23,7 +25,7 @@ public interface SessionHostsClient { * * @param resourceGroupName The 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 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. @@ -31,28 +33,28 @@ public interface SessionHostsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname); + String sessionHostName); /** * 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 sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a session host on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostName); /** * 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 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. @@ -60,7 +62,7 @@ Mono> getWithResponseAsync(String resourceGroupName, * @return a session host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Context context); /** @@ -68,137 +70,137 @@ Response getWithResponse(String resourceGroupName, String 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 sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a session host. */ @ServiceMethod(returns = ReturnType.SINGLE) - SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostname); + 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 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 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. - * @param sessionHostname The name of the session host within the specified host pool. + * @param sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @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 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 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. - * @param sessionHostname The name of the session host within the specified host pool. + * @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 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 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 com.azure.core.management.exception.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. - * @param sessionHostname The name of the session host within the specified host pool. + * @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 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 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 com.azure.core.management.exception.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. - * @param sessionHostname The name of the session host within the specified host pool. + * @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 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. @@ -208,14 +210,15 @@ Response updateWithResponse(String resourceGroupName, String h * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList as paginated response with {@link PagedFlux}. + * @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); + Boolean isDescending, Integer initialSkip, String vmPath); /** * List sessionHosts. @@ -225,7 +228,7 @@ PagedFlux listAsync(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 sessionHostList as paginated response with {@link PagedFlux}. + * @return list of SessionHost definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String resourceGroupName, String hostPoolName); @@ -238,7 +241,7 @@ PagedFlux listAsync(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 sessionHostList as paginated response with {@link PagedIterable}. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String hostPoolName); @@ -251,13 +254,186 @@ PagedFlux listAsync(String resourceGroupName, String hostPoolN * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. + * @param vmPath The path to the VM. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList as paginated response with {@link PagedIterable}. + * @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, Context context); + Boolean isDescending, Integer initialSkip, String vmPath, Context context); + + /** + * create or update 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 resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, SessionHostInner resource); + + /** + * create or update 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 resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHost definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + SessionHostInner resource); + + /** + * create or update 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 resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHost definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + SessionHostInner resource, Context context); + + /** + * create or update 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 resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SessionHost definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionHostInner create(String resourceGroupName, String hostPoolName, String sessionHostName, + SessionHostInner resource); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostName); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + Context context); + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostName); + + /** + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 list of RegistrationToken definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listSingleSessionHostRegistrationTokensAsync(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body); + + /** + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body); + + /** + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body, Context context); } 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..56b96e23bae7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -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..47e5247aa66d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -19,248 +19,248 @@ */ public interface UserSessionsClient { /** - * List userSessions. + * Get 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 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 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 userSession along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, String userSessionId); /** - * List userSessions. + * Get 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 userSession on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId); /** - * List userSessions. + * Get 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 a userSession along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Context context); /** - * List userSessions. + * Get 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 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. + * @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 PagedIterable}. + * @return a userSession. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** - * Get a userSession. + * Remove 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 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 force Force flag to login off userSession. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a userSession 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> getWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Boolean force); /** - * Get a userSession. + * Remove 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 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 userSession on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId); + Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** - * Get a userSession. + * Remove 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 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 force Force flag to login off userSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a userSession along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Boolean force, Context context); /** - * Get a userSession. + * Remove 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 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 userSession. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void delete(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. + * @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 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> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Boolean force); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @param sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostName); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. - * @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 the {@link Response}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Boolean force, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * List userSessions. + * 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 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 userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip); /** - * List userSessions. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 listAsync(String resourceGroupName, String hostPoolName, String sessionHostname); + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName); /** - * List userSessions. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list(String resourceGroupName, String hostPoolName, String sessionHostname); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * List userSessions. + * 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 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. @@ -268,10 +268,10 @@ PagedFlux listAsync(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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** @@ -279,7 +279,7 @@ PagedIterable list(String resourceGroupName, String hostPoolNa * * @param resourceGroupName The 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 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. @@ -288,14 +288,14 @@ PagedIterable list(String resourceGroupName, String hostPoolNa */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId); + String sessionHostName, String userSessionId); /** * 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 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. @@ -303,7 +303,7 @@ 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 disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** @@ -311,7 +311,7 @@ Mono disconnectAsync(String resourceGroupName, String hostPoolName, 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. + * @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. @@ -320,7 +320,7 @@ Mono disconnectAsync(String resourceGroupName, String hostPoolName, String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Context context); /** @@ -328,23 +328,23 @@ Response disconnectWithResponse(String resourceGroupName, String hostPoolN * * @param resourceGroupName The 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 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void disconnect(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** * 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 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 sendMessage Represents message sent to a UserSession. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -352,14 +352,14 @@ Response disconnectWithResponse(String resourceGroupName, String hostPoolN */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, SendMessage sendMessage); + String sessionHostName, String userSessionId, SendMessage sendMessage); /** * 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 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. @@ -367,7 +367,7 @@ Mono> sendMessageWithResponseAsync(String resourceGroupName, Stri * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** @@ -375,9 +375,9 @@ Mono sendMessageAsync(String resourceGroupName, String hostPoolName, Strin * * @param resourceGroupName The 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 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 sendMessage Represents message sent to a UserSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -385,7 +385,7 @@ Mono sendMessageAsync(String resourceGroupName, String hostPoolName, Strin * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage, Context context); /** @@ -393,12 +393,12 @@ Response sendMessageWithResponse(String resourceGroupName, String 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 sessionHostname The name of the session host within the specified host pool. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); } 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..d934ce7830b1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent; @@ -132,113 +132,113 @@ Response createOrUpdateWithResponse(String resourceGroupName, St WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace); /** - * Remove a 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 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 Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName); + Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspacePatch workspace); /** - * Remove a workspace. + * Update 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 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 updateAsync(String resourceGroupName, String workspaceName); /** - * Remove a 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 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 Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context); + Response updateWithResponse(String resourceGroupName, String workspaceName, + WorkspacePatch workspace, Context context); /** - * Remove a workspace. + * Update 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 represents a Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName); + WorkspaceInner update(String resourceGroupName, String workspaceName); /** - * Update a workspace. + * Remove 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspacePatch workspace); + Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName); /** - * Update a workspace. + * 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 represents a Workspace 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 workspaceName); + Mono deleteAsync(String resourceGroupName, String workspaceName); /** - * Update a workspace. + * Remove 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String workspaceName, - WorkspacePatch workspace, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * Update a workspace. + * 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 represents a Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner update(String resourceGroupName, String workspaceName); + void delete(String resourceGroupName, String workspaceName); /** * List workspaces. @@ -250,7 +250,7 @@ Response updateWithResponse(String resourceGroupName, String wor * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, @@ -263,7 +263,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Int * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); @@ -275,7 +275,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Int * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -291,7 +291,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupName, Int * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, @@ -302,7 +302,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Inte * * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -312,7 +312,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Inte * * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -324,7 +324,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions 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/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..cff83d7da506 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +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.ActiveSessionHostConfigurationProperties; +import java.io.IOException; + +/** + * Schema for ActiveSessionHostConfiguration properties. + */ +@Immutable +public final class ActiveSessionHostConfigurationInner extends ProxyResource { + /* + * Detailed properties for ActiveSessionHostConfiguration + */ + private ActiveSessionHostConfigurationProperties properties; + + /* + * 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. + */ + private ActiveSessionHostConfigurationInner() { + } + + /** + * Get the properties property: Detailed properties for ActiveSessionHostConfiguration. + * + * @return the properties value. + */ + public ActiveSessionHostConfigurationProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = 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/AppAttachPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java index 62533c697736..1207a530ea7a 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 @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -128,23 +127,6 @@ public AppAttachPackageInner withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property properties in model AppAttachPackageInner")); - } else { - properties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AppAttachPackageInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java index 0ebffdecc946..253a0e5bd5f8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.ApplicationGroupType; -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.ApplicationGroupProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; import java.util.Map; @@ -22,25 +21,54 @@ * Represents a ApplicationGroup definition. */ @Fluent -public final class ApplicationGroupInner extends ResourceModelWithAllowedPropertySet { +public final class ApplicationGroupInner extends Resource { /* * Detailed properties for ApplicationGroup */ - private ApplicationGroupProperties innerProperties = new ApplicationGroupProperties(); + private ApplicationGroupProperties properties; /* - * 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. */ @@ -63,299 +91,202 @@ public ApplicationGroupInner() { } /** - * Get the innerProperties property: Detailed properties for ApplicationGroup. + * Get the properties property: Detailed properties for ApplicationGroup. * - * @return the innerProperties value. + * @return the properties value. */ - private ApplicationGroupProperties innerProperties() { - return this.innerProperties; + public ApplicationGroupProperties properties() { + return this.properties; } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Set the properties property: Detailed properties for ApplicationGroup. * - * @return the systemData value. + * @param properties the properties value to set. + * @return the ApplicationGroupInner object itself. */ - @Override - public SystemData systemData() { - return this.systemData; + public ApplicationGroupInner withProperties(ApplicationGroupProperties properties) { + this.properties = properties; + 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. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the etag value. + * @return the identity value. */ - @Override - public String etag() { - return this.etag; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Get the type property: The type of the resource. + * Set the identity property: The managed service identities assigned to this resource. * - * @return the type value. + * @param identity the identity value to set. + * @return the ApplicationGroupInner object itself. */ - @Override - public String type() { - return this.type; + public ApplicationGroupInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; } /** - * Get the name property: The name of the resource. + * 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 name value. + * @return the etag value. */ - @Override - public String name() { - return this.name; + public String etag() { + return this.etag; } /** - * Get the id property: Fully qualified resource Id for 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 id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} + * @return the kind value. */ - @Override - public ApplicationGroupInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); - return this; + public String kind() { + return this.kind; } /** - * {@inheritDoc} + * 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 ApplicationGroupInner object itself. */ - @Override public ApplicationGroupInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicationGroupInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); + this.kind = kind; return this; } /** - * {@inheritDoc} - */ - @Override - public ApplicationGroupInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicationGroupInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicationGroupInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApplicationGroupInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the objectId property: ObjectId of ApplicationGroup. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * Get the description property: Description of ApplicationGroup. + * 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 description value. + * @return the managedBy value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public String managedBy() { + return this.managedBy; } /** - * Set the description property: Description of ApplicationGroup. + * 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 description the description value to set. + * @param managedBy the managedBy value to set. * @return the ApplicationGroupInner object itself. */ - public ApplicationGroupInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupProperties(); - } - this.innerProperties().withDescription(description); + public ApplicationGroupInner withManagedBy(String managedBy) { + this.managedBy = managedBy; return this; } /** - * Get the friendlyName property: Friendly name of ApplicationGroup. + * Get the plan property: Details of the resource plan. * - * @return the friendlyName value. + * @return the plan value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + public Plan plan() { + return this.plan; } /** - * Set the friendlyName property: Friendly name of ApplicationGroup. + * Set the plan property: Details of the resource plan. * - * @param friendlyName the friendlyName value to set. + * @param plan the plan value to set. * @return the ApplicationGroupInner object itself. */ - public ApplicationGroupInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); + public ApplicationGroupInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * Get the hostPoolArmPath property: HostPool arm path of ApplicationGroup. + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the hostPoolArmPath value. + * @return the sku value. */ - public String hostPoolArmPath() { - return this.innerProperties() == null ? null : this.innerProperties().hostPoolArmPath(); + public Sku sku() { + return this.sku; } /** - * Set the hostPoolArmPath property: HostPool arm path of ApplicationGroup. + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @param hostPoolArmPath the hostPoolArmPath value to set. + * @param sku the sku value to set. * @return the ApplicationGroupInner object itself. */ - public ApplicationGroupInner withHostPoolArmPath(String hostPoolArmPath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupProperties(); - } - this.innerProperties().withHostPoolArmPath(hostPoolArmPath); + public ApplicationGroupInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the workspaceArmPath property: Workspace arm path of ApplicationGroup. - * - * @return the workspaceArmPath value. - */ - public String workspaceArmPath() { - return this.innerProperties() == null ? null : this.innerProperties().workspaceArmPath(); - } - - /** - * Get the applicationGroupType property: Resource Type of ApplicationGroup. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the applicationGroupType value. + * @return the systemData value. */ - public ApplicationGroupType applicationGroupType() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGroupType(); + public SystemData systemData() { + return this.systemData; } /** - * Set the applicationGroupType property: Resource Type of ApplicationGroup. + * Get the type property: The type of the resource. * - * @param applicationGroupType the applicationGroupType value to set. - * @return the ApplicationGroupInner object itself. + * @return the type value. */ - public ApplicationGroupInner withApplicationGroupType(ApplicationGroupType applicationGroupType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupProperties(); - } - this.innerProperties().withApplicationGroupType(applicationGroupType); - return this; + @Override + public String type() { + return this.type; } /** - * Get the cloudPcResource property: Is cloud pc resource. + * Get the name property: The name of the resource. * - * @return the cloudPcResource value. + * @return the name value. */ - public Boolean cloudPcResource() { - return this.innerProperties() == null ? null : this.innerProperties().cloudPcResource(); + @Override + public String name() { + return this.name; } /** - * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the showInFeed value. + * @return the id value. */ - public Boolean showInFeed() { - return this.innerProperties() == null ? null : this.innerProperties().showInFeed(); + @Override + public String id() { + return this.id; } /** - * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * - * @param showInFeed the showInFeed value to set. - * @return the ApplicationGroupInner object itself. + * {@inheritDoc} */ - public ApplicationGroupInner withShowInFeed(Boolean showInFeed) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationGroupProperties(); - } - this.innerProperties().withShowInFeed(showInFeed); + @Override + public ApplicationGroupInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ApplicationGroupInner")); - } else { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } + public ApplicationGroupInner withTags(Map tags) { + super.withTags(tags); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(ApplicationGroupInner.class); - /** * {@inheritDoc} */ @@ -364,12 +295,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("properties", this.properties); + 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 +331,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.properties = 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/ApplicationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java index e8a03b6ecb15..feebc437ba32 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java @@ -1,18 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationProperties; import java.io.IOException; /** @@ -20,12 +18,10 @@ */ @Fluent public final class ApplicationInner extends ProxyResource { - private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - /* * Detailed properties for Application */ - private ApplicationProperties innerProperties = new ApplicationProperties(); + private ApplicationProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public ApplicationInner() { } /** - * Get the innerProperties property: Detailed properties for Application. + * Get the properties property: Detailed properties for Application. * - * @return the innerProperties value. + * @return the properties value. */ - private ApplicationProperties innerProperties() { - return this.innerProperties; + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for Application. + * + * @param properties the properties value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; } /** @@ -101,314 +108,13 @@ public String id() { return this.id; } - /** - * Get the objectId property: ObjectId of Application. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * 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 ApplicationInner object itself. - */ - public ApplicationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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. - * - * @param friendlyName the friendlyName value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withFilePath(String filePath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withFilePath(filePath); - 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 ApplicationInner object itself. - */ - public ApplicationInner withMsixPackageFamilyName(String msixPackageFamilyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withMsixPackageApplicationId(String msixPackageApplicationId) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withApplicationType(RemoteApplicationType applicationType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withApplicationType(applicationType); - 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. - */ - public CommandLineSetting commandLineSetting() { - return this.innerProperties() == null ? null : this.innerProperties().commandLineSetting(); - } - - /** - * 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. - * - * @param commandLineSetting the commandLineSetting value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withCommandLineSetting(CommandLineSetting commandLineSetting) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withCommandLineArguments(String commandLineArguments) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withShowInPortal(Boolean showInPortal) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withIconPath(String iconPath) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - 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 ApplicationInner object itself. - */ - public ApplicationInner withIconIndex(Integer iconIndex) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withIconIndex(iconIndex); - return this; - } - - /** - * Get the iconHash property: Hash of the icon. - * - * @return the iconHash value. - */ - public String iconHash() { - return this.innerProperties() == null ? null : this.innerProperties().iconHash(); - } - - /** - * Get the iconContent property: the icon a 64 bit string as a byte array. - * - * @return the iconContent value. - */ - public byte[] iconContent() { - return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().iconContent(); - } - - /** - * 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 ApplicationInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -435,7 +141,7 @@ public static ApplicationInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedApplicationInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedApplicationInner.innerProperties = ApplicationProperties.fromJson(reader); + deserializedApplicationInner.properties = ApplicationProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedApplicationInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java index 9a0caab916f8..b59a9f35dcf4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java @@ -1,28 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.DesktopProperties; import java.io.IOException; /** * Schema for Desktop properties. */ -@Fluent +@Immutable public final class DesktopInner extends ProxyResource { - private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - /* * Detailed properties for Desktop */ - private DesktopProperties innerProperties; + private DesktopProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -47,16 +46,16 @@ public final class DesktopInner extends ProxyResource { /** * Creates an instance of DesktopInner class. */ - public DesktopInner() { + private DesktopInner() { } /** - * Get the innerProperties property: Detailed properties for Desktop. + * Get the properties property: Detailed properties for Desktop. * - * @return the innerProperties value. + * @return the properties value. */ - private DesktopProperties innerProperties() { - return this.innerProperties; + public DesktopProperties properties() { + return this.properties; } /** @@ -98,97 +97,13 @@ public String id() { return this.id; } - /** - * Get the objectId property: ObjectId of Desktop. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * Get the description property: Description of Desktop. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of Desktop. - * - * @param description the description value to set. - * @return the DesktopInner object itself. - */ - public DesktopInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new DesktopProperties(); - } - 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 DesktopInner object itself. - */ - public DesktopInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new DesktopProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the iconHash property: Hash of the icon. - * - * @return the iconHash value. - */ - public String iconHash() { - return this.innerProperties() == null ? null : this.innerProperties().iconHash(); - } - - /** - * Get the iconContent property: The icon a 64 bit string as a byte array. - * - * @return the iconContent value. - */ - public byte[] iconContent() { - return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().iconContent(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -215,7 +130,7 @@ public static DesktopInner fromJson(JsonReader jsonReader) throws IOException { } else if ("type".equals(fieldName)) { deserializedDesktopInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedDesktopInner.innerProperties = DesktopProperties.fromJson(reader); + deserializedDesktopInner.properties = DesktopProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDesktopInner.systemData = SystemData.fromJson(reader); } else { 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..8352cf948ff4 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 @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.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. */ -@Fluent +@Immutable 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. @@ -49,16 +46,16 @@ public final class ExpandMsixImageInner extends ProxyResource { /** * Creates an instance of ExpandMsixImageInner class. */ - public ExpandMsixImageInner() { + private 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; } /** @@ -100,371 +97,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +130,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..b099faafbdad 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 @@ -1,718 +1,291 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.HostPoolType; -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.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.SsoSecretType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.io.IOException; -import java.util.List; import java.util.Map; /** * 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(); + private HostPoolPropertiesInner properties; /* - * 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; /* - * The type of the resource. + * 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 type; + private String kind; /* - * The name of the 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 name; + private String managedBy; /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of HostPoolInner class. - */ - public HostPoolInner() { - } - - /** - * Get the innerProperties property: Detailed properties for HostPool. - * - * @return the innerProperties value. - */ - private HostPoolPropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - @Override - public SystemData systemData() { - return this.systemData; - } - - /** - * 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. - */ - @Override - public String etag() { - return this.etag; - } - - /** - * 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 HostPoolInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); - return this; - } - - /** - * {@inheritDoc} + * Details of the resource plan. */ - @Override - public HostPoolInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostPoolInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostPoolInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostPoolInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostPoolInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostPoolInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the objectId property: ObjectId of HostPool. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * 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 HostPoolInner object itself. - */ - public HostPoolInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } + private Plan plan; - /** - * 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 HostPoolInner object itself. - */ - public HostPoolInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the hostPoolType property: HostPool type for desktop. - * - * @return the hostPoolType value. - */ - public HostPoolType hostPoolType() { - return this.innerProperties() == null ? null : this.innerProperties().hostPoolType(); - } - - /** - * Set the hostPoolType property: HostPool type for desktop. - * - * @param hostPoolType the hostPoolType value to set. - * @return the HostPoolInner object itself. - */ - public HostPoolInner withHostPoolType(HostPoolType hostPoolType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withHostPoolType(hostPoolType); - 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 HostPoolInner object itself. - */ - public HostPoolInner - withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - 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 HostPoolInner object itself. - */ - public HostPoolInner withCustomRdpProperty(String customRdpProperty) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - 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 HostPoolInner object itself. - */ - public HostPoolInner withMaxSessionLimit(Integer maxSessionLimit) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withMaxSessionLimit(maxSessionLimit); - 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 HostPoolInner object itself. - */ - public HostPoolInner withLoadBalancerType(LoadBalancerType loadBalancerType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withLoadBalancerType(loadBalancerType); - return this; - } - - /** - * Get the ring property: The ring number of HostPool. - * - * @return the ring value. + /* + * The SKU (Stock Keeping Unit) assigned to this resource. */ - public Integer ring() { - return this.innerProperties() == null ? null : this.innerProperties().ring(); - } + private Sku sku; - /** - * Set the ring property: The ring number of HostPool. - * - * @param ring the ring value to set. - * @return the HostPoolInner object itself. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public HostPoolInner withRing(Integer ring) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withRing(ring); - return this; - } + private SystemData systemData; - /** - * Get the validationEnvironment property: Is validation environment. - * - * @return the validationEnvironment value. + /* + * The type of the resource. */ - public Boolean validationEnvironment() { - return this.innerProperties() == null ? null : this.innerProperties().validationEnvironment(); - } + private String type; - /** - * Set the validationEnvironment property: Is validation environment. - * - * @param validationEnvironment the validationEnvironment value to set. - * @return the HostPoolInner object itself. + /* + * The name of the resource. */ - public HostPoolInner withValidationEnvironment(Boolean validationEnvironment) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withValidationEnvironment(validationEnvironment); - return this; - } + private String name; - /** - * Get the registrationInfo property: The registration info of HostPool. - * - * @return the registrationInfo value. + /* + * Fully qualified resource Id for the resource. */ - public RegistrationInfoInner registrationInfo() { - return this.innerProperties() == null ? null : this.innerProperties().registrationInfo(); - } + private String id; /** - * Set the registrationInfo property: The registration info of HostPool. - * - * @param registrationInfo the registrationInfo value to set. - * @return the HostPoolInner object itself. + * Creates an instance of HostPoolInner class. */ - public HostPoolInner withRegistrationInfo(RegistrationInfoInner registrationInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withRegistrationInfo(registrationInfo); - return this; + public HostPoolInner() { } /** - * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. + * Get the properties property: Detailed properties for HostPool. * - * @return the vmTemplate value. + * @return the properties value. */ - public String vmTemplate() { - return this.innerProperties() == null ? null : this.innerProperties().vmTemplate(); + public HostPoolPropertiesInner properties() { + return this.properties; } /** - * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. + * Set the properties property: Detailed properties for HostPool. * - * @param vmTemplate the vmTemplate value to set. + * @param properties the properties value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withVmTemplate(String vmTemplate) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withVmTemplate(vmTemplate); + public HostPoolInner withProperties(HostPoolPropertiesInner properties) { + this.properties = properties; 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(); - } - - /** - * Get the appAttachPackageReferences property: List of App Attach Package links. - * - * @return the appAttachPackageReferences value. - */ - public List appAttachPackageReferences() { - return this.innerProperties() == null ? null : this.innerProperties().appAttachPackageReferences(); - } - - /** - * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the ssoadfsAuthority value. + * @return the identity value. */ - public String ssoadfsAuthority() { - return this.innerProperties() == null ? null : this.innerProperties().ssoadfsAuthority(); + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. + * Set the identity property: The managed service identities assigned to this resource. * - * @param ssoadfsAuthority the ssoadfsAuthority value to set. + * @param identity the identity value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withSsoadfsAuthority(String ssoadfsAuthority) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withSsoadfsAuthority(ssoadfsAuthority); + public HostPoolInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; 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. + * 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. * - * @param ssoClientId the ssoClientId value to set. - * @return the HostPoolInner object itself. + * @return the etag value. */ - public HostPoolInner withSsoClientId(String ssoClientId) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withSsoClientId(ssoClientId); - return this; + public String etag() { + return this.etag; } /** - * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to - * ADFS. + * 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 ssoClientSecretKeyVaultPath value. + * @return the kind value. */ - public String ssoClientSecretKeyVaultPath() { - return this.innerProperties() == null ? null : this.innerProperties().ssoClientSecretKeyVaultPath(); + public String kind() { + return this.kind; } /** - * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to - * ADFS. + * 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 ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. + * @param kind the kind value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); + public HostPoolInner withKind(String kind) { + this.kind = kind; return this; } /** - * Get the ssoSecretType property: The type of single sign on Secret Type. + * 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 ssoSecretType value. + * @return the managedBy value. */ - public SsoSecretType ssoSecretType() { - return this.innerProperties() == null ? null : this.innerProperties().ssoSecretType(); + public String managedBy() { + return this.managedBy; } /** - * Set the ssoSecretType property: The type of single sign on Secret Type. + * 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 ssoSecretType the ssoSecretType value to set. + * @param managedBy the managedBy value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withSsoSecretType(SsoSecretType ssoSecretType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withSsoSecretType(ssoSecretType); + public HostPoolInner withManagedBy(String managedBy) { + this.managedBy = managedBy; return this; } /** - * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop - * Application Group. + * Get the plan property: Details of the resource plan. * - * @return the preferredAppGroupType value. + * @return the plan value. */ - public PreferredAppGroupType preferredAppGroupType() { - return this.innerProperties() == null ? null : this.innerProperties().preferredAppGroupType(); + public Plan plan() { + return this.plan; } /** - * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop - * Application Group. + * Set the plan property: Details of the resource plan. * - * @param preferredAppGroupType the preferredAppGroupType value to set. + * @param plan the plan value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withPreferredAppGroupType(preferredAppGroupType); + public HostPoolInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the startVMOnConnect value. + * @return the sku value. */ - public Boolean startVMOnConnect() { - return this.innerProperties() == null ? null : this.innerProperties().startVMOnConnect(); + public Sku sku() { + return this.sku; } /** - * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @param startVMOnConnect the startVMOnConnect value to set. + * @param sku the sku value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withStartVMOnConnect(Boolean startVMOnConnect) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withStartVMOnConnect(startVMOnConnect); + public HostPoolInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the cloudPcResource property: Is cloud pc resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the cloudPcResource value. + * @return the systemData value. */ - public Boolean cloudPcResource() { - return this.innerProperties() == null ? null : this.innerProperties().cloudPcResource(); + public SystemData systemData() { + return this.systemData; } /** - * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * Get the type property: The type of the resource. * - * @return the publicNetworkAccess value. + * @return the type value. */ - public HostpoolPublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + @Override + public String type() { + return this.type; } /** - * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * Get the name property: The name of the resource. * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the HostPoolInner object itself. + * @return the name value. */ - public HostPoolInner withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; + @Override + public String name() { + return this.name; } /** - * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the agentUpdate value. + * @return the id value. */ - public AgentUpdateProperties agentUpdate() { - return this.innerProperties() == null ? null : this.innerProperties().agentUpdate(); + @Override + public String id() { + return this.id; } /** - * 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 HostPoolInner object itself. + * {@inheritDoc} */ - public HostPoolInner withAgentUpdate(AgentUpdateProperties agentUpdate) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPropertiesInner(); - } - this.innerProperties().withAgentUpdate(agentUpdate); + @Override + public HostPoolInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified - * resource. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model HostPoolInner")); - } else { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } + public HostPoolInner withTags(Map tags) { + super.withTags(tags); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(HostPoolInner.class); - /** * {@inheritDoc} */ @@ -721,12 +294,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("properties", this.properties); + 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 +330,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.properties = 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..b1936039a357 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 @@ -1,22 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.AllowRDPShortPathWithPrivateLink; +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +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 +153,58 @@ 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; + + /* + * DeploymentScope type for HostPool. + */ + private DeploymentScope deploymentScope; + + /* + * Tenant that the resource is being requested on behalf of. + */ + private String oboTenantId; + + /* + * Controls if the use of RDPShortPath transport is allowed, possibly bypassing Private Link routes. + */ + private AllowRDPShortPathWithPrivateLink allowRDPShortPathWithPrivateLink; + /** * Creates an instance of HostPoolPropertiesInner class. */ @@ -589,38 +647,193 @@ public List privateEndpointConnections() { } /** - * Validates the instance. + * 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. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the managedPrivateUDP value. */ - public void validate() { - if (hostPoolType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property hostPoolType in model HostPoolPropertiesInner")); - } - if (loadBalancerType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property loadBalancerType in model HostPoolPropertiesInner")); - } - if (registrationInfo() != null) { - registrationInfo().validate(); - } - if (preferredAppGroupType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property preferredAppGroupType in model HostPoolPropertiesInner")); - } - if (agentUpdate() != null) { - agentUpdate().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } + public ManagedPrivateUDP managedPrivateUDP() { + return this.managedPrivateUDP; } - private static final ClientLogger LOGGER = new ClientLogger(HostPoolPropertiesInner.class); + /** + * 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; + } + + /** + * Get the deploymentScope property: DeploymentScope type for HostPool. + * + * @return the deploymentScope value. + */ + public DeploymentScope deploymentScope() { + return this.deploymentScope; + } + + /** + * Set the deploymentScope property: DeploymentScope type for HostPool. + * + * @param deploymentScope the deploymentScope value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withDeploymentScope(DeploymentScope deploymentScope) { + this.deploymentScope = deploymentScope; + return this; + } + + /** + * Get the oboTenantId property: Tenant that the resource is being requested on behalf of. + * + * @return the oboTenantId value. + */ + public String oboTenantId() { + return this.oboTenantId; + } + + /** + * Set the oboTenantId property: Tenant that the resource is being requested on behalf of. + * + * @param oboTenantId the oboTenantId value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner withOboTenantId(String oboTenantId) { + this.oboTenantId = oboTenantId; + return this; + } + + /** + * Get the allowRDPShortPathWithPrivateLink property: Controls if the use of RDPShortPath transport is allowed, + * possibly bypassing Private Link routes. + * + * @return the allowRDPShortPathWithPrivateLink value. + */ + public AllowRDPShortPathWithPrivateLink allowRDPShortPathWithPrivateLink() { + return this.allowRDPShortPathWithPrivateLink; + } + + /** + * Set the allowRDPShortPathWithPrivateLink property: Controls if the use of RDPShortPath transport is allowed, + * possibly bypassing Private Link routes. + * + * @param allowRDPShortPathWithPrivateLink the allowRDPShortPathWithPrivateLink value to set. + * @return the HostPoolPropertiesInner object itself. + */ + public HostPoolPropertiesInner + withAllowRDPShortPathWithPrivateLink(AllowRDPShortPathWithPrivateLink allowRDPShortPathWithPrivateLink) { + this.allowRDPShortPathWithPrivateLink = allowRDPShortPathWithPrivateLink; + return this; + } /** * {@inheritDoc} @@ -651,6 +864,18 @@ 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()); + jsonWriter.writeStringField("deploymentScope", + this.deploymentScope == null ? null : this.deploymentScope.toString()); + jsonWriter.writeStringField("oboTenantId", this.oboTenantId); + jsonWriter.writeStringField("allowRDPShortPathWithPrivateLink", + this.allowRDPShortPathWithPrivateLink == null ? null : this.allowRDPShortPathWithPrivateLink.toString()); return jsonWriter.writeEndObject(); } @@ -727,6 +952,25 @@ 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 if ("deploymentScope".equals(fieldName)) { + deserializedHostPoolPropertiesInner.deploymentScope + = DeploymentScope.fromString(reader.getString()); + } else if ("oboTenantId".equals(fieldName)) { + deserializedHostPoolPropertiesInner.oboTenantId = reader.getString(); + } else if ("allowRDPShortPathWithPrivateLink".equals(fieldName)) { + deserializedHostPoolPropertiesInner.allowRDPShortPathWithPrivateLink + = AllowRDPShortPathWithPrivateLink.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java index 35af92687897..b2af8de39b13 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java @@ -1,21 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; /** * Schema for MSIX Package properties. @@ -25,7 +21,7 @@ public final class MsixPackageInner extends ProxyResource { /* * Detailed properties for MSIX Package */ - private MsixPackageProperties innerProperties = new MsixPackageProperties(); + private MsixPackageProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public MsixPackageInner() { } /** - * 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 MsixPackageProperties innerProperties() { - return this.innerProperties; + public MsixPackageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for MSIX Package. + * + * @param properties the properties value to set. + * @return the MsixPackageInner object itself. + */ + public MsixPackageInner withProperties(MsixPackageProperties properties) { + this.properties = properties; + return this; } /** @@ -101,285 +108,13 @@ public String id() { return this.id; } - /** - * 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 MsixPackageInner object itself. - */ - public MsixPackageInner withImagePath(String imagePath) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withPackageName(String packageName) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withPackageFamilyName(String packageFamilyName) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - this.innerProperties().withPackageFamilyName(packageFamilyName); - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withPackageRelativePath(String packageRelativePath) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withIsRegularRegistration(Boolean isRegularRegistration) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withIsActive(Boolean isActive) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withPackageDependencies(List packageDependencies) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withLastUpdated(OffsetDateTime lastUpdated) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - 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 MsixPackageInner object itself. - */ - public MsixPackageInner withPackageApplications(List packageApplications) { - if (this.innerProperties() == null) { - this.innerProperties = new MsixPackageProperties(); - } - this.innerProperties().withPackageApplications(packageApplications); - 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 MsixPackageInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MsixPackageInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -406,7 +141,7 @@ public static MsixPackageInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedMsixPackageInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedMsixPackageInner.innerProperties = MsixPackageProperties.fromJson(reader); + deserializedMsixPackageInner.properties = MsixPackageProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedMsixPackageInner.systemData = SystemData.fromJson(reader); } else { 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..dc36be3978c8 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 @@ -1,35 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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 com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProperties; import java.io.IOException; -import java.util.List; /** * 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 properties; /* - * Resource properties. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private PrivateEndpointConnectionProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -53,22 +50,32 @@ public PrivateEndpointConnectionWithSystemDataInner() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the properties property: The resource-specific properties for this resource. * - * @return the systemData value. + * @return the properties value. */ - @Override - public SystemData systemData() { - return this.systemData; + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionWithSystemDataInner object itself. + */ + public PrivateEndpointConnectionWithSystemDataInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; } /** - * 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; } /** @@ -101,92 +108,13 @@ 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 PrivateEndpointConnectionWithSystemDataInner object itself. - */ - public PrivateEndpointConnectionWithSystemDataInner 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 PrivateEndpointConnectionWithSystemDataInner object itself. - */ - public PrivateEndpointConnectionWithSystemDataInner - 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. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -214,7 +142,7 @@ public static PrivateEndpointConnectionWithSystemDataInner fromJson(JsonReader j } else if ("type".equals(fieldName)) { deserializedPrivateEndpointConnectionWithSystemDataInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionWithSystemDataInner.innerProperties + deserializedPrivateEndpointConnectionWithSystemDataInner.properties = PrivateEndpointConnectionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedPrivateEndpointConnectionWithSystemDataInner.systemData = SystemData.fromJson(reader); 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..b566126e8b28 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 @@ -1,27 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.PrivateLinkResourceProperties; import java.io.IOException; -import java.util.List; /** * A private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ - private PrivateLinkResourceProperties innerProperties; + private PrivateLinkResourceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -46,16 +46,16 @@ public final class PrivateLinkResourceInner extends ProxyResource { /** * Creates an instance of PrivateLinkResourceInner class. */ - public PrivateLinkResourceInner() { + private 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; } /** @@ -97,65 +97,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +130,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/RegistrationInfoInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java index 8d63fb5f4950..6130ff6c1235 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; @@ -101,14 +101,6 @@ public RegistrationInfoInner withRegistrationTokenOperation(RegistrationTokenOpe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..71d0b800ac2f 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 @@ -1,29 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; import java.io.IOException; import java.util.List; /** - * RegistrationTokenList - * * List of RegistrationToken definitions. */ -@Fluent +@Immutable public final class RegistrationTokenListInner implements JsonSerializable { /* * List of RegistrationToken definitions. */ - private List value; + private List value; /* * Link to the next page of results. @@ -33,7 +30,7 @@ public final class RegistrationTokenListInner implements JsonSerializable value() { + public List value() { return this.value; } - /** - * Set the value property: List of RegistrationToken definitions. - * - * @param value the value value to set. - * @return the RegistrationTokenListInner object itself. - */ - public RegistrationTokenListInner withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: Link to the next page of results. * @@ -65,17 +51,6 @@ 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} */ @@ -102,8 +77,8 @@ public static RegistrationTokenListInner fromJson(JsonReader jsonReader) throws reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RegistrationTokenMinimal.fromJson(reader1)); + List value + = reader.readArray(reader1 -> RegistrationTokenMinimalInner.fromJson(reader1)); deserializedRegistrationTokenListInner.value = value; } else if ("nextLink".equals(fieldName)) { deserializedRegistrationTokenListInner.nextLink = reader.getString(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenMinimalInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenMinimalInner.java new file mode 100644 index 000000000000..89129981b33a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenMinimalInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a Minimal set of properties for RegistrationToken definition. + */ +@Immutable +public final class RegistrationTokenMinimalInner implements JsonSerializable { + /* + * Expiration time of registration token. + */ + private OffsetDateTime expirationTime; + + /* + * The registration token base64 encoded string. + */ + private String token; + + /** + * Creates an instance of RegistrationTokenMinimalInner class. + */ + private RegistrationTokenMinimalInner() { + } + + /** + * Get the expirationTime property: Expiration time of registration token. + * + * @return the expirationTime value. + */ + public OffsetDateTime expirationTime() { + return this.expirationTime; + } + + /** + * Get the token property: The registration token base64 encoded string. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expirationTime", + this.expirationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTime)); + jsonWriter.writeStringField("token", this.token); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationTokenMinimalInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationTokenMinimalInner 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 RegistrationTokenMinimalInner. + */ + public static RegistrationTokenMinimalInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationTokenMinimalInner deserializedRegistrationTokenMinimalInner + = new RegistrationTokenMinimalInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirationTime".equals(fieldName)) { + deserializedRegistrationTokenMinimalInner.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("token".equals(fieldName)) { + deserializedRegistrationTokenMinimalInner.token = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationTokenMinimalInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java index e2aebc82c232..5cc470bb8cd6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Supported operation of this resource provider. */ -@Fluent +@Immutable public final class ResourceProviderOperationInner implements JsonSerializable { /* * Operation name, in format of {provider}/{resource}/{operation} @@ -41,7 +41,7 @@ public final class ResourceProviderOperationInner implements JsonSerializable tags) { - super.withTags(tags); + public ScalingPlanInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; return this; } /** - * Get the objectId property: ObjectId of scaling plan. (internal use). + * 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 objectId value. + * @return the etag value. */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); + public String etag() { + return this.etag; } /** - * Get the description property: Description of scaling plan. + * 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 description value. + * @return the kind value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public String kind() { + return this.kind; } /** - * Set the description property: Description of scaling plan. + * 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 description the description value to set. + * @param kind the kind value to set. * @return the ScalingPlanInner object itself. */ - public ScalingPlanInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withDescription(description); + public ScalingPlanInner withKind(String kind) { + this.kind = kind; return this; } /** - * Get the friendlyName property: User friendly name of scaling plan. + * 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 friendlyName value. + * @return the managedBy value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + public String managedBy() { + return this.managedBy; } /** - * Set the friendlyName property: User friendly name of scaling plan. + * 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 friendlyName the friendlyName value to set. + * @param managedBy the managedBy value to set. * @return the ScalingPlanInner object itself. */ - public ScalingPlanInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); + public ScalingPlanInner withManagedBy(String managedBy) { + this.managedBy = managedBy; return this; } /** - * Get the timeZone property: Timezone of the scaling plan. + * Get the plan property: Details of the resource plan. * - * @return the timeZone value. + * @return the plan value. */ - public String timeZone() { - return this.innerProperties() == null ? null : this.innerProperties().timeZone(); + public Plan plan() { + return this.plan; } /** - * Set the timeZone property: Timezone of the scaling plan. + * Set the plan property: Details of the resource plan. * - * @param timeZone the timeZone value to set. + * @param plan the plan value to set. * @return the ScalingPlanInner object itself. */ - public ScalingPlanInner withTimeZone(String timeZone) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withTimeZone(timeZone); + public ScalingPlanInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * Get the hostPoolType property: HostPool type for desktop. + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the hostPoolType value. + * @return the sku value. */ - public ScalingHostPoolType hostPoolType() { - return this.innerProperties() == null ? null : this.innerProperties().hostPoolType(); + public Sku sku() { + return this.sku; } /** - * Set the hostPoolType property: HostPool type for desktop. + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @param hostPoolType the hostPoolType value to set. + * @param sku the sku value to set. * @return the ScalingPlanInner object itself. */ - public ScalingPlanInner withHostPoolType(ScalingHostPoolType hostPoolType) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withHostPoolType(hostPoolType); + public ScalingPlanInner withSku(Sku sku) { + this.sku = sku; 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. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param exclusionTag the exclusionTag value to set. - * @return the ScalingPlanInner object itself. + * @return the systemData value. */ - public ScalingPlanInner withExclusionTag(String exclusionTag) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withExclusionTag(exclusionTag); - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the schedules property: List of ScalingPlanPooledSchedule definitions. + * Get the type property: The type of the resource. * - * @return the schedules value. + * @return the type value. */ - public List schedules() { - return this.innerProperties() == null ? null : this.innerProperties().schedules(); + @Override + public String type() { + return this.type; } /** - * Set the schedules property: List of ScalingPlanPooledSchedule definitions. + * Get the name property: The name of the resource. * - * @param schedules the schedules value to set. - * @return the ScalingPlanInner object itself. + * @return the name value. */ - public ScalingPlanInner withSchedules(List schedules) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withSchedules(schedules); - return this; + @Override + public String name() { + return this.name; } /** - * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the hostPoolReferences value. + * @return the id value. */ - public List hostPoolReferences() { - return this.innerProperties() == null ? null : this.innerProperties().hostPoolReferences(); + @Override + public String id() { + return this.id; } /** - * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * - * @param hostPoolReferences the hostPoolReferences value to set. - * @return the ScalingPlanInner object itself. + * {@inheritDoc} */ - public ScalingPlanInner withHostPoolReferences(List hostPoolReferences) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanProperties(); - } - this.innerProperties().withHostPoolReferences(hostPoolReferences); + @Override + public ScalingPlanInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ScalingPlanInner")); - } else { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } + public ScalingPlanInner withTags(Map tags) { + super.withTags(tags); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanInner.class); - /** * {@inheritDoc} */ @@ -397,12 +295,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("properties", this.properties); + 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 +331,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.properties = 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/ScalingPlanPersonalScheduleInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java index b571d059ba0e..ad3bd8473ff9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java @@ -1,23 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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 com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleProperties; import java.io.IOException; -import java.util.List; /** * Represents a ScalingPlanPersonalSchedule definition. @@ -27,7 +21,7 @@ public final class ScalingPlanPersonalScheduleInner extends ProxyResource { /* * Detailed properties for ScalingPlanPersonalSchedule */ - private ScalingPlanPersonalScheduleProperties innerProperties = new ScalingPlanPersonalScheduleProperties(); + private ScalingPlanPersonalScheduleProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -56,12 +50,23 @@ public ScalingPlanPersonalScheduleInner() { } /** - * 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 ScalingPlanPersonalScheduleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for ScalingPlanPersonalSchedule. + * + * @param properties the properties value to set. + * @return the ScalingPlanPersonalScheduleInner object itself. + */ + public ScalingPlanPersonalScheduleInner withProperties(ScalingPlanPersonalScheduleProperties properties) { + this.properties = properties; + return this; } /** @@ -103,668 +108,13 @@ 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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. - * @return the ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner - 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner 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 ScalingPlanPersonalScheduleInner object itself. - */ - public ScalingPlanPersonalScheduleInner withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { - if (this.innerProperties() == null) { - this.innerProperties = new ScalingPlanPersonalScheduleProperties(); - } - this.innerProperties().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); - 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 ScalingPlanPersonalScheduleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPersonalScheduleInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -792,7 +142,7 @@ public static ScalingPlanPersonalScheduleInner fromJson(JsonReader jsonReader) t } else if ("type".equals(fieldName)) { deserializedScalingPlanPersonalScheduleInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScalingPlanPersonalScheduleInner.innerProperties + deserializedScalingPlanPersonalScheduleInner.properties = ScalingPlanPersonalScheduleProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScalingPlanPersonalScheduleInner.systemData = SystemData.fromJson(reader); 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..efb5284b909d 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 @@ -1,22 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import java.io.IOException; -import java.util.List; /** * Represents a ScalingPlanPooledSchedule definition. @@ -26,7 +21,7 @@ public final class ScalingPlanPooledScheduleInner extends ProxyResource { /* * Detailed properties for ScalingPlanPooledSchedule */ - private ScalingPlanPooledScheduleProperties innerProperties = new ScalingPlanPooledScheduleProperties(); + private ScalingPlanPooledScheduleProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,12 +50,23 @@ public ScalingPlanPooledScheduleInner() { } /** - * 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 ScalingPlanPooledScheduleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for ScalingPlanPooledSchedule. + * + * @param properties the properties value to set. + * @return the ScalingPlanPooledScheduleInner object itself. + */ + public ScalingPlanPooledScheduleInner withProperties(ScalingPlanPooledScheduleProperties properties) { + this.properties = properties; + return this; } /** @@ -102,425 +108,13 @@ 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner - 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner - 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner - 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner 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 ScalingPlanPooledScheduleInner object itself. - */ - public ScalingPlanPooledScheduleInner - 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) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model ScalingPlanPooledScheduleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPooledScheduleInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -548,7 +142,7 @@ public static ScalingPlanPooledScheduleInner fromJson(JsonReader jsonReader) thr } else if ("type".equals(fieldName)) { deserializedScalingPlanPooledScheduleInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedScalingPlanPooledScheduleInner.innerProperties + deserializedScalingPlanPooledScheduleInner.properties = ScalingPlanPooledScheduleProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedScalingPlanPooledScheduleInner.systemData = SystemData.fromJson(reader); 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..29dd5b27cfd9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostConfigurationProperties; +import java.io.IOException; + +/** + * Schema for SessionHostConfiguration properties. + */ +@Fluent +public final class SessionHostConfigurationInner extends ProxyResource { + /* + * Detailed properties for SessionHostConfiguration + */ + private SessionHostConfigurationProperties properties; + + /* + * 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 properties property: Detailed properties for SessionHostConfiguration. + * + * @return the properties value. + */ + public SessionHostConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHostConfiguration. + * + * @param properties the properties value to set. + * @return the SessionHostConfigurationInner object itself. + */ + public SessionHostConfigurationInner withProperties(SessionHostConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = 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/SessionHostInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java index 700013657574..710777faff52 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; @@ -10,12 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport; -import com.azure.resourcemanager.desktopvirtualization.models.Status; -import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProperties; import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; /** * Represents a SessionHost definition. @@ -25,7 +21,7 @@ public final class SessionHostInner extends ProxyResource { /* * Detailed properties for SessionHost */ - private SessionHostProperties innerProperties; + private SessionHostProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -54,12 +50,23 @@ public SessionHostInner() { } /** - * 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 SessionHostProperties innerProperties() { - return this.innerProperties; + public SessionHostProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHost. + * + * @param properties the properties value to set. + * @return the SessionHostInner object itself. + */ + public SessionHostInner withProperties(SessionHostProperties properties) { + this.properties = properties; + return this; } /** @@ -101,331 +108,13 @@ public String id() { return this.id; } - /** - * Get the objectId property: ObjectId of SessionHost. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * Get the lastHeartBeat property: Last heart beat from SessionHost. - * - * @return the lastHeartBeat value. - */ - public OffsetDateTime lastHeartBeat() { - return this.innerProperties() == null ? null : this.innerProperties().lastHeartBeat(); - } - - /** - * Set the lastHeartBeat property: Last heart beat from SessionHost. - * - * @param lastHeartBeat the lastHeartBeat value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withLastHeartBeat(OffsetDateTime lastHeartBeat) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withLastHeartBeat(lastHeartBeat); - return this; - } - - /** - * Get the sessions property: Number of sessions on SessionHost. - * - * @return the sessions value. - */ - public Integer sessions() { - return this.innerProperties() == null ? null : this.innerProperties().sessions(); - } - - /** - * Set the sessions property: Number of sessions on SessionHost. - * - * @param sessions the sessions value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withSessions(Integer sessions) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withSessions(sessions); - return this; - } - - /** - * Get the agentVersion property: Version of agent on SessionHost. - * - * @return the agentVersion value. - */ - public String agentVersion() { - return this.innerProperties() == null ? null : this.innerProperties().agentVersion(); - } - - /** - * Set the agentVersion property: Version of agent on SessionHost. - * - * @param agentVersion the agentVersion value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withAgentVersion(String agentVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withAgentVersion(agentVersion); - return this; - } - - /** - * 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 SessionHostInner object itself. - */ - public SessionHostInner withAllowNewSession(Boolean allowNewSession) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withAllowNewSession(allowNewSession); - return this; - } - - /** - * Get the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine. - * - * @return the virtualMachineId value. - */ - public String virtualMachineId() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineId(); - } - - /** - * Get the resourceId property: Resource Id of SessionHost's underlying virtual machine. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.innerProperties() == null ? null : this.innerProperties().resourceId(); - } - - /** - * 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 SessionHostInner object itself. - */ - public SessionHostInner withAssignedUser(String assignedUser) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - 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 SessionHostInner object itself. - */ - public SessionHostInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - - /** - * Get the status property: Status for a SessionHost. - * - * @return the status value. - */ - public Status status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status for a SessionHost. - * - * @param status the status value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withStatus(Status status) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the statusTimestamp property: The timestamp of the status. - * - * @return the statusTimestamp value. - */ - public OffsetDateTime statusTimestamp() { - return this.innerProperties() == null ? null : this.innerProperties().statusTimestamp(); - } - - /** - * Get the osVersion property: The version of the OS on the session host. - * - * @return the osVersion value. - */ - public String osVersion() { - return this.innerProperties() == null ? null : this.innerProperties().osVersion(); - } - - /** - * Set the osVersion property: The version of the OS on the session host. - * - * @param osVersion the osVersion value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withOsVersion(String osVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withOsVersion(osVersion); - return this; - } - - /** - * Get the sxSStackVersion property: The version of the side by side stack on the session host. - * - * @return the sxSStackVersion value. - */ - public String sxSStackVersion() { - return this.innerProperties() == null ? null : this.innerProperties().sxSStackVersion(); - } - - /** - * Set the sxSStackVersion property: The version of the side by side stack on the session host. - * - * @param sxSStackVersion the sxSStackVersion value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withSxSStackVersion(String sxSStackVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withSxSStackVersion(sxSStackVersion); - return this; - } - - /** - * Get the updateState property: Update state of a SessionHost. - * - * @return the updateState value. - */ - 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. - * - * @return the lastUpdateTime value. - */ - public OffsetDateTime lastUpdateTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastUpdateTime(); - } - - /** - * Get the updateErrorMessage property: The error message. - * - * @return the updateErrorMessage value. - */ - public String updateErrorMessage() { - return this.innerProperties() == null ? null : this.innerProperties().updateErrorMessage(); - } - - /** - * Set the updateErrorMessage property: The error message. - * - * @param updateErrorMessage the updateErrorMessage value to set. - * @return the SessionHostInner object itself. - */ - public SessionHostInner withUpdateErrorMessage(String updateErrorMessage) { - if (this.innerProperties() == null) { - this.innerProperties = new SessionHostProperties(); - } - this.innerProperties().withUpdateErrorMessage(updateErrorMessage); - return this; - } - - /** - * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. - * - * @return the sessionHostHealthCheckResults value. - */ - public List sessionHostHealthCheckResults() { - return this.innerProperties() == null ? null : this.innerProperties().sessionHostHealthCheckResults(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -452,7 +141,7 @@ public static SessionHostInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedSessionHostInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedSessionHostInner.innerProperties = SessionHostProperties.fromJson(reader); + deserializedSessionHostInner.properties = SessionHostProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedSessionHostInner.systemData = SystemData.fromJson(reader); } else { 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..1ee051517159 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostManagementProperties; +import java.io.IOException; + +/** + * Schema for SessionHostManagement properties. + */ +@Fluent +public final class SessionHostManagementInner extends ProxyResource { + /* + * Detailed properties for SessionHostManagement + */ + private SessionHostManagementProperties properties; + + /* + * 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 properties property: Detailed properties for SessionHostManagement. + * + * @return the properties value. + */ + public SessionHostManagementProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for SessionHostManagement. + * + * @param properties the properties value to set. + * @return the SessionHostManagementInner object itself. + */ + public SessionHostManagementInner withProperties(SessionHostManagementProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = 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/SessionHostManagementProvisioningStatusInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusInner.java new file mode 100644 index 000000000000..16367530e8b0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusInner.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Schema for SessionHostManagementUpdateStatus properties. + */ +@Immutable +public final class SessionHostManagementProvisioningStatusInner + 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. + */ + private SessionHostManagementProvisioningOperationStatus status; + + /* + * The custom properties of the SessionHost Provisioning Status. + */ + private SessionHostManagementProvisioningStatusPropertiesInner properties; + + /** + * Creates an instance of SessionHostManagementProvisioningStatusInner class. + */ + private SessionHostManagementProvisioningStatusInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public SessionHostManagementProvisioningOperationStatus status() { + return this.status; + } + + /** + * Get the properties property: The custom properties of the SessionHost Provisioning Status. + * + * @return the properties value. + */ + public SessionHostManagementProvisioningStatusPropertiesInner properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + 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 SessionHostManagementProvisioningStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementProvisioningStatusInner 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 SessionHostManagementProvisioningStatusInner. + */ + public static SessionHostManagementProvisioningStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementProvisioningStatusInner deserializedSessionHostManagementProvisioningStatusInner + = new SessionHostManagementProvisioningStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.status + = SessionHostManagementProvisioningOperationStatus.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.percentComplete + = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.error = ManagementError.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusInner.properties + = SessionHostManagementProvisioningStatusPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementProvisioningStatusInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusPropertiesInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusPropertiesInner.java new file mode 100644 index 000000000000..fef84d86492f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusPropertiesInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationProgress; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Properties bag for sessionHostManagement Provisioning Statuses. + */ +@Immutable +public final class SessionHostManagementProvisioningStatusPropertiesInner + implements JsonSerializable { + /* + * The correlation Id for Log Analytics. + */ + private String correlationId; + + /* + * Progress information on the sessionHostManagement operation. + */ + private SessionHostManagementProvisioningOperationProgress 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 SessionHostManagementProvisioningStatusPropertiesInner class. + */ + private SessionHostManagementProvisioningStatusPropertiesInner() { + } + + /** + * Get the correlationId property: The correlation Id for Log Analytics. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + public SessionHostManagementProvisioningOperationProgress progress() { + return this.progress; + } + + /** + * Get the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + public OffsetDateTime scheduledDateTime() { + return this.scheduledDateTime; + } + + /** + * Get the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + public SessionHostManagementInner sessionHostManagement() { + return this.sessionHostManagement; + } + + /** + * {@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 SessionHostManagementProvisioningStatusPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementProvisioningStatusPropertiesInner 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 SessionHostManagementProvisioningStatusPropertiesInner. + */ + public static SessionHostManagementProvisioningStatusPropertiesInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementProvisioningStatusPropertiesInner deserializedSessionHostManagementProvisioningStatusPropertiesInner + = new SessionHostManagementProvisioningStatusPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("correlationId".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusPropertiesInner.correlationId + = reader.getString(); + } else if ("progress".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusPropertiesInner.progress + = SessionHostManagementProvisioningOperationProgress.fromJson(reader); + } else if ("scheduledDateTime".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusPropertiesInner.scheduledDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sessionHostManagement".equals(fieldName)) { + deserializedSessionHostManagementProvisioningStatusPropertiesInner.sessionHostManagement + = SessionHostManagementInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementProvisioningStatusPropertiesInner; + }); + } +} 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..c5d6341b7ed8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Schema for SessionHostManagementUpdateStatus properties. + */ +@Immutable +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 UpdateStatus status; + + /* + * Properties bag for sessionHostManagement Update Statuses. + */ + private SessionHostManagementUpdateStatusPropertiesInner properties; + + /** + * Creates an instance of SessionHostManagementUpdateStatusInner class. + */ + private SessionHostManagementUpdateStatusInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * 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 UpdateStatus status() { + return this.status; + } + + /** + * Get the properties property: Properties bag for sessionHostManagement Update Statuses. + * + * @return the properties value. + */ + public SessionHostManagementUpdateStatusPropertiesInner properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + 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 + = UpdateStatus.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..81ea6d5ec61d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusPropertiesInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import 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. + */ +@Immutable +public final class SessionHostManagementUpdateStatusPropertiesInner + implements JsonSerializable { + /* + * The correlation Id for 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. + */ + private SessionHostManagementUpdateStatusPropertiesInner() { + } + + /** + * Get the correlationId property: The correlation Id for Log Analytics.. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + public SessionHostManagementOperationProgress progress() { + return this.progress; + } + + /** + * Get the scheduledDateTime property: The timestamp that the update is scheduled for. + * + * @return the scheduledDateTime value. + */ + public OffsetDateTime scheduledDateTime() { + return this.scheduledDateTime; + } + + /** + * Get the sessionHostManagement property: SessionHostManagement properties used for the operation. + * + * @return the sessionHostManagement value. + */ + public SessionHostManagementInner sessionHostManagement() { + return this.sessionHostManagement; + } + + /** + * {@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/StartMenuItemInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java index ea4281357070..b0b36c3131bf 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 @@ -1,26 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.StartMenuItemProperties; import java.io.IOException; /** * Represents a StartMenuItem definition. */ -@Fluent +@Immutable 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. @@ -45,16 +46,16 @@ public final class StartMenuItemInner extends ProxyResource { /** * Creates an instance of StartMenuItemInner class. */ - public StartMenuItemInner() { + private 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; } /** @@ -96,139 +97,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +130,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/UserSessionInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java index ddac38af2a37..ec9b4db81964 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java @@ -1,29 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; +import com.azure.resourcemanager.desktopvirtualization.models.UserSessionProperties; import java.io.IOException; -import java.time.OffsetDateTime; /** * Represents a UserSession definition. */ -@Fluent +@Immutable public final class UserSessionInner extends ProxyResource { /* * Detailed properties for UserSession */ - private UserSessionProperties innerProperties; + private UserSessionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -48,16 +46,16 @@ public final class UserSessionInner extends ProxyResource { /** * Creates an instance of UserSessionInner class. */ - public UserSessionInner() { + private UserSessionInner() { } /** - * Get the innerProperties property: Detailed properties for UserSession. + * Get the properties property: Detailed properties for UserSession. * - * @return the innerProperties value. + * @return the properties value. */ - private UserSessionProperties innerProperties() { - return this.innerProperties; + public UserSessionProperties properties() { + return this.properties; } /** @@ -99,148 +97,13 @@ public String id() { return this.id; } - /** - * Get the objectId property: ObjectId of user session. (internal use). - * - * @return the objectId value. - */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); - } - - /** - * Get the userPrincipalName property: The user principal name. - * - * @return the userPrincipalName value. - */ - public String userPrincipalName() { - return this.innerProperties() == null ? null : this.innerProperties().userPrincipalName(); - } - - /** - * Set the userPrincipalName property: The user principal name. - * - * @param userPrincipalName the userPrincipalName value to set. - * @return the UserSessionInner object itself. - */ - public UserSessionInner withUserPrincipalName(String userPrincipalName) { - if (this.innerProperties() == null) { - this.innerProperties = new UserSessionProperties(); - } - this.innerProperties().withUserPrincipalName(userPrincipalName); - return this; - } - - /** - * Get the applicationType property: Application type of application. - * - * @return the applicationType value. - */ - public ApplicationType applicationType() { - return this.innerProperties() == null ? null : this.innerProperties().applicationType(); - } - - /** - * Set the applicationType property: Application type of application. - * - * @param applicationType the applicationType value to set. - * @return the UserSessionInner object itself. - */ - public UserSessionInner withApplicationType(ApplicationType applicationType) { - if (this.innerProperties() == null) { - this.innerProperties = new UserSessionProperties(); - } - this.innerProperties().withApplicationType(applicationType); - return this; - } - - /** - * Get the sessionState property: State of user session. - * - * @return the sessionState value. - */ - public SessionState sessionState() { - return this.innerProperties() == null ? null : this.innerProperties().sessionState(); - } - - /** - * Set the sessionState property: State of user session. - * - * @param sessionState the sessionState value to set. - * @return the UserSessionInner object itself. - */ - public UserSessionInner withSessionState(SessionState sessionState) { - if (this.innerProperties() == null) { - this.innerProperties = new UserSessionProperties(); - } - this.innerProperties().withSessionState(sessionState); - return this; - } - - /** - * Get the activeDirectoryUsername property: The active directory user name. - * - * @return the activeDirectoryUsername value. - */ - public String activeDirectoryUsername() { - return this.innerProperties() == null ? null : this.innerProperties().activeDirectoryUsername(); - } - - /** - * Set the activeDirectoryUsername property: The active directory user name. - * - * @param activeDirectoryUsername the activeDirectoryUsername value to set. - * @return the UserSessionInner object itself. - */ - public UserSessionInner withActiveDirectoryUsername(String activeDirectoryUsername) { - if (this.innerProperties() == null) { - this.innerProperties = new UserSessionProperties(); - } - this.innerProperties().withActiveDirectoryUsername(activeDirectoryUsername); - return this; - } - - /** - * Get the createTime property: The timestamp of the user session create. - * - * @return the createTime value. - */ - public OffsetDateTime createTime() { - return this.innerProperties() == null ? null : this.innerProperties().createTime(); - } - - /** - * Set the createTime property: The timestamp of the user session create. - * - * @param createTime the createTime value to set. - * @return the UserSessionInner object itself. - */ - public UserSessionInner withCreateTime(OffsetDateTime createTime) { - if (this.innerProperties() == null) { - this.innerProperties = new UserSessionProperties(); - } - this.innerProperties().withCreateTime(createTime); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -267,7 +130,7 @@ public static UserSessionInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("type".equals(fieldName)) { deserializedUserSessionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedUserSessionInner.innerProperties = UserSessionProperties.fromJson(reader); + deserializedUserSessionInner.properties = UserSessionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedUserSessionInner.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..daac096226e6 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 @@ -1,47 +1,74 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.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.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties; import java.io.IOException; -import java.util.List; import java.util.Map; /** * Represents a Workspace definition. */ @Fluent -public final class WorkspaceInner extends ResourceModelWithAllowedPropertySet { +public final class WorkspaceInner extends Resource { /* * Detailed properties for Workspace */ - private WorkspaceProperties innerProperties; + private WorkspaceProperties properties; /* - * 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. */ @@ -64,271 +91,200 @@ public WorkspaceInner() { } /** - * 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 WorkspaceProperties innerProperties() { - return this.innerProperties; + public WorkspaceProperties properties() { + return this.properties; } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Set the properties property: Detailed properties for Workspace. * - * @return the systemData value. + * @param properties the properties value to set. + * @return the WorkspaceInner object itself. */ - @Override - public SystemData systemData() { - return this.systemData; + public WorkspaceInner withProperties(WorkspaceProperties properties) { + this.properties = properties; + 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. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the etag value. + * @return the identity value. */ - @Override - public String etag() { - return this.etag; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Get the type property: The type of the resource. + * Set the identity property: The managed service identities assigned to this resource. * - * @return the type value. + * @param identity the identity value to set. + * @return the WorkspaceInner object itself. */ - @Override - public String type() { - return this.type; + public WorkspaceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; } /** - * Get the name property: The name of the resource. + * 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 name value. + * @return the etag value. */ - @Override - public String name() { - return this.name; + public String etag() { + return this.etag; } /** - * Get the id property: Fully qualified resource Id for 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 id value. + * @return the kind value. */ - @Override - public String id() { - return this.id; + public String kind() { + return this.kind; } /** - * {@inheritDoc} - */ - @Override - public WorkspaceInner withManagedBy(String managedBy) { - super.withManagedBy(managedBy); - return this; - } - - /** - * {@inheritDoc} + * 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 WorkspaceInner object itself. */ - @Override public WorkspaceInner withKind(String kind) { - super.withKind(kind); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public WorkspaceInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - super.withIdentity(identity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public WorkspaceInner withSku(ResourceModelWithAllowedPropertySetSku sku) { - super.withSku(sku); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public WorkspaceInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { - super.withPlan(plan); + this.kind = kind; return this; } /** - * {@inheritDoc} - */ - @Override - public WorkspaceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} + * 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. */ - @Override - public WorkspaceInner withTags(Map tags) { - super.withTags(tags); - return this; + public String managedBy() { + return this.managedBy; } /** - * Get the objectId property: ObjectId of Workspace. (internal use). + * 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. * - * @return the objectId value. + * @param managedBy the managedBy value to set. + * @return the WorkspaceInner object itself. */ - public String objectId() { - return this.innerProperties() == null ? null : this.innerProperties().objectId(); + public WorkspaceInner withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; } /** - * Get the description property: Description of Workspace. + * Get the plan property: Details of the resource plan. * - * @return the description value. + * @return the plan value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public Plan plan() { + return this.plan; } /** - * Set the description property: Description of Workspace. + * Set the plan property: Details of the resource plan. * - * @param description the description value to set. + * @param plan the plan value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceProperties(); - } - this.innerProperties().withDescription(description); + public WorkspaceInner withPlan(Plan plan) { + this.plan = plan; return this; } /** - * Get the friendlyName property: Friendly name of Workspace. + * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the friendlyName value. + * @return the sku value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + public Sku sku() { + return this.sku; } /** - * Set the friendlyName property: Friendly name of Workspace. + * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @param friendlyName the friendlyName value to set. + * @param sku the sku value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); + public WorkspaceInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the applicationGroupReferences property: List of applicationGroup resource Ids. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the applicationGroupReferences value. + * @return the systemData value. */ - public List applicationGroupReferences() { - return this.innerProperties() == null ? null : this.innerProperties().applicationGroupReferences(); + public SystemData systemData() { + return this.systemData; } /** - * Set the applicationGroupReferences property: List of applicationGroup resource Ids. + * Get the type property: The type of the resource. * - * @param applicationGroupReferences the applicationGroupReferences value to set. - * @return the WorkspaceInner object itself. + * @return the type value. */ - public WorkspaceInner withApplicationGroupReferences(List applicationGroupReferences) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceProperties(); - } - this.innerProperties().withApplicationGroupReferences(applicationGroupReferences); - return this; + @Override + public String type() { + return this.type; } /** - * Get the cloudPcResource property: Is cloud pc resource. + * Get the name property: The name of the resource. * - * @return the cloudPcResource value. + * @return the name value. */ - public Boolean cloudPcResource() { - return this.innerProperties() == null ? null : this.innerProperties().cloudPcResource(); + @Override + public String name() { + return this.name; } /** - * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the publicNetworkAccess value. + * @return the id value. */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + @Override + public String id() { + return this.id; } /** - * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspaceInner object itself. + * {@inheritDoc} */ - public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceProperties(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + @Override + public WorkspaceInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified - * resource. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (plan() != null) { - plan().validate(); - } + public WorkspaceInner withTags(Map tags) { + super.withTags(tags); + return this; } /** @@ -339,12 +295,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("properties", this.properties); + 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 +331,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.properties = 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..bb9aa55c3428 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for DesktopVirtualizationApiClient. - * null. + * Package containing the inner data models for DesktopVirtualization. + * 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..7836d4a308f7 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for DesktopVirtualizationApiClient. - * null. + * Package containing the service clients for DesktopVirtualization. + * 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..2b4ead0d8ad0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.ActiveSessionHostConfigurationProperties; + +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 ActiveSessionHostConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..2ed0c456e6c0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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 DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of ActiveSessionHostConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ActiveSessionHostConfigurationsClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(ActiveSessionHostConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientActiveSessionHostConfigurations + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientActiveSessionHostConfigurations") + public interface ActiveSessionHostConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") 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) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 ManagementException 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + final String accept = "application/json"; + return service.getSync(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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveSessionHostConfigurationInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName, Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Context context) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ActiveSessionHostConfiguration definitions along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByHostPoolNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ActiveSessionHostConfiguration definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/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..2980f7fd9ecb --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfiguration; +import com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfigurations; + +public final class ActiveSessionHostConfigurationsImpl implements ActiveSessionHostConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(ActiveSessionHostConfigurationsImpl.class); + + private final ActiveSessionHostConfigurationsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public ActiveSessionHostConfigurationsImpl(ActiveSessionHostConfigurationsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActiveSessionHostConfigurationImpl(inner.getValue(), this.manager())); + } + + public ActiveSessionHostConfiguration get(String resourceGroupName, String hostPoolName) { + ActiveSessionHostConfigurationInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new ActiveSessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ActiveSessionHostConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ActiveSessionHostConfigurationImpl(inner1, this.manager())); + } + + private ActiveSessionHostConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java index 1cc118040ec9..573b6ec29d8b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -169,12 +169,21 @@ public AppAttachPackageImpl withProperties(AppAttachPackageProperties properties } public AppAttachPackageImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateAppAttachPackagePatch.withTags(tags); + return this; + } } public AppAttachPackageImpl withProperties(AppAttachPackagePatchProperties properties) { this.updateAppAttachPackagePatch.withProperties(properties); return this; } + + private boolean isInCreateMode() { + return this.innerModel() == null || 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..3ddee2f56d65 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -29,7 +29,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.AppAttachPackageList; import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; import reactor.core.publisher.Mono; @@ -45,42 +45,60 @@ public final class AppAttachPackageInfoesClientImpl implements AppAttachPackageI /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of AppAttachPackageInfoesClientImpl. * * @param client the instance of the service client containing this operation class. */ - AppAttachPackageInfoesClientImpl(DesktopVirtualizationApiClientImpl client) { + AppAttachPackageInfoesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(AppAttachPackageInfoesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientAppAttachPackageInfoes to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientAppAttachPackageInfoes to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientAppAttachPackageInfoes") public interface AppAttachPackageInfoesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/importAppAttachPackageInfo") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> importMethod(@HostParam("$host") String endpoint, + Mono> importMethod(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") ImportPackageInfoRequest importPackageInfoRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ImportPackageInfoRequest importPackageInfoRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/importAppAttachPackageInfo") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response importMethodSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ImportPackageInfoRequest importPackageInfoRequest, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> importMethodNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response importMethodNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -89,7 +107,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 Information to import 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. @@ -99,31 +117,10 @@ Mono> importMethodNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importMethodSinglePageAsync(String resourceGroupName, String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest) { - 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 (importPackageInfoRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter importPackageInfoRequest is required and cannot be null.")); - } else { - importPackageInfoRequest.validate(); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.importMethod(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, importPackageInfoRequest, accept, + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, importPackageInfoRequest, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -135,45 +132,18 @@ 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 context The context to associate with this operation. + * @param importPackageInfoRequest Information to import 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 information from a package given the path to the package along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return information from a package given the path to the package as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importMethodSinglePageAsync(String resourceGroupName, - String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest, 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 (importPackageInfoRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter importPackageInfoRequest is required and cannot be null.")); - } else { - importPackageInfoRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .importMethod(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, importPackageInfoRequest, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest) { + return new PagedFlux<>( + () -> importMethodSinglePageAsync(resourceGroupName, hostPoolName, importPackageInfoRequest), + nextLink -> importMethodNextSinglePageAsync(nextLink)); } /** @@ -181,18 +151,21 @@ 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 Information to import 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 information from a package given the path to the package as paginated response with {@link PagedFlux}. + * @return information from a package given the path to the package along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse importMethodSinglePage(String resourceGroupName, String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest) { - return new PagedFlux<>( - () -> importMethodSinglePageAsync(resourceGroupName, hostPoolName, importPackageInfoRequest), - nextLink -> importMethodNextSinglePageAsync(nextLink)); + final String accept = "application/json"; + Response res = service.importMethodSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, + importPackageInfoRequest, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -200,19 +173,22 @@ 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 Information to import app attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from a package given the path to the package as paginated response with {@link PagedFlux}. + * @return information from a package given the path to the package along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse importMethodSinglePage(String resourceGroupName, String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest, Context context) { - return new PagedFlux<>( - () -> importMethodSinglePageAsync(resourceGroupName, hostPoolName, importPackageInfoRequest, context), - nextLink -> importMethodNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.importMethodSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, + importPackageInfoRequest, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -220,7 +196,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 Information to import 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. @@ -230,7 +206,9 @@ private PagedFlux importMethodAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable importMethod(String resourceGroupName, String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest) { - return new PagedIterable<>(importMethodAsync(resourceGroupName, hostPoolName, importPackageInfoRequest)); + return new PagedIterable<>( + () -> importMethodSinglePage(resourceGroupName, hostPoolName, importPackageInfoRequest), + nextLink -> importMethodNextSinglePage(nextLink)); } /** @@ -238,7 +216,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 Information to import app attach package. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,7 +228,8 @@ public PagedIterable importMethod(String resourceGroupNam public PagedIterable importMethod(String resourceGroupName, String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest, Context context) { return new PagedIterable<>( - importMethodAsync(resourceGroupName, hostPoolName, importPackageInfoRequest, context)); + () -> importMethodSinglePage(resourceGroupName, hostPoolName, importPackageInfoRequest, context), + nextLink -> importMethodNextSinglePage(nextLink, context)); } /** @@ -260,17 +239,11 @@ 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 information from a package given the path to the package along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importMethodNextSinglePageAsync(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.importMethodNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -279,6 +252,24 @@ private Mono> importMethodNextSinglePageAsy .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse importMethodNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.importMethodNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -287,22 +278,14 @@ 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 information from a package given the path to the package along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importMethodNextSinglePageAsync(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.")); - } + private PagedResponse importMethodNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.importMethodNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.importMethodNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java index 69b5dc6355d2..8d0a0c99f9a7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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..b750dd06a917 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; -import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.AppAttachPackageList; import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch; import reactor.core.publisher.Mono; @@ -47,73 +47,120 @@ public final class AppAttachPackagesClientImpl implements AppAttachPackagesClien /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of AppAttachPackagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - AppAttachPackagesClientImpl(DesktopVirtualizationApiClientImpl client) { + AppAttachPackagesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(AppAttachPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientAppAttachPackages to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientAppAttachPackages to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientAppAttachPackages") public interface AppAttachPackagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appAttachPackageName") String appAttachPackageName, - @BodyParam("application/json") AppAttachPackageInner appAttachPackage, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppAttachPackageInner appAttachPackage, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppAttachPackageInner appAttachPackage, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppAttachPackagePatch appAttachPackagePatch, Context context); @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppAttachPackagePatch appAttachPackagePatch, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @QueryParam("force") Boolean force, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, + @PathParam("appAttachPackageName") String appAttachPackageName, @QueryParam("force") Boolean force, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appAttachPackageName") String appAttachPackageName, - @BodyParam("application/json") AppAttachPackagePatch appAttachPackagePatch, + @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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") 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); @@ -122,7 +169,15 @@ Mono> listByResourceGroup(@HostParam("$host") Str @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.DesktopVirtualization/appAttachPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @@ -131,7 +186,15 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -139,7 +202,15 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -156,22 +227,6 @@ Mono> listBySubscriptionNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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(), @@ -179,42 +234,6 @@ public Mono> getByResourceGroupWithResponseAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Get an app attach package. * @@ -245,7 +264,9 @@ public Mono getByResourceGroupAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context); } /** @@ -278,81 +299,15 @@ public AppAttachPackageInner getByResourceGroup(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (appAttachPackageName == null) { - 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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, contentType, accept, + appAttachPackage, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 schema for App Attach Package properties 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) { - 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 (appAttachPackageName == null) { - 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); - } - /** * Create or update an App Attach package. * @@ -386,8 +341,11 @@ public Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, contentType, accept, + appAttachPackage, context); } /** @@ -409,254 +367,151 @@ public AppAttachPackageInner createOrUpdate(String resourceGroupName, String app } /** - * Remove an App Attach Package. + * 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 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}. + * @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) { - 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 (appAttachPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackagePatch appAttachPackagePatch) { 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, appAttachPackagePatch, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, - 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 (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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, appAttachPackageName, accept, context); - } - - /** - * Remove an App Attach Package. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 updateAsync(String resourceGroupName, String appAttachPackageName) { + final AppAttachPackagePatch appAttachPackagePatch = null; + return updateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackagePatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an App Attach Package. + * 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 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}. + * @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 updateWithResponse(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, appAttachPackagePatch, + context); } /** - * Remove an App Attach Package. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 update(String resourceGroupName, String appAttachPackageName) { + final AppAttachPackagePatch appAttachPackagePatch = null; + return updateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackagePatch, Context.NONE) + .getValue(); } /** - * Update an App Attach Package. + * 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 appAttachPackagePatch Object containing App Attach Package definition. + * @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 schema for App Attach Package properties 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> updateWithResponseAsync(String resourceGroupName, - String appAttachPackageName, AppAttachPackagePatch appAttachPackagePatch) { - 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 (appAttachPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); - } - if (appAttachPackagePatch != null) { - appAttachPackagePatch.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, + Boolean force) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackagePatch, accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, force, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String appAttachPackageName, AppAttachPackagePatch appAttachPackagePatch, 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 (appAttachPackageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); - } - if (appAttachPackagePatch != null) { - appAttachPackagePatch.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, appAttachPackageName, appAttachPackagePatch, accept, context); - } - - /** - * Update an App Attach Package. + * 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 schema for App Attach Package properties on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String appAttachPackageName) { - final AppAttachPackagePatch appAttachPackagePatch = null; - return updateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackagePatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String appAttachPackageName) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, force).flatMap(ignored -> Mono.empty()); } /** - * Update an App Attach Package. + * 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 appAttachPackagePatch Object containing App Attach Package definition. + * @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 schema for App Attach Package properties along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String appAttachPackageName, - AppAttachPackagePatch appAttachPackagePatch, Context context) { - return updateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackagePatch, context).block(); + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, force, context); } /** - * Update an App Attach Package. + * 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 schema for App Attach Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName) { - final AppAttachPackagePatch appAttachPackagePatch = null; - return updateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackagePatch, Context.NONE) - .getValue(); + public void delete(String resourceGroupName, String appAttachPackageName) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, appAttachPackageName, force, Context.NONE); } /** @@ -667,23 +522,12 @@ public AppAttachPackageInner update(String resourceGroupName, String appAttachPa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -698,48 +542,29 @@ private Mono> listByResourceGroupSinglePage * * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -748,16 +573,21 @@ public PagedFlux listByResourceGroupAsync(String resource * List App Attach packages in resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of App Attach Package definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String filter) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -769,13 +599,16 @@ public PagedFlux listByResourceGroupAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of App Attach Package definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -785,12 +618,13 @@ private PagedFlux listByResourceGroupAsync(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 appAttachPackageList as paginated response with {@link PagedIterable}. + * @return list of App Attach Package definitions 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 new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -802,12 +636,13 @@ public PagedIterable listByResourceGroup(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -818,18 +653,11 @@ public PagedIterable listByResourceGroup(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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(), @@ -844,43 +672,27 @@ private Mono> listSinglePageAsync(String fi * * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter) { + 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of App Attach Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { + public PagedFlux listAsync() { + final String filter = null; return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -888,15 +700,20 @@ public PagedFlux listAsync(String filter) { /** * 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}. + * @return list of App Attach Package definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -908,12 +725,15 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of App Attach Package definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -921,12 +741,13 @@ private PagedFlux listAsync(String filter, Context contex * * @throws 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 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)); + return new PagedIterable<>(() -> listSinglePage(filter), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** @@ -938,11 +759,12 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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)); + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -952,17 +774,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) { - 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( @@ -972,6 +788,24 @@ private Mono> listByResourceGroupNextSingle .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -980,23 +814,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1006,17 +832,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) { - 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( @@ -1026,6 +846,24 @@ private Mono> listBySubscriptionNextSingleP .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Attach Package definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1034,22 +872,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } 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..c15cfe5dd3fd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getByResourceGroupWithResponse(String resource String appAttachPackageName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AppAttachPackageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppAttachPackageImpl(inner.getValue(), this.manager())); } public AppAttachPackage getByResourceGroup(String resourceGroupName, String appAttachPackageName) { @@ -48,12 +44,12 @@ public AppAttachPackage getByResourceGroup(String resourceGroupName, String appA } } - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, appAttachPackageName, context); + return this.serviceClient().deleteWithResponse(resourceGroupName, appAttachPackageName, force, context); } - public void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName) { + public void delete(String resourceGroupName, String appAttachPackageName) { this.serviceClient().delete(resourceGroupName, appAttachPackageName); } @@ -118,10 +114,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 +129,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..d3d5dfcad861 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -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.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.ApplicationGroupPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupProperties; +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,64 +49,36 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); + public ApplicationGroupProperties properties() { + return this.innerModel().properties(); } - 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public String hostPoolArmPath() { - return this.innerModel().hostPoolArmPath(); - } - - public String workspaceArmPath() { - return this.innerModel().workspaceArmPath(); - } - - public ApplicationGroupType applicationGroupType() { - return this.innerModel().applicationGroupType(); - } - - public Boolean cloudPcResource() { - return this.innerModel().cloudPcResource(); + public Sku sku() { + return this.innerModel().sku(); } - public Boolean showInFeed() { - return this.innerModel().showInFeed(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -217,13 +190,8 @@ public ApplicationGroupImpl withRegion(String location) { return this; } - public ApplicationGroupImpl withHostPoolArmPath(String hostPoolArmPath) { - this.innerModel().withHostPoolArmPath(hostPoolArmPath); - return this; - } - - public ApplicationGroupImpl withApplicationGroupType(ApplicationGroupType applicationGroupType) { - this.innerModel().withApplicationGroupType(applicationGroupType); + public ApplicationGroupImpl withProperties(ApplicationGroupProperties properties) { + this.innerModel().withProperties(properties); return this; } @@ -237,8 +205,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,52 +215,27 @@ public ApplicationGroupImpl withKind(String kind) { return this; } - public ApplicationGroupImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public ApplicationGroupImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public ApplicationGroupImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public ApplicationGroupImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ApplicationGroupImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } - public ApplicationGroupImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateApplicationGroup.withDescription(description); - return this; - } - } - - public ApplicationGroupImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateApplicationGroup.withFriendlyName(friendlyName); - return this; - } + public ApplicationGroupImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; } - public ApplicationGroupImpl withShowInFeed(Boolean showInFeed) { - if (isInCreateMode()) { - this.innerModel().withShowInFeed(showInFeed); - return this; - } else { - this.updateApplicationGroup.withShowInFeed(showInFeed); - return this; - } + public ApplicationGroupImpl withProperties(ApplicationGroupPatchProperties properties) { + this.updateApplicationGroup.withProperties(properties); + return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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..e1acca8d8cba 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ApplicationGroupList; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; import reactor.core.publisher.Mono; @@ -47,73 +47,119 @@ public final class ApplicationGroupsClientImpl implements ApplicationGroupsClien /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of ApplicationGroupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ApplicationGroupsClientImpl(DesktopVirtualizationApiClientImpl client) { + ApplicationGroupsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(ApplicationGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientApplicationGroups to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientApplicationGroups to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientApplicationGroups") public interface ApplicationGroupsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @BodyParam("application/json") ApplicationGroupInner applicationGroup, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationGroupInner applicationGroup, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationGroupInner applicationGroup, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({ 200, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") 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); + @BodyParam("application/json") ApplicationGroupPatch applicationGroup, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @BodyParam("application/json") ApplicationGroupPatch applicationGroup, @HeaderParam("Accept") String accept, - Context context); + @PathParam("applicationGroupName") String applicationGroupName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationGroupPatch applicationGroup, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, 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, + Mono> listByResourceGroup(@HostParam("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") 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, @@ -123,7 +169,15 @@ Mono> listByResourceGroup(@HostParam("$host") Str @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.DesktopVirtualization/applicationGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @@ -132,7 +186,15 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -140,7 +202,15 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -157,22 +227,6 @@ Mono> listBySubscriptionNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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(), @@ -180,42 +234,6 @@ public Mono> getByResourceGroupWithResponseAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Get an application group. * @@ -246,7 +264,9 @@ public Mono getByResourceGroupAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context); } /** @@ -279,81 +299,15 @@ public ApplicationGroupInner getByResourceGroup(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, - context)) + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, contentType, accept, + applicationGroup, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Create or update an applicationGroup. * @@ -387,8 +341,11 @@ public Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, contentType, accept, + applicationGroup, context); } /** @@ -410,253 +367,144 @@ public ApplicationGroupInner createOrUpdate(String resourceGroupName, String app } /** - * Remove an applicationGroup. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (applicationGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupPatch applicationGroup) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, applicationGroup, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, - 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 (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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, accept, context); - } - - /** - * Remove an applicationGroup. + * 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 A {@link Mono} that completes when a successful response is received. + * @return represents a ApplicationGroup definition 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 updateAsync(String resourceGroupName, String applicationGroupName) { + final ApplicationGroupPatch applicationGroup = null; + return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an applicationGroup. + * 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 ManagementException thrown if 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 ApplicationGroup definition 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 updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, applicationGroup, + context); } /** - * Remove an applicationGroup. + * 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 represents a ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String applicationGroupName) { - deleteWithResponse(resourceGroupName, applicationGroupName, Context.NONE); + public ApplicationGroupInner update(String resourceGroupName, String applicationGroupName) { + final ApplicationGroupPatch applicationGroup = null; + return updateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE).getValue(); } /** - * Update an applicationGroup. + * 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 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 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> 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.")); - } - 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 (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"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, applicationGroup, accept, context); - } - - /** - * Update an applicationGroup. + * 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 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 A {@link Mono} that completes when a successful response is received. */ @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())); + public Mono deleteAsync(String resourceGroupName, String applicationGroupName) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName).flatMap(ignored -> Mono.empty()); } /** - * Update an applicationGroup. + * 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 applicationGroup Object containing ApplicationGroup 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 ApplicationGroup definition along with {@link Response}. + * @return the {@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 deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, context); } /** - * Update an applicationGroup. + * 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 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 void delete(String resourceGroupName, String applicationGroupName) { + deleteWithResponse(resourceGroupName, applicationGroupName, Context.NONE); } /** @@ -670,23 +518,12 @@ public ApplicationGroupInner update(String resourceGroupName, String application * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -697,45 +534,6 @@ private Mono> listByResourceGroupSinglePage .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 applicationGroupList along with {@link PagedResponse} 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String 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. * @@ -747,7 +545,7 @@ private Mono> listByResourceGroupSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, @@ -764,7 +562,7 @@ public PagedFlux listByResourceGroupAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -777,6 +575,30 @@ public PagedFlux listByResourceGroupAsync(String resource 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, + isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List applicationGroups. * @@ -789,13 +611,17 @@ public PagedFlux listByResourceGroupAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ApplicationGroup definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(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)); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, + isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -805,7 +631,7 @@ private PagedFlux listByResourceGroupAsync(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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -814,7 +640,8 @@ public PagedIterable listByResourceGroup(String resourceG final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip)); + () -> listByResourceGroupSinglePage(resourceGroupName, filter, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -829,13 +656,13 @@ public PagedIterable listByResourceGroup(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -845,18 +672,11 @@ public PagedIterable listByResourceGroup(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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(), @@ -870,42 +690,27 @@ private Mono> listSinglePageAsync(String fi * 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 applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List applicationGroups in subscription. * - * @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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter) { + public PagedFlux listAsync() { + final String filter = null; return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -913,15 +718,19 @@ public PagedFlux listAsync(String filter) { /** * List applicationGroups in subscription. * + * @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 applicationGroupList as paginated response with {@link PagedFlux}. + * @return list of ApplicationGroup definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -932,12 +741,15 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ApplicationGroup definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -945,12 +757,13 @@ private PagedFlux listAsync(String filter, Context contex * * @throws 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 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)); + return new PagedIterable<>(() -> listSinglePage(filter), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** @@ -961,11 +774,12 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -975,17 +789,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) { - 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( @@ -995,6 +803,24 @@ private Mono> listByResourceGroupNextSingle .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1003,23 +829,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1029,17 +847,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) { - 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( @@ -1049,6 +861,24 @@ private Mono> listBySubscriptionNextSingleP .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ApplicationGroup definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1057,22 +887,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } 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..b3ee4f247f8c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getByResourceGroupWithResponse(String resource String applicationGroupName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationGroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationGroupImpl(inner.getValue(), this.manager())); } public ApplicationGroup getByResourceGroup(String resourceGroupName, String applicationGroupName) { 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..ac26086e19e6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -9,9 +9,8 @@ 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.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.util.Map; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationProperties; public final class ApplicationImpl implements Application, Application.Definition, Application.Update { private ApplicationInner innerObject; @@ -30,64 +29,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public String filePath() { - return this.innerModel().filePath(); - } - - public String msixPackageFamilyName() { - return this.innerModel().msixPackageFamilyName(); - } - - public String msixPackageApplicationId() { - return this.innerModel().msixPackageApplicationId(); + public ApplicationProperties properties() { + return this.innerModel().properties(); } - public RemoteApplicationType applicationType() { - return this.innerModel().applicationType(); - } - - public CommandLineSetting commandLineSetting() { - return this.innerModel().commandLineSetting(); - } - - public String commandLineArguments() { - return this.innerModel().commandLineArguments(); - } - - public Boolean showInPortal() { - return this.innerModel().showInPortal(); - } - - public String iconPath() { - return this.innerModel().iconPath(); - } - - public Integer iconIndex() { - return this.innerModel().iconIndex(); - } - - public String iconHash() { - return this.innerModel().iconHash(); - } - - public byte[] iconContent() { - return this.innerModel().iconContent(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -188,122 +135,13 @@ public Application refresh(Context context) { return this; } - public ApplicationImpl withCommandLineSetting(CommandLineSetting commandLineSetting) { - if (isInCreateMode()) { - this.innerModel().withCommandLineSetting(commandLineSetting); - return this; - } else { - this.updateApplication.withCommandLineSetting(commandLineSetting); - return this; - } - } - - public ApplicationImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateApplication.withDescription(description); - return this; - } - } - - public ApplicationImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateApplication.withFriendlyName(friendlyName); - return this; - } - } - - public ApplicationImpl withFilePath(String filePath) { - if (isInCreateMode()) { - this.innerModel().withFilePath(filePath); - return this; - } else { - this.updateApplication.withFilePath(filePath); - return this; - } - } - - public ApplicationImpl withMsixPackageFamilyName(String msixPackageFamilyName) { - if (isInCreateMode()) { - this.innerModel().withMsixPackageFamilyName(msixPackageFamilyName); - return this; - } else { - this.updateApplication.withMsixPackageFamilyName(msixPackageFamilyName); - return this; - } - } - - public ApplicationImpl withMsixPackageApplicationId(String msixPackageApplicationId) { - if (isInCreateMode()) { - this.innerModel().withMsixPackageApplicationId(msixPackageApplicationId); - return this; - } else { - this.updateApplication.withMsixPackageApplicationId(msixPackageApplicationId); - return this; - } - } - - public ApplicationImpl withApplicationType(RemoteApplicationType applicationType) { - if (isInCreateMode()) { - this.innerModel().withApplicationType(applicationType); - return this; - } else { - this.updateApplication.withApplicationType(applicationType); - return this; - } - } - - public ApplicationImpl withCommandLineArguments(String commandLineArguments) { - if (isInCreateMode()) { - this.innerModel().withCommandLineArguments(commandLineArguments); - return this; - } else { - this.updateApplication.withCommandLineArguments(commandLineArguments); - return this; - } - } - - public ApplicationImpl withShowInPortal(Boolean showInPortal) { - if (isInCreateMode()) { - this.innerModel().withShowInPortal(showInPortal); - return this; - } else { - this.updateApplication.withShowInPortal(showInPortal); - return this; - } - } - - public ApplicationImpl withIconPath(String iconPath) { - if (isInCreateMode()) { - this.innerModel().withIconPath(iconPath); - return this; - } else { - this.updateApplication.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); + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.innerModel().withProperties(properties); 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..5b966656e2de 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ApplicationList; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch; import reactor.core.publisher.Mono; @@ -47,31 +47,31 @@ public final class ApplicationsClientImpl implements ApplicationsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of ApplicationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ApplicationsClientImpl(DesktopVirtualizationApiClientImpl client) { + ApplicationsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientApplications to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientApplications to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientApplications") public interface ApplicationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @@ -79,45 +79,96 @@ Mono> get(@HostParam("$host") String endpoint, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationInner application, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("applicationName") String applicationName, - @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, + @PathParam("applicationName") String applicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationInner application, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({ 200, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") 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); + @BodyParam("application/json") ApplicationPatch application, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("applicationName") String applicationName, - @BodyParam("application/json") ApplicationPatch application, @HeaderParam("Accept") String accept, - Context context); + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationPatch application, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("applicationName") String applicationName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("applicationName") String applicationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, @@ -129,7 +180,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -146,73 +204,12 @@ Mono> listNext(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (applicationGroupName == null) { - 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)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (applicationGroupName == null) { - 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); - } - /** * Get an application. * @@ -246,7 +243,9 @@ public Mono getAsync(String resourceGroupName, String applicat @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, Context context) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, accept, context); } /** @@ -280,87 +279,15 @@ public ApplicationInner get(String resourceGroupName, String applicationGroupNam @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (applicationGroupName == null) { - 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.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, contentType, + accept, application, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 schema for Application properties 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) { - 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 (applicationGroupName == null) { - 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.")); - } - 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); - } - /** * Create or update an application. * @@ -396,8 +323,11 @@ public Mono createOrUpdateAsync(String resourceGroupName, Stri @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, contentType, + accept, application, context); } /** @@ -420,88 +350,30 @@ public ApplicationInner createOrUpdate(String resourceGroupName, String applicat } /** - * Remove an application. + * 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 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}. + * @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) { - 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 (applicationGroupName == null) { - 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.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationPatch application) { 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, + application, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String 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.")); - } - 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 (applicationGroupName == null) { - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, applicationName, accept, context); - } - - /** - * Remove an application. + * Update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -509,34 +381,40 @@ 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 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 updateAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { + final ApplicationPatch application = null; + return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an application. + * 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 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}. + * @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 updateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, + application, context); } /** - * Remove an application. + * Update an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -544,105 +422,37 @@ public Response deleteWithResponse(String resourceGroupName, String applic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 update(String resourceGroupName, String applicationGroupName, String applicationName) { + final ApplicationPatch application = null; + return updateWithResponse(resourceGroupName, applicationGroupName, applicationName, application, Context.NONE) + .getValue(); } /** - * Update an application. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, - String applicationGroupName, String applicationName, ApplicationPatch application) { - 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 (applicationGroupName == null) { - 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.")); - } - if (application != null) { - application.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, - accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 schema for Application properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String applicationGroupName, String applicationName, ApplicationPatch application, 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 (applicationGroupName == null) { - 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.")); - } - if (application != null) { - application.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, applicationName, application, accept, context); - } - - /** - * Update an application. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -650,38 +460,35 @@ private Mono> updateWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String applicationGroupName, - String applicationName) { - final ApplicationPatch application = null; - return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) + .flatMap(ignored -> Mono.empty()); } /** - * Update an application. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String applicationGroupName, - String applicationName, ApplicationPatch application, Context context) { - return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application, context) - .block(); + public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, context); } /** - * Update an application. + * Remove an application. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. @@ -689,13 +496,10 @@ public Response updateWithResponse(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 schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName) { - final ApplicationPatch application = null; - return updateWithResponse(resourceGroupName, applicationGroupName, applicationName, application, Context.NONE) - .getValue(); + public void delete(String resourceGroupName, String applicationGroupName, String applicationName) { + deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE); } /** @@ -709,27 +513,12 @@ public ApplicationInner update(String resourceGroupName, String applicationGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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 (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(), @@ -748,38 +537,17 @@ private Mono> listSinglePageAsync(String resourc * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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(), - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @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)); } /** @@ -787,17 +555,16 @@ private Mono> listSinglePageAsync(String resourc * * @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}. + * @return list of Application definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)); @@ -808,19 +575,23 @@ public PagedFlux listAsync(String resourceGroupName, String ap * * @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}. + * @return list of Application definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -835,13 +606,17 @@ public PagedFlux listAsync(String resourceGroupName, String ap * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Application definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(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)); + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -852,7 +627,7 @@ private PagedFlux listAsync(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 applicationList as paginated response with {@link PagedIterable}. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String applicationGroupName) { @@ -860,7 +635,8 @@ public PagedIterable list(String resourceGroupName, String app final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -875,13 +651,14 @@ 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 as paginated response with {@link PagedIterable}. + * @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)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -891,17 +668,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -909,6 +680,23 @@ private Mono> listNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Application definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -917,21 +705,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..598dfaa3d5cb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, String ap String applicationName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, applicationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationImpl(inner.getValue(), this.manager())); } public Application get(String resourceGroupName, String applicationGroupName, String applicationName) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsClientImpl.java new file mode 100644 index 000000000000..4dee4402cf89 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsClientImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter; +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 ControlSessionHostProvisioningsClient. + */ +public final class ControlSessionHostProvisioningsClientImpl implements ControlSessionHostProvisioningsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ControlSessionHostProvisioningsService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of ControlSessionHostProvisioningsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ControlSessionHostProvisioningsClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(ControlSessionHostProvisioningsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientControlSessionHostProvisionings + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientControlSessionHostProvisionings") + public interface ControlSessionHostProvisioningsService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostProvisioning") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostProvisioning") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, + Context context); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, + hostPoolProvisioningControlParameter, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String hostPoolName, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + final String contentType = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, contentType, hostPoolProvisioningControlParameter, Context.NONE); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String hostPoolName, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context) { + final String contentType = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, contentType, hostPoolProvisioningControlParameter, context); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + Mono>> mono + = postWithResponseAsync(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + Response response + = postWithResponse(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context) { + Response response + = postWithResponse(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + return beginPostAsync(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + beginPost(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter).getFinalResult(); + } + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context) { + beginPost(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter, context).getFinalResult(); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsImpl.java new file mode 100644 index 000000000000..1a6368ea2058 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient; +import com.azure.resourcemanager.desktopvirtualization.models.ControlSessionHostProvisionings; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter; + +public final class ControlSessionHostProvisioningsImpl implements ControlSessionHostProvisionings { + private static final ClientLogger LOGGER = new ClientLogger(ControlSessionHostProvisioningsImpl.class); + + private final ControlSessionHostProvisioningsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public ControlSessionHostProvisioningsImpl(ControlSessionHostProvisioningsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void post(String resourceGroupName, String hostPoolName, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter) { + this.serviceClient().post(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter); + } + + public void post(String resourceGroupName, String hostPoolName, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context) { + this.serviceClient().post(resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter, context); + } + + private ControlSessionHostProvisioningsClient 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/ControlSessionHostUpdatesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java new file mode 100644 index 000000000000..f14b70cc9960 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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 DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of ControlSessionHostUpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ControlSessionHostUpdatesClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(ControlSessionHostUpdatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientControlSessionHostUpdates to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientControlSessionHostUpdates") + public interface ControlSessionHostUpdatesService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") HostPoolUpdateControlParameter hostPoolUpdateControlParameter, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") 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 ManagementException thrown if 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) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, + hostPoolUpdateControlParameter, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter) { + final String contentType = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, contentType, hostPoolUpdateControlParameter, Context.NONE); + } + + /** + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String hostPoolName, + HostPoolUpdateControlParameter hostPoolUpdateControlParameter, Context context) { + final String contentType = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, contentType, hostPoolUpdateControlParameter, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked 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) { + Response response + = postWithResponse(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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) { + Response response + = postWithResponse(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context); + return this.client.getLroResult(response, 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + beginPost(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter).getFinalResult(); + } + + /** + * 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) { + beginPost(resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, context).getFinalResult(); + } +} 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..b5bc09e29f11 --- /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) TypeSpec 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/DesktopImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java index 43d2c0d3a5ab..bebbdee3c895 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; +import com.azure.resourcemanager.desktopvirtualization.models.DesktopProperties; public final class DesktopImpl implements Desktop { private DesktopInner innerObject; @@ -31,28 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String description() { - return this.innerModel().description(); + public DesktopProperties properties() { + return this.innerModel().properties(); } - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public String iconHash() { - return this.innerModel().iconHash(); - } - - public byte[] iconContent() { - return this.innerModel().iconContent(); + public SystemData systemData() { + return this.innerModel().systemData(); } public DesktopInner innerModel() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientBuilder.java similarity index 66% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientBuilder.java index 72ab11caf13d..26246ffe29aa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the DesktopVirtualizationApiClientImpl type. + * A builder for creating a new instance of the DesktopVirtualizationManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { DesktopVirtualizationApiClientImpl.class }) -public final class DesktopVirtualizationApiClientBuilder { +@ServiceClientBuilder(serviceClients = { DesktopVirtualizationManagementClientImpl.class }) +public final class DesktopVirtualizationManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the DesktopVirtualizationApiClientBuilder. + * @param endpoint the endpoint value. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public DesktopVirtualizationManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the DesktopVirtualizationApiClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public DesktopVirtualizationManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public DesktopVirtualizationApiClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the DesktopVirtualizationApiClientBuilder. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder environment(AzureEnvironment environment) { + public DesktopVirtualizationManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public DesktopVirtualizationApiClientBuilder environment(AzureEnvironment enviro * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the DesktopVirtualizationApiClientBuilder. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder pipeline(HttpPipeline pipeline) { + public DesktopVirtualizationManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public DesktopVirtualizationApiClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the DesktopVirtualizationApiClientBuilder. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public DesktopVirtualizationManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public DesktopVirtualizationApiClientBuilder defaultPollInterval(Duration defaul * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the DesktopVirtualizationApiClientBuilder. + * @return the DesktopVirtualizationManagementClientBuilder. */ - public DesktopVirtualizationApiClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public DesktopVirtualizationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of DesktopVirtualizationApiClientImpl with the provided parameters. + * Builds an instance of DesktopVirtualizationManagementClientImpl with the provided parameters. * - * @return an instance of DesktopVirtualizationApiClientImpl. + * @return an instance of DesktopVirtualizationManagementClientImpl. */ - public DesktopVirtualizationApiClientImpl buildClient() { + public DesktopVirtualizationManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public DesktopVirtualizationApiClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - DesktopVirtualizationApiClientImpl client = new DesktopVirtualizationApiClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + DesktopVirtualizationManagementClientImpl client = new DesktopVirtualizationManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } 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/DesktopVirtualizationManagementClientImpl.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientImpl.java index fe0d2bd66533..b5fe0e9e11b4 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/DesktopVirtualizationManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -13,23 +13,30 @@ 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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.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.ControlSessionHostProvisioningsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationManagementClient; import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient; -import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationApiClient; 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 +45,10 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient; @@ -52,31 +63,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the DesktopVirtualizationApiClientImpl type. + * Initializes a new instance of the DesktopVirtualizationManagementClientImpl type. */ -@ServiceClient(builder = DesktopVirtualizationApiClientBuilder.class) -public final class DesktopVirtualizationApiClientImpl implements DesktopVirtualizationApiClient { - /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - +@ServiceClient(builder = DesktopVirtualizationManagementClientBuilder.class) +public final class DesktopVirtualizationManagementClientImpl implements DesktopVirtualizationManagementClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -85,12 +82,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -98,6 +95,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -155,115 +166,129 @@ 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 StartMenuItemsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; + private final StartMenuItemsClient startMenuItems; /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the StartMenuItemsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the StartMenuItemsClient object. */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; + public StartMenuItemsClient getStartMenuItems() { + return this.startMenuItems; } /** - * The PrivateLinkResourcesClient object to access its operations. + * The ApplicationGroupsClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; + private final ApplicationGroupsClient applicationGroups; /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the ApplicationGroupsClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the ApplicationGroupsClient object. */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; + public ApplicationGroupsClient getApplicationGroups() { + return this.applicationGroups; } /** - * The ScalingPlansClient object to access its operations. + * The AppAttachPackageInfoesClient object to access its operations. */ - private final ScalingPlansClient scalingPlans; + private final AppAttachPackageInfoesClient appAttachPackageInfoes; /** - * Gets the ScalingPlansClient object to access its operations. + * Gets the AppAttachPackageInfoesClient object to access its operations. * - * @return the ScalingPlansClient object. + * @return the AppAttachPackageInfoesClient object. */ - public ScalingPlansClient getScalingPlans() { - return this.scalingPlans; + public AppAttachPackageInfoesClient getAppAttachPackageInfoes() { + return this.appAttachPackageInfoes; } /** - * The ScalingPlanPooledSchedulesClient object to access its operations. + * The MsixImagesClient object to access its operations. */ - private final ScalingPlanPooledSchedulesClient scalingPlanPooledSchedules; + private final MsixImagesClient msixImages; /** - * Gets the ScalingPlanPooledSchedulesClient object to access its operations. + * Gets the MsixImagesClient object to access its operations. * - * @return the ScalingPlanPooledSchedulesClient object. + * @return the MsixImagesClient object. */ - public ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules() { - return this.scalingPlanPooledSchedules; + public MsixImagesClient getMsixImages() { + return this.msixImages; } /** - * The ScalingPlanPersonalSchedulesClient object to access its operations. + * The PrivateLinkResourcesClient object to access its operations. */ - private final ScalingPlanPersonalSchedulesClient scalingPlanPersonalSchedules; + private final PrivateLinkResourcesClient privateLinkResources; /** - * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the ScalingPlanPersonalSchedulesClient object. + * @return the PrivateLinkResourcesClient object. */ - public ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules() { - return this.scalingPlanPersonalSchedules; + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; } /** - * The ApplicationGroupsClient object to access its operations. + * The HostPoolsClient object to access its operations. */ - private final ApplicationGroupsClient applicationGroups; + private final HostPoolsClient hostPools; /** - * Gets the ApplicationGroupsClient object to access its operations. + * Gets the HostPoolsClient object to access its operations. * - * @return the ApplicationGroupsClient object. + * @return the HostPoolsClient object. */ - public ApplicationGroupsClient getApplicationGroups() { - return this.applicationGroups; + public HostPoolsClient getHostPools() { + return this.hostPools; } /** - * The StartMenuItemsClient object to access its operations. + * The ScalingPlansClient object to access its operations. */ - private final StartMenuItemsClient startMenuItems; + private final ScalingPlansClient scalingPlans; /** - * Gets the StartMenuItemsClient object to access its operations. + * Gets the ScalingPlansClient object to access its operations. * - * @return the StartMenuItemsClient object. + * @return the ScalingPlansClient object. */ - public StartMenuItemsClient getStartMenuItems() { - return this.startMenuItems; + public ScalingPlansClient getScalingPlans() { + return this.scalingPlans; + } + + /** + * The WorkspacesClient object to access its operations. + */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; } /** @@ -295,17 +320,31 @@ public DesktopsClient getDesktops() { } /** - * The HostPoolsClient object to access its operations. + * The PrivateEndpointConnectionsClient object to access its operations. */ - private final HostPoolsClient hostPools; + private final PrivateEndpointConnectionsClient privateEndpointConnections; /** - * Gets the HostPoolsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the HostPoolsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - public HostPoolsClient getHostPools() { - return this.hostPools; + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * 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; } /** @@ -323,17 +362,31 @@ public UserSessionsClient getUserSessions() { } /** - * The SessionHostsClient object to access its operations. + * The ScalingPlanPersonalSchedulesClient object to access its operations. */ - private final SessionHostsClient sessionHosts; + private final ScalingPlanPersonalSchedulesClient scalingPlanPersonalSchedules; /** - * Gets the SessionHostsClient object to access its operations. + * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. * - * @return the SessionHostsClient object. + * @return the ScalingPlanPersonalSchedulesClient object. */ - public SessionHostsClient getSessionHosts() { - return this.sessionHosts; + 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; } /** @@ -351,83 +404,161 @@ public MsixPackagesClient getMsixPackages() { } /** - * The AppAttachPackageInfoesClient object to access its operations. + * The ActiveSessionHostConfigurationsClient object to access its operations. */ - private final AppAttachPackageInfoesClient appAttachPackageInfoes; + private final ActiveSessionHostConfigurationsClient activeSessionHostConfigurations; /** - * Gets the AppAttachPackageInfoesClient object to access its operations. + * Gets the ActiveSessionHostConfigurationsClient object to access its operations. * - * @return the AppAttachPackageInfoesClient object. + * @return the ActiveSessionHostConfigurationsClient object. */ - public AppAttachPackageInfoesClient getAppAttachPackageInfoes() { - return this.appAttachPackageInfoes; + public ActiveSessionHostConfigurationsClient getActiveSessionHostConfigurations() { + return this.activeSessionHostConfigurations; } /** - * The MsixImagesClient object to access its operations. + * The InitiateSessionHostUpdatesClient object to access its operations. */ - private final MsixImagesClient msixImages; + private final InitiateSessionHostUpdatesClient initiateSessionHostUpdates; /** - * Gets the MsixImagesClient object to access its operations. + * Gets the InitiateSessionHostUpdatesClient object to access its operations. * - * @return the MsixImagesClient object. + * @return the InitiateSessionHostUpdatesClient object. */ - public MsixImagesClient getMsixImages() { - return this.msixImages; + public InitiateSessionHostUpdatesClient getInitiateSessionHostUpdates() { + return this.initiateSessionHostUpdates; } /** - * 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; } /** - * Initializes an instance of DesktopVirtualizationApiClient client. + * The ControlSessionHostProvisioningsClient object to access its operations. + */ + private final ControlSessionHostProvisioningsClient controlSessionHostProvisionings; + + /** + * Gets the ControlSessionHostProvisioningsClient object to access its operations. + * + * @return the ControlSessionHostProvisioningsClient object. + */ + public ControlSessionHostProvisioningsClient getControlSessionHostProvisionings() { + return this.controlSessionHostProvisionings; + } + + /** + * The SessionHostManagementsClient object to access its operations. + */ + private final SessionHostManagementsClient sessionHostManagements; + + /** + * Gets the SessionHostManagementsClient object to access its operations. + * + * @return the SessionHostManagementsClient object. + */ + public SessionHostManagementsClient getSessionHostManagements() { + return this.sessionHostManagements; + } + + /** + * The SessionHostConfigurationsClient object to access its operations. + */ + private final SessionHostConfigurationsClient sessionHostConfigurations; + + /** + * Gets the SessionHostConfigurationsClient object to access its operations. + * + * @return the SessionHostConfigurationsClient object. + */ + public SessionHostConfigurationsClient getSessionHostConfigurations() { + return this.sessionHostConfigurations; + } + + /** + * The SessionHostManagementUpdateStatusesClient object to access its operations. + */ + private final SessionHostManagementUpdateStatusesClient sessionHostManagementUpdateStatuses; + + /** + * Gets the SessionHostManagementUpdateStatusesClient object to access its operations. + * + * @return the SessionHostManagementUpdateStatusesClient object. + */ + public SessionHostManagementUpdateStatusesClient getSessionHostManagementUpdateStatuses() { + return this.sessionHostManagementUpdateStatuses; + } + + /** + * The SessionHostManagementProvisioningStatusesClient object to access its operations. + */ + private final SessionHostManagementProvisioningStatusesClient sessionHostManagementProvisioningStatuses; + + /** + * Gets the SessionHostManagementProvisioningStatusesClient object to access its operations. + * + * @return the SessionHostManagementProvisioningStatusesClient object. + */ + public SessionHostManagementProvisioningStatusesClient getSessionHostManagementProvisioningStatuses() { + return this.sessionHostManagementProvisioningStatuses; + } + + /** + * Initializes an instance of DesktopVirtualizationManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - DesktopVirtualizationApiClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + DesktopVirtualizationManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-04-03"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-01-01-preview"; this.operations = new OperationsClientImpl(this); - this.workspaces = new WorkspacesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.appAttachPackages = new AppAttachPackagesClientImpl(this); + this.startMenuItems = new StartMenuItemsClientImpl(this); + this.applicationGroups = new ApplicationGroupsClientImpl(this); + this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); + this.msixImages = new MsixImagesClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.hostPools = new HostPoolsClientImpl(this); this.scalingPlans = new ScalingPlansClientImpl(this); - this.scalingPlanPooledSchedules = new ScalingPlanPooledSchedulesClientImpl(this); - this.scalingPlanPersonalSchedules = new ScalingPlanPersonalSchedulesClientImpl(this); - this.applicationGroups = new ApplicationGroupsClientImpl(this); - this.startMenuItems = new StartMenuItemsClientImpl(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.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.sessionHosts = new SessionHostsClientImpl(this); + this.userSessions = new UserSessionsClientImpl(this); + this.scalingPlanPersonalSchedules = new ScalingPlanPersonalSchedulesClientImpl(this); + this.scalingPlanPooledSchedules = new ScalingPlanPooledSchedulesClientImpl(this); this.msixPackages = new MsixPackagesClientImpl(this); - this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); - this.msixImages = new MsixImagesClientImpl(this); - this.appAttachPackages = new AppAttachPackagesClientImpl(this); + this.activeSessionHostConfigurations = new ActiveSessionHostConfigurationsClientImpl(this); + this.initiateSessionHostUpdates = new InitiateSessionHostUpdatesClientImpl(this); + this.controlSessionHostUpdates = new ControlSessionHostUpdatesClientImpl(this); + this.controlSessionHostProvisionings = new ControlSessionHostProvisioningsClientImpl(this); + this.sessionHostManagements = new SessionHostManagementsClientImpl(this); + this.sessionHostConfigurations = new SessionHostConfigurationsClientImpl(this); + this.sessionHostManagementUpdateStatuses = new SessionHostManagementUpdateStatusesClientImpl(this); + this.sessionHostManagementProvisioningStatuses = new SessionHostManagementProvisioningStatusesClientImpl(this); } /** @@ -467,6 +598,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -556,5 +704,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(DesktopVirtualizationApiClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DesktopVirtualizationManagementClientImpl.class); } 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..0060208a9fcb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -29,7 +29,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; -import com.azure.resourcemanager.desktopvirtualization.models.DesktopList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.DesktopList; import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; import reactor.core.publisher.Mono; @@ -45,51 +45,83 @@ public final class DesktopsClientImpl implements DesktopsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of DesktopsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DesktopsClientImpl(DesktopVirtualizationApiClientImpl client) { + DesktopsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(DesktopsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientDesktops to be used by the proxy + * The interface defining all the services for DesktopVirtualizationManagementClientDesktops to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientDesktops") public interface DesktopsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @PathParam("desktopName") String desktopName, @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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("desktopName") String desktopName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGroupName") String applicationGroupName, + @PathParam("desktopName") String desktopName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DesktopPatch desktop, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("desktopName") String desktopName, @BodyParam("application/json") DesktopPatch desktop, + @PathParam("desktopName") String desktopName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DesktopPatch desktop, 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("endpoint") 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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, @@ -101,7 +133,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -118,25 +157,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = tr @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (applicationGroupName == null) { - 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(), @@ -144,46 +164,6 @@ public Mono> getWithResponseAsync(String resourceGroupNam .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (applicationGroupName == null) { - 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); - } - /** * Get a desktop. * @@ -216,7 +196,9 @@ public Mono getAsync(String resourceGroupName, String applicationG @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, Context context) { - return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, desktopName, accept, context); } /** @@ -241,7 +223,7 @@ public DesktopInner get(String resourceGroupName, String applicationGroupName, 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -250,80 +232,14 @@ public DesktopInner get(String resourceGroupName, String applicationGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (applicationGroupName == null) { - 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.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, desktop, accept, + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, accept, desktop, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (applicationGroupName == null) { - 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.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, applicationGroupName, desktopName, desktop, accept, context); - } - /** * Update a desktop. * @@ -348,7 +264,7 @@ public Mono updateAsync(String resourceGroupName, String applicati * @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 ManagementException thrown if the request is rejected by server. @@ -358,7 +274,10 @@ public Mono updateAsync(String resourceGroupName, String applicati @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(); + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, accept, desktop, + context); } /** @@ -390,27 +309,11 @@ public DesktopInner update(String resourceGroupName, String applicationGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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 (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(), @@ -429,38 +332,17 @@ private Mono> listSinglePageAsync(String resourceGro * @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 desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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(), - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @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)); } /** @@ -468,17 +350,16 @@ private Mono> listSinglePageAsync(String resourceGro * * @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}. + * @return list of Desktop definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { + 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)); @@ -489,19 +370,23 @@ public PagedFlux listAsync(String resourceGroupName, String applic * * @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}. + * @return list of Desktop definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -516,13 +401,17 @@ public PagedFlux listAsync(String resourceGroupName, String applic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Desktop definitions along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -533,7 +422,7 @@ private PagedFlux listAsync(String resourceGroupName, String appli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Desktop definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String applicationGroupName) { @@ -541,7 +430,8 @@ public PagedIterable list(String resourceGroupName, String applica final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -556,13 +446,14 @@ 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 as paginated response with {@link PagedIterable}. + * @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)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -572,17 +463,10 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -590,6 +474,23 @@ private Mono> listNextSinglePageAsync(String nextLin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Desktop definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -598,21 +499,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..b96e7b23d96a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -32,12 +32,8 @@ public Response getWithResponse(String resourceGroupName, String applic Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, desktopName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DesktopImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DesktopImpl(inner.getValue(), this.manager())); } public Desktop get(String resourceGroupName, String applicationGroupName, String desktopName) { @@ -53,12 +49,8 @@ public Response updateWithResponse(String resourceGroupName, String app String desktopName, DesktopPatch desktop, Context context) { Response inner = this.serviceClient() .updateWithResponse(resourceGroupName, applicationGroupName, desktopName, desktop, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DesktopImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DesktopImpl(inner.getValue(), this.manager())); } public Desktop update(String resourceGroupName, String applicationGroupName, String desktopName) { 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..9084c9c30c4f 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 @@ -1,17 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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..1f9c1a617f55 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 @@ -1,34 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.management.Region; import com.azure.core.management.SystemData; 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.fluent.models.HostPoolPropertiesInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; -import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; -import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; -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.HostPoolPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; 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.SsoSecretType; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.util.Collections; -import java.util.List; import java.util.Map; public final class HostPoolImpl implements HostPool, HostPool.Definition, HostPool.Update { @@ -61,148 +53,41 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public ResourceModelWithAllowedPropertySetIdentity identity() { - return this.innerModel().identity(); - } - - public ResourceModelWithAllowedPropertySetSku sku() { - return this.innerModel().sku(); - } - - public ResourceModelWithAllowedPropertySetPlan plan() { - return this.innerModel().plan(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public String description() { - return this.innerModel().description(); - } - - public HostPoolType hostPoolType() { - return this.innerModel().hostPoolType(); - } - - public PersonalDesktopAssignmentType personalDesktopAssignmentType() { - return this.innerModel().personalDesktopAssignmentType(); - } - - public String customRdpProperty() { - return this.innerModel().customRdpProperty(); - } - - public Integer maxSessionLimit() { - return this.innerModel().maxSessionLimit(); - } - - public LoadBalancerType loadBalancerType() { - return this.innerModel().loadBalancerType(); - } - - public Integer ring() { - return this.innerModel().ring(); - } - - public Boolean validationEnvironment() { - return this.innerModel().validationEnvironment(); - } - - public RegistrationInfo registrationInfo() { - RegistrationInfoInner inner = this.innerModel().registrationInfo(); + public HostPoolProperties properties() { + HostPoolPropertiesInner inner = this.innerModel().properties(); if (inner != null) { - return new RegistrationInfoImpl(inner, this.manager()); + return new HostPoolPropertiesImpl(inner, this.manager()); } else { return null; } } - public String vmTemplate() { - return this.innerModel().vmTemplate(); - } - - public List applicationGroupReferences() { - List inner = this.innerModel().applicationGroupReferences(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List appAttachPackageReferences() { - List inner = this.innerModel().appAttachPackageReferences(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String ssoadfsAuthority() { - return this.innerModel().ssoadfsAuthority(); - } - - public String ssoClientId() { - return this.innerModel().ssoClientId(); - } - - public String ssoClientSecretKeyVaultPath() { - return this.innerModel().ssoClientSecretKeyVaultPath(); - } - - public SsoSecretType ssoSecretType() { - return this.innerModel().ssoSecretType(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } - public PreferredAppGroupType preferredAppGroupType() { - return this.innerModel().preferredAppGroupType(); + public String etag() { + return this.innerModel().etag(); } - public Boolean startVMOnConnect() { - return this.innerModel().startVMOnConnect(); + public String kind() { + return this.innerModel().kind(); } - public Boolean cloudPcResource() { - return this.innerModel().cloudPcResource(); + public String managedBy() { + return this.innerModel().managedBy(); } - public HostpoolPublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); + public Plan plan() { + return this.innerModel().plan(); } - public AgentUpdateProperties agentUpdate() { - return this.innerModel().agentUpdate(); + public Sku sku() { + return this.innerModel().sku(); } - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -304,6 +189,14 @@ public HostPool refresh(Context context) { return this; } + public PagedIterable listRegistrationTokens() { + return serviceManager.hostPools().listRegistrationTokens(resourceGroupName, hostPoolName); + } + + public PagedIterable listRegistrationTokens(Context context) { + return serviceManager.hostPools().listRegistrationTokens(resourceGroupName, hostPoolName, context); + } + public Response retrieveRegistrationTokenWithResponse(Context context) { return serviceManager.hostPools() .retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); @@ -313,14 +206,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; @@ -331,227 +216,57 @@ public HostPoolImpl withRegion(String location) { return this; } - public HostPoolImpl withHostPoolType(HostPoolType hostPoolType) { - this.innerModel().withHostPoolType(hostPoolType); + public HostPoolImpl withProperties(HostPoolPropertiesInner properties) { + this.innerModel().withProperties(properties); return this; } - public HostPoolImpl withLoadBalancerType(LoadBalancerType loadBalancerType) { - if (isInCreateMode()) { - this.innerModel().withLoadBalancerType(loadBalancerType); - return this; - } else { - this.updateHostPool.withLoadBalancerType(loadBalancerType); - return this; - } - } - - public HostPoolImpl withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { + public HostPoolImpl withTags(Map tags) { if (isInCreateMode()) { - this.innerModel().withPreferredAppGroupType(preferredAppGroupType); + this.innerModel().withTags(tags); return this; } else { - this.updateHostPool.withPreferredAppGroupType(preferredAppGroupType); + this.updateHostPool.withTags(tags); return this; } } - public HostPoolImpl withTags(Map tags) { + public HostPoolImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { - this.innerModel().withTags(tags); + this.innerModel().withIdentity(identity); return this; } else { - this.updateHostPool.withTags(tags); + this.updateHostPool.withIdentity(identity); return this; } } - public HostPoolImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); - return this; - } - public HostPoolImpl withKind(String kind) { this.innerModel().withKind(kind); return this; } - public HostPoolImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public HostPoolImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public HostPoolImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public HostPoolImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public HostPoolImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } - public HostPoolImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateHostPool.withFriendlyName(friendlyName); - return this; - } - } - - public HostPoolImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateHostPool.withDescription(description); - return this; - } - } - - public HostPoolImpl withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { - if (isInCreateMode()) { - this.innerModel().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - return this; - } else { - this.updateHostPool.withPersonalDesktopAssignmentType(personalDesktopAssignmentType); - return this; - } - } - - public HostPoolImpl withCustomRdpProperty(String customRdpProperty) { - if (isInCreateMode()) { - this.innerModel().withCustomRdpProperty(customRdpProperty); - return this; - } else { - this.updateHostPool.withCustomRdpProperty(customRdpProperty); - return this; - } - } - - public HostPoolImpl withMaxSessionLimit(Integer maxSessionLimit) { - if (isInCreateMode()) { - this.innerModel().withMaxSessionLimit(maxSessionLimit); - return this; - } else { - this.updateHostPool.withMaxSessionLimit(maxSessionLimit); - return this; - } - } - - public HostPoolImpl withRing(Integer ring) { - if (isInCreateMode()) { - this.innerModel().withRing(ring); - return this; - } else { - this.updateHostPool.withRing(ring); - return this; - } - } - - public HostPoolImpl withValidationEnvironment(Boolean validationEnvironment) { - if (isInCreateMode()) { - this.innerModel().withValidationEnvironment(validationEnvironment); - return this; - } else { - this.updateHostPool.withValidationEnvironment(validationEnvironment); - return this; - } - } - - public HostPoolImpl withRegistrationInfo(RegistrationInfoInner registrationInfo) { - this.innerModel().withRegistrationInfo(registrationInfo); - return this; - } - - public HostPoolImpl withVmTemplate(String vmTemplate) { - if (isInCreateMode()) { - this.innerModel().withVmTemplate(vmTemplate); - return this; - } else { - this.updateHostPool.withVmTemplate(vmTemplate); - return this; - } - } - - public HostPoolImpl withSsoadfsAuthority(String ssoadfsAuthority) { - if (isInCreateMode()) { - this.innerModel().withSsoadfsAuthority(ssoadfsAuthority); - return this; - } else { - this.updateHostPool.withSsoadfsAuthority(ssoadfsAuthority); - return this; - } - } - - public HostPoolImpl withSsoClientId(String ssoClientId) { - if (isInCreateMode()) { - this.innerModel().withSsoClientId(ssoClientId); - return this; - } else { - this.updateHostPool.withSsoClientId(ssoClientId); - return this; - } - } - - public HostPoolImpl withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { - if (isInCreateMode()) { - this.innerModel().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); - return this; - } else { - this.updateHostPool.withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); - return this; - } - } - - public HostPoolImpl withSsoSecretType(SsoSecretType ssoSecretType) { - if (isInCreateMode()) { - this.innerModel().withSsoSecretType(ssoSecretType); - return this; - } else { - this.updateHostPool.withSsoSecretType(ssoSecretType); - return this; - } - } - - public HostPoolImpl withStartVMOnConnect(Boolean startVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withStartVMOnConnect(startVMOnConnect); - return this; - } else { - this.updateHostPool.withStartVMOnConnect(startVMOnConnect); - return this; - } - } - - public HostPoolImpl withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess) { - if (isInCreateMode()) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } else { - this.updateHostPool.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - } - - public HostPoolImpl withAgentUpdate(AgentUpdateProperties agentUpdate) { - this.innerModel().withAgentUpdate(agentUpdate); - return this; - } - - public HostPoolImpl withRegistrationInfo(RegistrationInfoPatch registrationInfo) { - this.updateHostPool.withRegistrationInfo(registrationInfo); + public HostPoolImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } - public HostPoolImpl withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { - this.updateHostPool.withAgentUpdate(agentUpdate); + public HostPoolImpl withProperties(HostPoolPatchProperties properties) { + this.updateHostPool.withProperties(properties); return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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..eb6b049e122a 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 @@ -1,20 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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.AllowRDPShortPathWithPrivateLink; +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +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 +153,38 @@ 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 DeploymentScope deploymentScope() { + return this.innerModel().deploymentScope(); + } + + public String oboTenantId() { + return this.innerModel().oboTenantId(); + } + + public AllowRDPShortPathWithPrivateLink allowRDPShortPathWithPrivateLink() { + return this.innerModel().allowRDPShortPathWithPrivateLink(); + } + 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..5eb113efac62 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -34,7 +34,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolList; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.HostPoolList; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; import reactor.core.publisher.Mono; @@ -50,69 +51,115 @@ public final class HostPoolsClientImpl implements HostPoolsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of HostPoolsClientImpl. * * @param client the instance of the service client containing this operation class. */ - HostPoolsClientImpl(DesktopVirtualizationApiClientImpl client) { + HostPoolsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(HostPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientHostPools to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientHostPools to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientHostPools") public interface HostPoolsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HostPoolInner hostPool, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") HostPoolInner hostPool, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HostPoolInner hostPool, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HostPoolPatch hostPool, Context context); @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HostPoolPatch hostPool, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("force") Boolean force, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @QueryParam("force") Boolean force, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") HostPoolPatch hostPool, @HeaderParam("Accept") String accept, - Context context); + @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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") 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, @@ -122,16 +169,25 @@ Mono> listByResourceGroup(@HostParam("$host") String endp @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> retrieveRegistrationToken(@HostParam("$host") String endpoint, + Mono> listRegistrationTokens(@HostParam("endpoint") 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); @@ -140,7 +196,25 @@ Mono> retrieveRegistrationToken(@HostParam("$hos @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRegistrationTokens(@HostParam("$host") String endpoint, + Response listRegistrationTokensSync(@HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> retrieveRegistrationToken(@HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retrieveRegistrationTokenSync(@HostParam("endpoint") 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); @@ -150,7 +224,15 @@ Mono> listRegistrationTokens(@HostParam("$h @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -158,7 +240,14 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -174,21 +263,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = t @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -196,41 +270,6 @@ public Mono> getByResourceGroupWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); - } - /** * Get a host pool. * @@ -261,7 +300,9 @@ public Mono getByResourceGroupAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** @@ -293,74 +334,15 @@ public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoo @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (hostPool == null) { - return Mono.error(new IllegalArgumentException("Parameter hostPool is required and cannot be null.")); - } else { - hostPool.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, hostPool, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Create or update a host pool. * @@ -394,7 +376,10 @@ public Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, HostPoolInner hostPool, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, hostPool, context); } /** @@ -414,252 +399,146 @@ public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolNam } /** - * Remove a host pool. + * 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 force Force flag to delete sessionHost. + * @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 the {@link Response} 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) - 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.")); - } - 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.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool) { 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, hostPool, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String 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.")); - } - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, force, accept, context); - } - - /** - * Remove a host pool. + * 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 ManagementException 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 HostPool definition 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 updateAsync(String resourceGroupName, String hostPoolName) { + final HostPoolPatch hostPool = null; + return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a host pool. + * 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 force Force flag to delete sessionHost. + * @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 the {@link Response}. + * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, - Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, force, context).block(); + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, hostPool, context); } /** - * Remove a host pool. + * 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 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 void delete(String resourceGroupName, String hostPoolName) { - final Boolean force = null; - deleteWithResponse(resourceGroupName, hostPoolName, force, Context.NONE); + public HostPoolInner update(String resourceGroupName, String hostPoolName) { + final HostPoolPatch hostPool = null; + return updateWithResponse(resourceGroupName, hostPoolName, hostPool, Context.NONE).getValue(); } /** - * Update a host pool. + * 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 hostPool Object containing HostPool definitions. + * @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 represents a HostPool 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) - 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.")); - } - 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 (hostPool != null) { - hostPool.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, force, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (hostPool != null) { - 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); - } - - /** - * Update a host pool. + * 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 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 A {@link Mono} that completes when a successful response is received. */ @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())); + public Mono deleteAsync(String resourceGroupName, String hostPoolName) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, hostPoolName, force).flatMap(ignored -> Mono.empty()); } /** - * Update a host pool. + * 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 hostPool Object containing HostPool definitions. + * @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 represents a HostPool definition along with {@link Response}. + * @return the {@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 deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, force, context); } /** - * Update a host pool. + * 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 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 void delete(String resourceGroupName, String hostPoolName) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, hostPoolName, force, Context.NONE); } /** @@ -672,23 +551,11 @@ public HostPoolInner update(String resourceGroupName, String hostPoolName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -706,46 +573,10 @@ private Mono> listByResourceGroupSinglePageAsync(St * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String 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}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, @@ -762,7 +593,7 @@ public PagedFlux listByResourceGroupAsync(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 as paginated response with {@link PagedFlux}. + * @return list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -774,6 +605,29 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNam nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List hostPools. * @@ -785,14 +639,17 @@ public PagedFlux listByResourceGroupAsync(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 as paginated response with {@link PagedFlux}. + * @return list of HostPool definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -802,14 +659,16 @@ private PagedFlux listByResourceGroupAsync(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 hostPoolList as paginated response with {@link PagedIterable}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -823,13 +682,14 @@ public PagedIterable listByResourceGroup(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 hostPoolList as paginated response with {@link PagedIterable}. + * @return list of HostPool 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)); + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -841,19 +701,11 @@ public PagedIterable listByResourceGroup(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 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> 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.")); - } - 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(), @@ -869,42 +721,10 @@ private Mono> listSinglePageAsync(Integer pageSize, * @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 hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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(), pageSize, - isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { @@ -917,7 +737,7 @@ public PagedFlux listAsync(Integer pageSize, Boolean isDescending * * @throws 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 list of HostPool definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { @@ -928,6 +748,26 @@ public PagedFlux listAsync() { 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List hostPools in subscription. * @@ -938,13 +778,16 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of HostPool definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -952,14 +795,15 @@ private PagedFlux listAsync(Integer pageSize, Boolean isDescendin * * @throws 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 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)); + return new PagedIterable<>(() -> listSinglePage(pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -972,105 +816,78 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of HostPool definitions 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)); + return new PagedIterable<>(() -> listSinglePage(pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, 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 along with {@link Response} on successful completion of + * @return list of RegistrationToken definitions along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveRegistrationTokenWithResponseAsync(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.")); - } + private Mono> + listRegistrationTokensSinglePageAsync(String resourceGroupName, String hostPoolName) { 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 - * {@link Mono}. + * @return list of RegistrationToken definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveRegistrationTokenWithResponseAsync(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.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRegistrationTokensAsync(String resourceGroupName, + String hostPoolName) { + return new PagedFlux<>(() -> listRegistrationTokensSinglePageAsync(resourceGroupName, 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 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 along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveRegistrationTokenAsync(String resourceGroupName, String hostPoolName) { - return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listRegistrationTokensSinglePage(String resourceGroupName, + String hostPoolName) { + final String accept = "application/json"; + Response res + = service.listRegistrationTokensSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** - * 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,27 +895,33 @@ 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 PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, + private PagedResponse listRegistrationTokensSinglePage(String resourceGroupName, String hostPoolName, Context context) { - return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + final String accept = "application/json"; + Response res + = service.listRegistrationTokensSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** - * 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { - return retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRegistrationTokens(String resourceGroupName, + String hostPoolName) { + return new PagedIterable<>(() -> listRegistrationTokensSinglePage(resourceGroupName, hostPoolName)); } /** @@ -1106,90 +929,58 @@ public RegistrationInfoInner retrieveRegistrationToken(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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listRegistrationTokensWithResponseAsync(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.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRegistrationTokens(String resourceGroupName, + String hostPoolName, Context context) { + return new PagedIterable<>(() -> listRegistrationTokensSinglePage(resourceGroupName, hostPoolName, 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, - 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.")); - } + public Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + String hostPoolName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return FluxUtil + .withContext( + 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 +988,29 @@ 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(); + final String accept = "application/json"; + return service.retrieveRegistrationTokenSync(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. + * @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,17 +1020,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) { - 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( @@ -1247,6 +1033,24 @@ private Mono> listByResourceGroupNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1255,23 +1059,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1281,17 +1077,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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1299,6 +1088,23 @@ private Mono> listNextSinglePageAsync(String nextLi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HostPool definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1307,21 +1113,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..698497cc095e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -12,11 +12,11 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.HostPools; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfo; -import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; public final class HostPoolsImpl implements HostPools { private static final ClientLogger LOGGER = new ClientLogger(HostPoolsImpl.class); @@ -35,12 +35,8 @@ public Response getByResourceGroupWithResponse(String resourceGroupNam Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HostPoolImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HostPoolImpl(inner.getValue(), this.manager())); } public HostPool getByResourceGroup(String resourceGroupName, String hostPoolName) { @@ -83,16 +79,26 @@ public PagedIterable list(Integer pageSize, Boolean isDescending, Inte return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); } + public PagedIterable listRegistrationTokens(String resourceGroupName, + String hostPoolName) { + PagedIterable inner + = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistrationTokenMinimalImpl(inner1, this.manager())); + } + + public PagedIterable listRegistrationTokens(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistrationTokenMinimalImpl(inner1, this.manager())); + } + public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, Context context) { Response inner = this.serviceClient().retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegistrationInfoImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RegistrationInfoImpl(inner.getValue(), this.manager())); } public RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName) { @@ -104,27 +110,6 @@ public RegistrationInfo retrieveRegistrationToken(String resourceGroupName, Stri } } - public Response listRegistrationTokensWithResponse(String resourceGroupName, - String hostPoolName, Context context) { - Response inner - = this.serviceClient().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegistrationTokenListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName) { - RegistrationTokenListInner inner = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName); - if (inner != null) { - return new RegistrationTokenListImpl(inner, this.manager()); - } else { - return null; - } - } - public HostPool 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/InitiateSessionHostUpdatesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java new file mode 100644 index 000000000000..48f333fef2a7 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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 DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of InitiateSessionHostUpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InitiateSessionHostUpdatesClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(InitiateSessionHostUpdatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientInitiateSessionHostUpdates to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientInitiateSessionHostUpdates") + public interface InitiateSessionHostUpdatesService { + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") UpdateSessionHostsRequestBody updateSessionHostsRequestBody, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") 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. + * @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) { + return FluxUtil.withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, updateSessionHostsRequestBody, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, updateSessionHostsRequestBody, 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. + */ + @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..3aee06a44ce8 --- /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) TypeSpec 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..2836090a7f87 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -29,7 +29,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; -import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ExpandMsixImageList; import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; import reactor.core.publisher.Mono; @@ -45,34 +45,44 @@ public final class MsixImagesClientImpl implements MsixImagesClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of MsixImagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - MsixImagesClientImpl(DesktopVirtualizationApiClientImpl client) { + MsixImagesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(MsixImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientMsixImages to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientMsixImages to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientMsixImages") public interface MsixImagesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> expand(@HostParam("$host") String endpoint, + Mono> expand(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") MsixImageUri msixImageUri, @HeaderParam("Accept") String accept, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MsixImageUri msixImageURI, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response expandSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MsixImageUri msixImageURI, Context context); @Headers({ "Content-Type: application/json" }) @@ -80,47 +90,36 @@ Mono> expand(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> expandNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response expandNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, - String hostPoolName, MsixImageUri msixImageUri) { - 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 (msixImageUri == null) { - return Mono.error(new IllegalArgumentException("Parameter msixImageUri is required and cannot be null.")); - } else { - msixImageUri.validate(); - } + String hostPoolName, MsixImageUri msixImageURI) { final String accept = "application/json"; return FluxUtil .withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixImageUri, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, msixImageURI, 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())); @@ -128,118 +127,108 @@ 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 context The context to associate with this operation. + * @param msixImageURI Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandSinglePageAsync(String resourceGroupName, - String hostPoolName, MsixImageUri msixImageUri, 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 (msixImageUri == null) { - return Mono.error(new IllegalArgumentException("Parameter msixImageUri is required and cannot be null.")); - } else { - msixImageUri.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .expand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, msixImageUri, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux expandAsync(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageURI) { + return new PagedFlux<>(() -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageURI), + nextLink -> expandNextSinglePageAsync(nextLink)); } /** * 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux expandAsync(String resourceGroupName, String hostPoolName, - MsixImageUri msixImageUri) { - return new PagedFlux<>(() -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri), - nextLink -> expandNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse expandSinglePage(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageURI) { + final String accept = "application/json"; + Response res = service.expandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, msixImageURI, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * 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 Represents URI referring to MSIX Image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux expandAsync(String resourceGroupName, String hostPoolName, - MsixImageUri msixImageUri, Context context) { - return new PagedFlux<>(() -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri, context), - nextLink -> expandNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse expandSinglePage(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageURI, Context context) { + final String accept = "application/json"; + Response res = service.expandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, msixImageURI, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, - MsixImageUri msixImageUri) { - return new PagedIterable<>(expandAsync(resourceGroupName, hostPoolName, msixImageUri)); + MsixImageUri msixImageURI) { + return new PagedIterable<>(() -> expandSinglePage(resourceGroupName, hostPoolName, msixImageURI), + nextLink -> expandNextSinglePage(nextLink)); } /** * 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 Represents URI referring to MSIX Image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, - MsixImageUri msixImageUri, Context context) { - return new PagedIterable<>(expandAsync(resourceGroupName, hostPoolName, msixImageUri, context)); + MsixImageUri msixImageURI, Context context) { + return new PagedIterable<>(() -> expandSinglePage(resourceGroupName, hostPoolName, msixImageURI, context), + nextLink -> expandNextSinglePage(nextLink, context)); } /** @@ -249,17 +238,11 @@ 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) { - 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.expandNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -267,6 +250,24 @@ private Mono> expandNextSinglePageAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of MSIX package properties retrieved from MSIX Image expansion along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse expandNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.expandNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -275,21 +276,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandNextSinglePageAsync(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.")); - } + private PagedResponse expandNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.expandNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.expandNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..bf6db9b4f856 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -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); @@ -27,16 +27,16 @@ public MsixImagesImpl(MsixImagesClient innerClient, } public PagedIterable expand(String resourceGroupName, String hostPoolName, - MsixImageUri msixImageUri) { + MsixImageUri msixImageURI) { PagedIterable inner - = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri); + = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageURI); return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); } public PagedIterable expand(String resourceGroupName, String hostPoolName, - MsixImageUri msixImageUri, Context context) { + MsixImageUri msixImageURI, Context context) { PagedIterable inner - = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri, context); + = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageURI, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); } 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..5c3eac964627 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -8,12 +8,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; public final class MsixPackageImpl implements MsixPackage, MsixPackage.Definition, MsixPackage.Update { private MsixPackageInner innerObject; @@ -32,62 +29,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String imagePath() { - return this.innerModel().imagePath(); + public MsixPackageProperties properties() { + return this.innerModel().properties(); } - public String packageName() { - return this.innerModel().packageName(); - } - - public String packageFamilyName() { - return this.innerModel().packageFamilyName(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String packageRelativePath() { - return this.innerModel().packageRelativePath(); - } - - 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 SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -166,7 +113,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"); } @@ -187,77 +134,13 @@ public MsixPackage refresh(Context context) { return this; } - public MsixPackageImpl withImagePath(String imagePath) { - this.innerModel().withImagePath(imagePath); - return this; - } - - public MsixPackageImpl withPackageName(String packageName) { - this.innerModel().withPackageName(packageName); + public MsixPackageImpl withProperties(MsixPackageProperties properties) { + this.innerModel().withProperties(properties); return this; } - public MsixPackageImpl withPackageFamilyName(String packageFamilyName) { - this.innerModel().withPackageFamilyName(packageFamilyName); - return this; - } - - public MsixPackageImpl withDisplayName(String displayName) { - if (isInCreateMode()) { - this.innerModel().withDisplayName(displayName); - return this; - } else { - this.updateMsixPackage.withDisplayName(displayName); - return this; - } - } - - public MsixPackageImpl withPackageRelativePath(String packageRelativePath) { - this.innerModel().withPackageRelativePath(packageRelativePath); + public MsixPackageImpl withProperties(MsixPackagePatchProperties properties) { + this.updateMsixPackage.withProperties(properties); return this; } - - public MsixPackageImpl withIsRegularRegistration(Boolean isRegularRegistration) { - if (isInCreateMode()) { - this.innerModel().withIsRegularRegistration(isRegularRegistration); - return this; - } else { - this.updateMsixPackage.withIsRegularRegistration(isRegularRegistration); - return this; - } - } - - public MsixPackageImpl withIsActive(Boolean isActive) { - if (isInCreateMode()) { - this.innerModel().withIsActive(isActive); - return this; - } else { - this.updateMsixPackage.withIsActive(isActive); - return this; - } - } - - public MsixPackageImpl withPackageDependencies(List packageDependencies) { - this.innerModel().withPackageDependencies(packageDependencies); - return this; - } - - public MsixPackageImpl withVersion(String version) { - this.innerModel().withVersion(version); - return this; - } - - public MsixPackageImpl withLastUpdated(OffsetDateTime lastUpdated) { - this.innerModel().withLastUpdated(lastUpdated); - return this; - } - - public MsixPackageImpl withPackageApplications(List packageApplications) { - this.innerModel().withPackageApplications(packageApplications); - 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/MsixPackagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java index 6cd7c1455566..ebea46e2b6d5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; -import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.MSIXPackageList; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; import reactor.core.publisher.Mono; @@ -47,73 +47,119 @@ public final class MsixPackagesClientImpl implements MsixPackagesClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of MsixPackagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - MsixPackagesClientImpl(DesktopVirtualizationApiClientImpl client) { + MsixPackagesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(MsixPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientMsixPackages to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientMsixPackages to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientMsixPackages") 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/{msixPackageFullName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("msixPackageFullName") String msixPackageFullName, - @BodyParam("application/json") MsixPackageInner msixPackage, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackageInner msixPackage, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/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) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackageInner msixPackage, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackagePatch msixPackage, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackagePatch msixPackage, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("msixPackageFullName") String msixPackageFullName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/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> update(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("msixPackageFullName") String msixPackageFullName, - @BodyParam("application/json") MsixPackagePatch msixPackage, @HeaderParam("Accept") String accept, - Context context); + @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") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") 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, @@ -123,8 +169,15 @@ Mono> list(@HostParam("$host") String endpoint, @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); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -141,25 +194,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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(), @@ -167,46 +201,6 @@ public Mono> getWithResponseAsync(String resourceGrou .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Get a msixpackage. * @@ -239,7 +233,9 @@ public Mono getAsync(String resourceGroupName, String hostPool @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { - return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, accept, context); } /** @@ -273,85 +269,15 @@ public MsixPackageInner get(String resourceGroupName, String hostPoolName, Strin @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (msixPackageFullName == null) { - 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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, contentType, + accept, msixPackage, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 schema for MSIX Package properties 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) { - 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 (msixPackageFullName == null) { - 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); - } - /** * Create or update a MSIX package. * @@ -387,8 +313,11 @@ public Mono createOrUpdateAsync(String resourceGroupName, Stri @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, contentType, accept, + msixPackage, context); } /** @@ -411,226 +340,112 @@ public MsixPackageInner createOrUpdate(String resourceGroupName, String hostPool } /** - * Remove an MSIX Package. + * Update 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 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 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) { - 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 (msixPackageFullName == null) { - return Mono - .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage) { + final String contentType = "application/json"; 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, contentType, + accept, msixPackage, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String 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.")); - } - 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 (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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, msixPackageFullName, accept, context); - } - - /** - * Remove an MSIX Package. + * Update 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 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 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 updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage) { + return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove an MSIX Package. + * Update 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 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. * @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 updateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, contentType, accept, + msixPackage, context); } /** - * Remove an MSIX Package. + * Update 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 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 void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE); + public MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackagePatch msixPackage) { + return updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, Context.NONE) + .getValue(); } /** - * Update an MSIX Package. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackagePatch msixPackage) { - 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 (msixPackageFullName == null) { - return Mono - .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); - } - if (msixPackage != null) { - msixPackage.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, - accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackagePatch msixPackage, 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 (msixPackageFullName == null) { - return Mono - .error(new IllegalArgumentException("Parameter msixPackageFullName is required and cannot be null.")); - } - if (msixPackage != null) { - msixPackage.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, msixPackageFullName, msixPackage, accept, context); - } - - /** - * Update an MSIX Package. + * 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. @@ -638,38 +453,35 @@ private Mono> updateWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String hostPoolName, - String msixPackageFullName) { - final MsixPackagePatch msixPackage = null; - return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName) + .flatMap(ignored -> Mono.empty()); } /** - * Update an MSIX Package. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String hostPoolName, - String msixPackageFullName, MsixPackagePatch msixPackage, Context context) { - return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, context) - .block(); + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, context); } /** - * Update an MSIX Package. + * 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. @@ -677,13 +489,10 @@ public Response updateWithResponse(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 schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MsixPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName) { - final MsixPackagePatch msixPackage = null; - return updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, Context.NONE) - .getValue(); + public void delete(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE); } /** @@ -697,26 +506,12 @@ public MsixPackageInner update(String resourceGroupName, String hostPoolName, 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 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> 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.")); - } - 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.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -735,37 +530,17 @@ private Mono> listSinglePageAsync(String resourc * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 - .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)); + @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)); } /** @@ -773,17 +548,16 @@ private Mono> listSinglePageAsync(String resourc * * @param resourceGroupName The 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}. + * @return list of MSIX Package definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip) { + 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)); @@ -794,19 +568,23 @@ public PagedFlux listAsync(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 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}. + * @return list of MSIX Package definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -821,14 +599,17 @@ public PagedFlux listAsync(String resourceGroupName, String ho * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of MSIX Package definitions along with {@link PagedResponse}. */ - @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 PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -839,14 +620,16 @@ private PagedFlux listAsync(String resourceGroupName, String h * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -861,13 +644,14 @@ 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 as paginated response with {@link PagedIterable}. + * @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)); + () -> listSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -877,17 +661,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -895,6 +673,23 @@ private Mono> listNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of MSIX Package definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -903,21 +698,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..0728e932b24c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, String ho String msixPackageFullName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MsixPackageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MsixPackageImpl(inner.getValue(), this.manager())); } public MsixPackage get(String resourceGroupName, String hostPoolName, String msixPackageFullName) { @@ -70,10 +66,10 @@ public PagedIterable list(String resourceGroupName, String hostPool } 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 +85,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 +104,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 +123,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..54e5155d2056 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -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.implementation.models.ResourceProviderOperationListResult; import reactor.core.publisher.Mono; /** @@ -42,56 +42,67 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(DesktopVirtualizationApiClientImpl client) { + OperationsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientOperations to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DesktopVirtualization/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.DesktopVirtualization/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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() { - 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( @@ -102,79 +113,78 @@ 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 as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * 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 along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List 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 along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List 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() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * 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) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -184,18 +194,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -203,6 +206,24 @@ private Mono> listNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -211,23 +232,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java index 0fa3ba55ab1a..049c0b3f0850 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java index 3b04ddc4c882..f0d4161082f8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java @@ -1,17 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.util.Collections; -import java.util.List; public final class PrivateEndpointConnectionWithSystemDataImpl implements PrivateEndpointConnectionWithSystemData { private PrivateEndpointConnectionWithSystemDataInner innerObject; @@ -36,29 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public List groupIds() { - List inner = this.innerModel().groupIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PrivateEndpoint privateEndpoint() { - return this.innerModel().privateEndpoint(); - } - - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerModel().privateLinkServiceConnectionState(); + public PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); } - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public PrivateEndpointConnectionWithSystemDataInner innerModel() { 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..962461d65120 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -30,8 +30,7 @@ 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.PrivateEndpointConnectionListResultWithSystemData; import reactor.core.publisher.Mono; /** @@ -46,530 +45,438 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateEndpointConnectionsClientImpl(DesktopVirtualizationApiClientImpl client) { + PrivateEndpointConnectionsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientPrivateEndpointConnections to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientPrivateEndpointConnections") 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/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspace( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> getByHostPool( + @HostParam("endpoint") 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" }) - @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, + Response getByHostPoolSync(@HostParam("endpoint") 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 }) @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateByWorkspace( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Response updateByHostPoolSync( + @HostParam("endpoint") 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, - @BodyParam("application/json") PrivateEndpointConnection connection, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteByHostPool(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteByHostPoolSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPool( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") 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}/privateEndpointConnections/{privateEndpointConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByHostPool(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Response listByHostPoolSync( + @HostParam("endpoint") 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/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByWorkspace( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByWorkspaceSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateByWorkspace( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateByWorkspaceSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionWithSystemDataInner connection, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByHostPool(@HostParam("$host") String endpoint, + Mono> deleteByWorkspace(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteByWorkspaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("endpoint") 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" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateByHostPool( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Response listByWorkspaceSync( + @HostParam("endpoint") 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); + @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> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByWorkspaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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 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 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 Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } + public Mono> getByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { final String accept = "application/json"; return FluxUtil - .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)) + .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())); } /** - * 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. + * @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 list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a PrivateEndpointConnectionWithSystemData on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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 - .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. - * - * @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 private endpoint connection associated with the specified storage account 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 Mono getByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName) { + return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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 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 list of private endpoint connection associated with the specified storage account 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)); - } - - /** - * List private endpoint connections. - * - * @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 private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + 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 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 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. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { + return getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE) + .getValue(); } /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 private endpoint connection along with {@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> 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.")); - } - 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 (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.")); - } + public Mono> updateByHostPoolWithResponseAsync( + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + final String contentType = "application/json"; 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.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, + contentType, accept, connection, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a private endpoint connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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.")); - } - 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, - context); - } - - /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 private endpoint connection on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName) { - return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 a private endpoint connection along with {@link Response}. + * @return the Private Endpoint Connection resource 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) - .block(); + public Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, + contentType, accept, connection, context); } /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 private endpoint connection. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { - return getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) - .getValue(); + public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + Context.NONE).getValue(); } /** - * Remove a 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 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 {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + 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.")); - } - 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 (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.")); - } - 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.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if 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> 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.")); - } - 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 (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.")); - } - 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); - } - - /** - * Remove a 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 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, + public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) .flatMap(ignored -> Mono.empty()); } /** - * Remove a 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 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. @@ -577,189 +484,25 @@ public Mono deleteByWorkspaceAsync(String resourceGroupName, String worksp * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { - return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - context).block(); - } - - /** - * Remove a connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 deleteByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName) { - deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); + return service.deleteByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - 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 (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.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())); - } - - /** - * Approve or reject a private endpoint connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, 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 (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.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, accept, context); - } - - /** - * Approve or reject a private endpoint connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByWorkspaceAsync(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Approve or reject a private endpoint connection. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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) - public Response updateByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, Context context) { - return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, - connection, context).block(); - } - - /** - * Approve or reject a private endpoint connection. - * - * @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); } /** @@ -773,27 +516,12 @@ public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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(), @@ -813,54 +541,11 @@ private Mono> listBy * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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, 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 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}. + * @return list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByHostPoolAsync(String resourceGroupName, @@ -878,8 +563,8 @@ public PagedFlux listByHostPoolAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByHostPoolAsync(String resourceGroupName, @@ -892,6 +577,31 @@ public PagedFlux listByHostPoolAsy nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } + /** + * 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 HostPool along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage( + String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + hostPoolName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List private endpoint connections associated with hostpool. * @@ -904,14 +614,19 @@ public PagedFlux listByHostPoolAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage( + String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + hostPoolName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -922,8 +637,8 @@ private PagedFlux listByHostPoolAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHostPool(String resourceGroupName, @@ -932,7 +647,8 @@ public PagedIterable listByHostPoo final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + () -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePage(nextLink)); } /** @@ -947,268 +663,231 @@ public PagedIterable listByHostPoo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of private endpoint connection associated with the specified HostPool 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)); + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePage(nextLink, 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) { - 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 (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } + public Mono> getByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName) { + return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } + public Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { 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.getByWorkspaceSync(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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByHostPoolAsync(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName) { - return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + return getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); } /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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 context The context to associate with this operation. + * @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 private endpoint connection along with {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context) { - return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, context) - .block(); + public Mono> updateByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + contentType, accept, connection, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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 private endpoint connection. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName) { - return getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE) - .getValue(); + 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. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } + public Response updateByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context) { + final String contentType = "application/json"; 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateByWorkspaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + contentType, accept, connection, context); } /** - * Remove a connection. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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 context The context to associate with this operation. + * @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 PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection) { + return updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, Context.NONE).getValue(); + } + + /** + * 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 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 {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - 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); + public Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + return FluxUtil + .withContext(context -> service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove a 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 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, + public Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) + return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(ignored -> Mono.empty()); } /** - * Remove a 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 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. @@ -1216,188 +895,150 @@ public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoo * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, - context).block(); + return service.deleteByWorkspaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, context); } /** - * Remove a 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 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE); + public void deleteByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); } /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - 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 (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(); - } + private Mono> + listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName) { 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.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)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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 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 the Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, - PrivateEndpointConnection connection, 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 (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); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. */ @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())); + private PagedResponse + listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. */ @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(); + private PagedResponse + listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection) { - return updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); + } + + /** + * List private endpoint connections associated with 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 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 HostPool as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -1407,28 +1048,40 @@ 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) { - 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.")); - } + listByHostPoolNextSinglePageAsync(String nextLink) { 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())); } + /** + * 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 private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1437,24 +1090,17 @@ 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 - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByWorkspaceNextSinglePageAsync(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.")); - } + private PagedResponse listByHostPoolNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(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)); + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1464,28 +1110,40 @@ 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) { - 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.")); - } + listByWorkspaceNextSinglePageAsync(String nextLink) { 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())); } + /** + * 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 private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1494,23 +1152,16 @@ 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 - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified HostPool along with + * {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, + Context context) { 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)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..71d7db896f09 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -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,38 +27,18 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName) { - PagedIterable inner - = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); - 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); - 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); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } - 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,35 +46,20 @@ 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(), - new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } - 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,6 +67,16 @@ public PrivateEndpointConnectionWithSystemData updateByWorkspace(String resource } } + 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 listByHostPool(String resourceGroupName, String hostPoolName) { PagedIterable inner @@ -119,22 +93,18 @@ public PagedIterable listByHostPool(Str 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); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } - 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,34 +112,20 @@ 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(), - new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } - 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 +133,33 @@ 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); + } + + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + 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); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); + } + 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..7470294230ff 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 @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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..c4780c602a78 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** @@ -42,33 +42,33 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateLinkResourcesClientImpl(DesktopVirtualizationApiClientImpl client) { + PrivateLinkResourcesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientPrivateLinkResources to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientPrivateLinkResources to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientPrivateLinkResources") 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("endpoint") 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); @@ -76,34 +76,70 @@ Mono> listByWorkspace(@HostParam("$host" @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool(@HostParam("$host") String endpoint, + Response listByHostPoolSync(@HostParam("endpoint") 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/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByWorkspaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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,27 +150,12 @@ Mono> listByHostPoolNext( * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { 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,93 +163,75 @@ 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of private link resources as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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 - .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)); + @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 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return a list of private link resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - final Integer pageSize = null; - final Boolean isDescending = null; - final Integer initialSkip = null; - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, accept, Context.NONE); + return 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. @@ -236,39 +239,44 @@ public PagedFlux listByWorkspaceAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return a list of private link resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, - isDescending, initialSkip, context), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, accept, context); + return 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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)); + () -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePage(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. @@ -279,17 +287,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)); + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePage(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. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -300,27 +308,12 @@ public PagedIterable listByWorkspace(String resourceGr * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.")); - } + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { 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,93 +321,75 @@ 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of private link resources as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>( + () -> 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 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 a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return a list of private link resources along with {@link PagedResponse}. */ - @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) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByWorkspaceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, pageSize, + isDescending, initialSkip, accept, Context.NONE); + return 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. @@ -422,39 +397,44 @@ public PagedFlux listByHostPoolAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return a list of private link resources along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res = service.listByWorkspaceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, pageSize, + isDescending, initialSkip, accept, context); + return 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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)); + () -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), + nextLink -> listByWorkspaceNextSinglePage(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. @@ -465,10 +445,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)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, pageSize, + isDescending, initialSkip, context), nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -482,22 +462,33 @@ public PagedIterable listByHostPool(String resourceGro * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(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.")); - } + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { 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())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -506,24 +497,15 @@ private Mono> listByWorkspaceNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of private link resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(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.")); - } + private PagedResponse listByHostPoolNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(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)); + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -537,22 +519,33 @@ private Mono> listByWorkspaceNextSingleP * {@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.")); - } + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { 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())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -561,23 +554,14 @@ private Mono> listByHostPoolNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of private link resources along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..1270b20875fd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -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/RegistrationInfoImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java index 0e857f9949b9..e903f8717ef4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java index 7e210f4a2a38..4d853bbb2193 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java @@ -1,14 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class RegistrationTokenListImpl implements RegistrationTokenList { private RegistrationTokenListInner innerObject; @@ -22,9 +24,11 @@ public final class RegistrationTokenListImpl implements RegistrationTokenList { } public List value() { - List inner = this.innerModel().value(); + List inner = this.innerModel().value(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new RegistrationTokenMinimalImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenMinimalImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenMinimalImpl.java new file mode 100644 index 000000000000..09cfcfe839db --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenMinimalImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import java.time.OffsetDateTime; + +public final class RegistrationTokenMinimalImpl implements RegistrationTokenMinimal { + private RegistrationTokenMinimalInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + RegistrationTokenMinimalImpl(RegistrationTokenMinimalInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime expirationTime() { + return this.innerModel().expirationTime(); + } + + public String token() { + return this.innerModel().token(); + } + + public RegistrationTokenMinimalInner 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/ResourceManagerUtils.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java index 4edabe20acd3..5c94c27a7a59 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java index 6c118650e835..fd75c62814b8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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..1896435adedb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -8,16 +8,14 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; -import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanProperties; +import com.azure.resourcemanager.desktopvirtualization.models.Sku; import java.util.Collections; -import java.util.List; import java.util.Map; public final class ScalingPlanImpl implements ScalingPlan, ScalingPlan.Definition, ScalingPlan.Update { @@ -50,74 +48,36 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); + public ScalingPlanProperties properties() { + return this.innerModel().properties(); } - 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public String timeZone() { - return this.innerModel().timeZone(); - } - - public ScalingHostPoolType hostPoolType() { - return this.innerModel().hostPoolType(); - } - - public String exclusionTag() { - return this.innerModel().exclusionTag(); - } - - public List schedules() { - List inner = this.innerModel().schedules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public Sku sku() { + return this.innerModel().sku(); } - public List hostPoolReferences() { - List inner = this.innerModel().hostPoolReferences(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -229,14 +189,9 @@ public ScalingPlanImpl withRegion(String location) { return this; } - public ScalingPlanImpl withTimeZone(String timeZone) { - if (isInCreateMode()) { - this.innerModel().withTimeZone(timeZone); - return this; - } else { - this.updateScalingPlan.withTimeZone(timeZone); - return this; - } + public ScalingPlanImpl withProperties(ScalingPlanProperties properties) { + this.innerModel().withProperties(properties); + return this; } public ScalingPlanImpl withTags(Map tags) { @@ -249,8 +204,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,77 +214,27 @@ public ScalingPlanImpl withKind(String kind) { return this; } - public ScalingPlanImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public ScalingPlanImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public ScalingPlanImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public ScalingPlanImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public ScalingPlanImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } - public ScalingPlanImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateScalingPlan.withDescription(description); - return this; - } - } - - public ScalingPlanImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateScalingPlan.withFriendlyName(friendlyName); - return this; - } - } - - public ScalingPlanImpl withHostPoolType(ScalingHostPoolType hostPoolType) { - this.innerModel().withHostPoolType(hostPoolType); + public ScalingPlanImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } - public ScalingPlanImpl withExclusionTag(String exclusionTag) { - if (isInCreateMode()) { - this.innerModel().withExclusionTag(exclusionTag); - return this; - } else { - this.updateScalingPlan.withExclusionTag(exclusionTag); - return this; - } - } - - public ScalingPlanImpl withSchedules(List schedules) { - if (isInCreateMode()) { - this.innerModel().withSchedules(schedules); - return this; - } else { - this.updateScalingPlan.withSchedules(schedules); - return this; - } - } - - public ScalingPlanImpl withHostPoolReferences(List hostPoolReferences) { - if (isInCreateMode()) { - this.innerModel().withHostPoolReferences(hostPoolReferences); - return this; - } else { - this.updateScalingPlan.withHostPoolReferences(hostPoolReferences); - return this; - } + public ScalingPlanImpl withProperties(ScalingPlanPatchProperties properties) { + this.updateScalingPlan.withProperties(properties); + return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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..c1ad78e379ee 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 @@ -1,21 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -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.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.Collections; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleProperties; public final class ScalingPlanPersonalScheduleImpl implements ScalingPlanPersonalSchedule, ScalingPlanPersonalSchedule.Definition, ScalingPlanPersonalSchedule.Update { @@ -35,117 +30,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public List daysOfWeek() { - List inner = this.innerModel().daysOfWeek(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Time rampUpStartTime() { - return this.innerModel().rampUpStartTime(); - } - - public StartupBehavior rampUpAutoStartHosts() { - return this.innerModel().rampUpAutoStartHosts(); - } - - public SetStartVMOnConnect rampUpStartVMOnConnect() { - return this.innerModel().rampUpStartVMOnConnect(); - } - - public SessionHandlingOperation rampUpActionOnDisconnect() { - return this.innerModel().rampUpActionOnDisconnect(); - } - - public Integer rampUpMinutesToWaitOnDisconnect() { - return this.innerModel().rampUpMinutesToWaitOnDisconnect(); + public ScalingPlanPersonalScheduleProperties properties() { + return this.innerModel().properties(); } - public SessionHandlingOperation rampUpActionOnLogoff() { - return this.innerModel().rampUpActionOnLogoff(); - } - - public Integer rampUpMinutesToWaitOnLogoff() { - return this.innerModel().rampUpMinutesToWaitOnLogoff(); - } - - public Time peakStartTime() { - return this.innerModel().peakStartTime(); - } - - public SetStartVMOnConnect peakStartVMOnConnect() { - return this.innerModel().peakStartVMOnConnect(); - } - - public SessionHandlingOperation peakActionOnDisconnect() { - return this.innerModel().peakActionOnDisconnect(); - } - - public Integer peakMinutesToWaitOnDisconnect() { - return this.innerModel().peakMinutesToWaitOnDisconnect(); - } - - public SessionHandlingOperation peakActionOnLogoff() { - return this.innerModel().peakActionOnLogoff(); - } - - public Integer peakMinutesToWaitOnLogoff() { - return this.innerModel().peakMinutesToWaitOnLogoff(); - } - - public Time rampDownStartTime() { - return this.innerModel().rampDownStartTime(); - } - - public SetStartVMOnConnect rampDownStartVMOnConnect() { - return this.innerModel().rampDownStartVMOnConnect(); - } - - public SessionHandlingOperation rampDownActionOnDisconnect() { - return this.innerModel().rampDownActionOnDisconnect(); - } - - public Integer rampDownMinutesToWaitOnDisconnect() { - return this.innerModel().rampDownMinutesToWaitOnDisconnect(); - } - - public SessionHandlingOperation rampDownActionOnLogoff() { - return this.innerModel().rampDownActionOnLogoff(); - } - - public Integer rampDownMinutesToWaitOnLogoff() { - return this.innerModel().rampDownMinutesToWaitOnLogoff(); - } - - public Time offPeakStartTime() { - return this.innerModel().offPeakStartTime(); - } - - public SetStartVMOnConnect offPeakStartVMOnConnect() { - return this.innerModel().offPeakStartVMOnConnect(); - } - - public SessionHandlingOperation offPeakActionOnDisconnect() { - return this.innerModel().offPeakActionOnDisconnect(); - } - - public Integer offPeakMinutesToWaitOnDisconnect() { - return this.innerModel().offPeakMinutesToWaitOnDisconnect(); - } - - public SessionHandlingOperation offPeakActionOnLogoff() { - return this.innerModel().offPeakActionOnLogoff(); - } - - public Integer offPeakMinutesToWaitOnLogoff() { - return this.innerModel().offPeakMinutesToWaitOnLogoff(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -246,273 +136,13 @@ public ScalingPlanPersonalSchedule refresh(Context context) { return this; } - public ScalingPlanPersonalScheduleImpl withDaysOfWeek(List daysOfWeek) { - if (isInCreateMode()) { - this.innerModel().withDaysOfWeek(daysOfWeek); - return this; - } else { - this.updateScalingPlanSchedule.withDaysOfWeek(daysOfWeek); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampUpStartTime(Time rampUpStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartTime(rampUpStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpStartTime(rampUpStartTime); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) { - if (isInCreateMode()) { - this.innerModel().withRampUpAutoStartHosts(rampUpAutoStartHosts); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpAutoStartHosts(rampUpAutoStartHosts); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartVMOnConnect(rampUpStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpStartVMOnConnect(rampUpStartVMOnConnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpActionOnDisconnect(rampUpActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpActionOnDisconnect(rampUpActionOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampUpActionOnLogoff(rampUpActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.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; - } - } - - public ScalingPlanPersonalScheduleImpl withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withPeakStartVMOnConnect(peakStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartVMOnConnect(peakStartVMOnConnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withPeakActionOnDisconnect(peakActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakActionOnDisconnect(peakActionOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withPeakActionOnLogoff(peakActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.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; - } - } - - public ScalingPlanPersonalScheduleImpl withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartVMOnConnect(rampDownStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartVMOnConnect(rampDownStartVMOnConnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownActionOnDisconnect(rampDownActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownActionOnDisconnect(rampDownActionOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withRampDownActionOnLogoff(rampDownActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.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; - } - } - - public ScalingPlanPersonalScheduleImpl withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakStartVMOnConnect(offPeakStartVMOnConnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl - withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { - if (isInCreateMode()) { - this.innerModel().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withOffPeakActionOnLogoff(offPeakActionOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakActionOnLogoff(offPeakActionOnLogoff); - return this; - } - } - - public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { - if (isInCreateMode()) { - this.innerModel().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff); - return this; - } + public ScalingPlanPersonalScheduleImpl withProperties(ScalingPlanPersonalScheduleProperties properties) { + this.innerModel().withProperties(properties); + 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..64dacbcba8f0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanPersonalScheduleList; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch; import reactor.core.publisher.Mono; @@ -47,31 +47,31 @@ public final class ScalingPlanPersonalSchedulesClientImpl implements ScalingPlan /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of ScalingPlanPersonalSchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ScalingPlanPersonalSchedulesClientImpl(DesktopVirtualizationApiClientImpl client) { + ScalingPlanPersonalSchedulesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(ScalingPlanPersonalSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientScalingPlanPersonalSchedules to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientScalingPlanPersonalSchedules to + * be used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientScalingPlanPersonalSchedules") public interface ScalingPlanPersonalSchedulesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @@ -79,45 +79,96 @@ Mono> get(@HostParam("$host") String Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, + Mono> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({ 200, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") 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); + @BodyParam("application/json") ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @BodyParam("application/json") ScalingPlanPersonalSchedulePatch scalingPlanSchedule, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, @@ -129,7 +180,15 @@ Mono> list(@HostParam("$host") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -147,26 +206,6 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (scalingPlanName == null) { - 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(), @@ -175,47 +214,6 @@ public Mono> getWithResponseAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (scalingPlanName == null) { - 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); - } - /** * Get a ScalingPlanPersonalSchedule. * @@ -249,7 +247,9 @@ public Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** @@ -285,90 +285,15 @@ public ScalingPlanPersonalScheduleInner get(String resourceGroupName, String sca @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } + final String contentType = "application/json"; 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)) + contentType, accept, scalingPlanSchedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 represents a ScalingPlanPersonalSchedule definition 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) { - 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 (scalingPlanName == null) { - 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.")); - } - 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); - } - /** * Create or update a ScalingPlanPersonalSchedule. * @@ -405,8 +330,11 @@ public Mono createAsync(String resourceGroupNa public Response createWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, contentType, + accept, scalingPlanSchedule, context); } /** @@ -429,90 +357,31 @@ public ScalingPlanPersonalScheduleInner create(String resourceGroupName, String } /** - * Remove a ScalingPlanPersonalSchedule. + * 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 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}. + * @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) { - 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 (scalingPlanName == null) { - 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.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, - context)) + scalingPlanSchedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String 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.")); - } - 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 (scalingPlanName == null) { - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); - } - - /** - * Remove a ScalingPlanPersonalSchedule. + * Update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -520,34 +389,41 @@ 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 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 updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a ScalingPlanPersonalSchedule. + * 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 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}. + * @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 updateWithResponse(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, + Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + scalingPlanSchedule, context); } /** - * Remove a ScalingPlanPersonalSchedule. + * Update a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -555,108 +431,38 @@ public Response deleteWithResponse(String resourceGroupName, String scalin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** - * Update a ScalingPlanPersonalSchedule. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule) { - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule != null) { - scalingPlanSchedule.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, - scalingPlanSchedule, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule != null) { - scalingPlanSchedule.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, scalingPlanScheduleName, scalingPlanSchedule, accept, context); - } - - /** - * Update a ScalingPlanPersonalSchedule. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -664,39 +470,35 @@ private Mono> updateWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) + .flatMap(ignored -> Mono.empty()); } /** - * Update a ScalingPlanPersonalSchedule. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, - Context context) { - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - context).block(); + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } /** - * Update a ScalingPlanPersonalSchedule. + * Remove a ScalingPlanPersonalSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -704,14 +506,10 @@ public Response updateWithResponse(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 represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; - return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - Context.NONE).getValue(); + public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } /** @@ -725,28 +523,12 @@ public ScalingPlanPersonalScheduleInner update(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 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> 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.")); - } - 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 (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.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -765,39 +547,17 @@ private Mono> listSinglePageAsyn * @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 scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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 - .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)); + @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)); } /** @@ -805,17 +565,16 @@ private Mono> listSinglePageAsyn * * @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}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)); @@ -826,19 +585,23 @@ public PagedFlux listAsync(String resourceGrou * * @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}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -853,14 +616,17 @@ public PagedFlux listAsync(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 scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -871,14 +637,16 @@ private PagedFlux listAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -893,13 +661,14 @@ 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 as paginated response with {@link PagedIterable}. + * @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)); + () -> listSinglePage(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -909,18 +678,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -928,6 +690,24 @@ private Mono> listNextSinglePage .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPersonalSchedule definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -936,23 +716,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..a56406f79d1a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGrou String scalingPlanScheduleName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScalingPlanPersonalScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScalingPlanPersonalScheduleImpl(inner.getValue(), this.manager())); } public ScalingPlanPersonalSchedule get(String resourceGroupName, String scalingPlanName, 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..13cf058a3169 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 @@ -1,20 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; 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.Collections; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; public final class ScalingPlanPooledScheduleImpl implements ScalingPlanPooledSchedule, ScalingPlanPooledSchedule.Definition, ScalingPlanPooledSchedule.Update { @@ -34,81 +30,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public List daysOfWeek() { - List inner = this.innerModel().daysOfWeek(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Time rampUpStartTime() { - return this.innerModel().rampUpStartTime(); - } - - public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { - return this.innerModel().rampUpLoadBalancingAlgorithm(); - } - - public Integer rampUpMinimumHostsPct() { - return this.innerModel().rampUpMinimumHostsPct(); - } - - public Integer rampUpCapacityThresholdPct() { - return this.innerModel().rampUpCapacityThresholdPct(); - } - - public Time peakStartTime() { - return this.innerModel().peakStartTime(); - } - - public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { - return this.innerModel().peakLoadBalancingAlgorithm(); - } - - public Time rampDownStartTime() { - return this.innerModel().rampDownStartTime(); + public ScalingPlanPooledScheduleProperties properties() { + return this.innerModel().properties(); } - public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { - return this.innerModel().rampDownLoadBalancingAlgorithm(); - } - - public Integer rampDownMinimumHostsPct() { - return this.innerModel().rampDownMinimumHostsPct(); - } - - public Integer rampDownCapacityThresholdPct() { - return this.innerModel().rampDownCapacityThresholdPct(); - } - - public Boolean rampDownForceLogoffUsers() { - return this.innerModel().rampDownForceLogoffUsers(); - } - - public StopHostsWhen rampDownStopHostsWhen() { - return this.innerModel().rampDownStopHostsWhen(); - } - - public Integer rampDownWaitTimeMinutes() { - return this.innerModel().rampDownWaitTimeMinutes(); - } - - public String rampDownNotificationMessage() { - return this.innerModel().rampDownNotificationMessage(); - } - - public Time offPeakStartTime() { - return this.innerModel().offPeakStartTime(); - } - - public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { - return this.innerModel().offPeakLoadBalancingAlgorithm(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -209,181 +136,13 @@ public ScalingPlanPooledSchedule refresh(Context context) { return this; } - public ScalingPlanPooledScheduleImpl withDaysOfWeek(List daysOfWeek) { - if (isInCreateMode()) { - this.innerModel().withDaysOfWeek(daysOfWeek); - return this; - } else { - this.updateScalingPlanSchedule.withDaysOfWeek(daysOfWeek); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampUpStartTime(Time rampUpStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampUpStartTime(rampUpStartTime); - return this; - } else { - this.updateScalingPlanSchedule.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 withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { - if (isInCreateMode()) { - this.innerModel().withRampUpMinimumHostsPct(rampUpMinimumHostsPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpMinimumHostsPct(rampUpMinimumHostsPct); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { - if (isInCreateMode()) { - this.innerModel().withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampUpCapacityThresholdPct(rampUpCapacityThresholdPct); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { - if (isInCreateMode()) { - this.innerModel().withPeakStartTime(peakStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime); - return this; - } - } - - public ScalingPlanPooledScheduleImpl - withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTime) { - if (isInCreateMode()) { - this.innerModel().withRampDownStartTime(rampDownStartTime); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime); - return this; - } - } - - public ScalingPlanPooledScheduleImpl - withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { - if (isInCreateMode()) { - this.innerModel().withRampDownMinimumHostsPct(rampDownMinimumHostsPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownMinimumHostsPct(rampDownMinimumHostsPct); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { - if (isInCreateMode()) { - this.innerModel().withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownCapacityThresholdPct(rampDownCapacityThresholdPct); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { - if (isInCreateMode()) { - this.innerModel().withRampDownForceLogoffUsers(rampDownForceLogoffUsers); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownForceLogoffUsers(rampDownForceLogoffUsers); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { - if (isInCreateMode()) { - this.innerModel().withRampDownStopHostsWhen(rampDownStopHostsWhen); - return this; - } else { - this.updateScalingPlanSchedule.withRampDownStopHostsWhen(rampDownStopHostsWhen); - return this; - } - } - - public ScalingPlanPooledScheduleImpl withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { - if (isInCreateMode()) { - this.innerModel().withRampDownWaitTimeMinutes(rampDownWaitTimeMinutes); - return this; - } else { - this.updateScalingPlanSchedule.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; - } - } - - public ScalingPlanPooledScheduleImpl - withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { - if (isInCreateMode()) { - this.innerModel().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); - return this; - } else { - this.updateScalingPlanSchedule.withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); - return this; - } + public ScalingPlanPooledScheduleImpl withProperties(ScalingPlanPooledScheduleProperties properties) { + this.innerModel().withProperties(properties); + 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..005bf262bfb3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanPooledScheduleList; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; import reactor.core.publisher.Mono; @@ -47,31 +47,31 @@ public final class ScalingPlanPooledSchedulesClientImpl implements ScalingPlanPo /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of ScalingPlanPooledSchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ScalingPlanPooledSchedulesClientImpl(DesktopVirtualizationApiClientImpl client) { + ScalingPlanPooledSchedulesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(ScalingPlanPooledSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientScalingPlanPooledSchedules to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientScalingPlanPooledSchedules to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientScalingPlanPooledSchedules") public interface ScalingPlanPooledSchedulesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @@ -79,45 +79,96 @@ Mono> get(@HostParam("$host") String en Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, + Mono> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @BodyParam("application/json") ScalingPlanPooledScheduleInner scalingPlanSchedule, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({ 200, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") 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); + @BodyParam("application/json") ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @BodyParam("application/json") ScalingPlanPooledSchedulePatch scalingPlanSchedule, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, @@ -129,7 +180,15 @@ Mono> list(@HostParam("$host") String en @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -147,26 +206,6 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (scalingPlanName == null) { - 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(), @@ -175,47 +214,6 @@ public Mono> getWithResponseAsync(Strin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (scalingPlanName == null) { - 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); - } - /** * Get a ScalingPlanPooledSchedule. * @@ -249,7 +247,9 @@ public Mono getAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** @@ -285,90 +285,15 @@ public ScalingPlanPooledScheduleInner get(String resourceGroupName, String scali @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null.")); - } else { - scalingPlanSchedule.validate(); - } + final String contentType = "application/json"; 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)) + contentType, accept, scalingPlanSchedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 represents a ScalingPlanPooledSchedule definition 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) { - 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 (scalingPlanName == null) { - 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.")); - } - 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); - } - /** * Create or update a ScalingPlanPooledSchedule. * @@ -404,8 +329,11 @@ public Mono createAsync(String resourceGroupName @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, contentType, + accept, scalingPlanSchedule, context); } /** @@ -428,90 +356,31 @@ public ScalingPlanPooledScheduleInner create(String resourceGroupName, String sc } /** - * Remove a ScalingPlanPooledSchedule. + * 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 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}. + * @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) { - 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 (scalingPlanName == null) { - 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.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, - context)) + scalingPlanSchedule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String 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.")); - } - 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 (scalingPlanName == null) { - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); - } - - /** - * Remove a ScalingPlanPooledSchedule. + * Update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -519,34 +388,40 @@ 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 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 updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a ScalingPlanPooledSchedule. + * 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 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}. + * @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 updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + scalingPlanSchedule, context); } /** - * Remove a ScalingPlanPooledSchedule. + * Update a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -554,108 +429,38 @@ public Response deleteWithResponse(String resourceGroupName, String scalin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** - * Update a ScalingPlanPooledSchedule. + * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule) { - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule != null) { - scalingPlanSchedule.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, - scalingPlanSchedule, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, - 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 (scalingPlanName == null) { - 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.")); - } - if (scalingPlanSchedule != null) { - scalingPlanSchedule.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, scalingPlanScheduleName, scalingPlanSchedule, accept, context); - } - - /** - * Update a ScalingPlanPooledSchedule. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -663,38 +468,35 @@ private Mono> updateWithResponseAsync(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 represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) + .flatMap(ignored -> Mono.empty()); } /** - * Update a ScalingPlanPooledSchedule. + * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context) { - return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - context).block(); + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } /** - * Update a ScalingPlanPooledSchedule. + * Remove a ScalingPlanPooledSchedule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. @@ -702,14 +504,10 @@ public Response updateWithResponse(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPlanName, - String scalingPlanScheduleName) { - final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; - return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, - Context.NONE).getValue(); + public void delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } /** @@ -723,27 +521,12 @@ public ScalingPlanPooledScheduleInner update(String resourceGroupName, String sc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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 (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.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -762,38 +545,17 @@ private Mono> listSinglePageAsync( * @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 scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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 - .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)); + @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)); } /** @@ -801,17 +563,16 @@ private Mono> listSinglePageAsync( * * @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}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)); @@ -822,19 +583,23 @@ public PagedFlux listAsync(String resourceGroupN * * @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}. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -849,14 +614,17 @@ public PagedFlux listAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -867,14 +635,16 @@ private PagedFlux listAsync(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 scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -889,13 +659,14 @@ 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 as paginated response with {@link PagedIterable}. + * @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)); + () -> listSinglePage(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -905,17 +676,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -923,6 +688,24 @@ private Mono> listNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ScalingPlanPooledSchedule definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -931,22 +714,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..d78b8df08d91 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupN String scalingPlanScheduleName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScalingPlanPooledScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScalingPlanPooledScheduleImpl(inner.getValue(), this.manager())); } public ScalingPlanPooledSchedule get(String resourceGroupName, String scalingPlanName, 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..ced82bdd939b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanList; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; import reactor.core.publisher.Mono; @@ -47,73 +47,119 @@ public final class ScalingPlansClientImpl implements ScalingPlansClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of ScalingPlansClientImpl. * * @param client the instance of the service client containing this operation class. */ - ScalingPlansClientImpl(DesktopVirtualizationApiClientImpl client) { + ScalingPlansClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(ScalingPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientScalingPlans to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientScalingPlans to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientScalingPlans") public interface ScalingPlansService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, + Mono> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @BodyParam("application/json") ScalingPlanInner scalingPlan, @HeaderParam("Accept") String accept, + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScalingPlanInner scalingPlan, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScalingPlanInner scalingPlan, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({ 200, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") 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); + @BodyParam("application/json") ScalingPlanPatch scalingPlan, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @BodyParam("application/json") ScalingPlanPatch scalingPlan, @HeaderParam("Accept") String accept, - Context context); + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPatch scalingPlan, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("scalingPlanName") String scalingPlanName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") 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, @@ -123,7 +169,16 @@ Mono> listByResourceGroup(@HostParam("$host") String e @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.DesktopVirtualization/scalingPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); @@ -132,7 +187,17 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool(@HostParam("$host") String endpoint, + Mono> listByHostPool(@HostParam("endpoint") 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}/scalingPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolSync(@HostParam("endpoint") 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, @@ -143,7 +208,15 @@ Mono> listByHostPool(@HostParam("$host") String endpoi @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -151,7 +224,15 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -159,8 +240,15 @@ Mono> listBySubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -176,22 +264,6 @@ Mono> listByHostPoolNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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(), @@ -199,42 +271,6 @@ public Mono> getByResourceGroupWithResponseAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Get a scaling plan. * @@ -265,7 +301,9 @@ public Mono getByResourceGroupAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context); } /** @@ -292,36 +330,18 @@ public ScalingPlanInner getByResourceGroup(String resourceGroupName, String scal * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents a scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, contentType, accept, scalingPlan, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -331,52 +351,10 @@ public Mono> createWithResponseAsync(String resourceG * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlan, accept, context); - } - - /** - * 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 scalingPlan on successful completion of {@link Mono}. + * @return represents a scaling plan definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String resourceGroupName, String scalingPlanName, @@ -395,12 +373,16 @@ public Mono createAsync(String resourceGroupName, String scali * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents a scaling plan definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan, Context context) { - return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, contentType, accept, scalingPlan, + context); } /** @@ -412,7 +394,7 @@ public Response createWithResponse(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 scalingPlan. + * @return represents a scaling plan definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan) { @@ -420,250 +402,142 @@ public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, } /** - * Remove a scaling plan. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 scaling plan definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (scalingPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan) { 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, scalingPlan, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Remove 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, - 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 (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); - } - - /** - * Remove a scaling plan. + * 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 ManagementException 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 scaling plan definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String scalingPlanName) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName).flatMap(ignored -> Mono.empty()); + public Mono updateAsync(String resourceGroupName, String scalingPlanName) { + final ScalingPlanPatch scalingPlan = null; + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a scaling plan. + * 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 ManagementException thrown if 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 scaling plan definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context) { - return deleteWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); + public Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, scalingPlan, context); } /** - * Remove a scaling plan. + * 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 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 scaling plan definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String scalingPlanName) { - deleteWithResponse(resourceGroupName, scalingPlanName, Context.NONE); + public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) { + final ScalingPlanPatch scalingPlan = null; + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); } /** - * Update a scaling plan. + * Remove 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, scalingPlanName, scalingPlan, accept, context); - } - - /** - * Update a scaling plan. + * Remove 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 {@link Mono} that completes when a successful response is received. */ @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())); + public Mono deleteAsync(String resourceGroupName, String scalingPlanName) { + return deleteWithResponseAsync(resourceGroupName, scalingPlanName).flatMap(ignored -> Mono.empty()); } /** - * Update a scaling plan. + * Remove 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 the {@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 deleteWithResponse(String resourceGroupName, String scalingPlanName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, context); } /** - * Update a scaling plan. + * Remove 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) { - final ScalingPlanPatch scalingPlan = null; - return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlan, Context.NONE).getValue(); + public void delete(String resourceGroupName, String scalingPlanName) { + deleteWithResponse(resourceGroupName, scalingPlanName, Context.NONE); } /** @@ -676,23 +550,12 @@ public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -703,42 +566,6 @@ private Mono> listByResourceGroupSinglePageAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String 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. * @@ -749,7 +576,7 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, @@ -766,7 +593,7 @@ public PagedFlux listByResourceGroupAsync(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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -778,6 +605,29 @@ public PagedFlux listByResourceGroupAsync(String resourceGroup 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List scaling plans. * @@ -789,14 +639,17 @@ public PagedFlux listByResourceGroupAsync(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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return list of scaling plan definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -806,14 +659,16 @@ private PagedFlux listByResourceGroupAsync(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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -827,13 +682,14 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @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)); + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -845,19 +701,12 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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(), @@ -867,38 +716,6 @@ private Mono> listSinglePageAsync(Integer pageSi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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(), 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 in subscription. * @@ -908,7 +725,7 @@ private Mono> listSinglePageAsync(Integer pageSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { @@ -921,7 +738,7 @@ public PagedFlux listAsync(Integer pageSize, Boolean isDescend * * @throws 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 list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { @@ -932,6 +749,27 @@ public PagedFlux listAsync() { 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer pageSize, Boolean isDescending, + Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List scaling plans in subscription. * @@ -942,13 +780,16 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of scaling plan definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -956,14 +797,15 @@ private PagedFlux listAsync(Integer pageSize, Boolean isDescen * * @throws 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}. */ @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 new PagedIterable<>(() -> listSinglePage(pageSize, isDescending, initialSkip), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** @@ -976,12 +818,13 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); + return new PagedIterable<>(() -> listSinglePage(pageSize, isDescending, initialSkip, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -995,26 +838,12 @@ public PagedIterable list(Integer pageSize, Boolean isDescendi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - 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(), @@ -1033,37 +862,17 @@ private Mono> listByHostPoolSinglePageAsync(Stri * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @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)); } /** @@ -1071,17 +880,16 @@ 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 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}. + * @return list of scaling plan definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)); @@ -1092,19 +900,23 @@ 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 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}. + * @return list of scaling plan definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1119,13 +931,17 @@ 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 scalingPlanList as paginated response with {@link PagedFlux}. + * @return list of scaling plan definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(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)); + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1136,7 +952,7 @@ private 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 scalingPlanList as paginated response with {@link PagedIterable}. + * @return list of scaling plan definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { @@ -1144,7 +960,8 @@ public PagedIterable listByHostPool(String resourceGroupName, final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip)); + () -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), + nextLink -> listByHostPoolNextSinglePage(nextLink)); } /** @@ -1159,13 +976,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 scalingPlanList as paginated response with {@link PagedIterable}. + * @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)); + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePage(nextLink, context)); } /** @@ -1175,17 +992,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) { - 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( @@ -1195,6 +1006,24 @@ private Mono> listByResourceGroupNextSinglePageA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1203,23 +1032,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1229,17 +1050,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) { - 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( @@ -1249,6 +1064,24 @@ private Mono> listBySubscriptionNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1257,23 +1090,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1283,17 +1108,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) { - 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)) @@ -1302,6 +1121,24 @@ private Mono> listByHostPoolNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scaling plan definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1310,21 +1147,14 @@ 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}. */ @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.")); - } + private PagedResponse listByHostPoolNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..152db15581e5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getByResourceGroupWithResponse(String resourceGroup Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScalingPlanImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScalingPlanImpl(inner.getValue(), this.manager())); } public ScalingPlan getByResourceGroup(String resourceGroupName, String scalingPlanName) { 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..bc9eb27eda9d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfiguration; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationProperties; + +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 SessionHostConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..22ea50601caf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java @@ -0,0 +1,827 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import com.azure.resourcemanager.desktopvirtualization.implementation.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 DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of SessionHostConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostConfigurationsClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(SessionHostConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientSessionHostConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientSessionHostConfigurations") + public interface SessionHostConfigurationsService { + @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("endpoint") 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) + Response getSync(@HostParam("endpoint") 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" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostConfigurationPatch sessionHostConfiguration, 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) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostConfigurationPatch sessionHostConfiguration, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostConfigurationInner sessionHostConfiguration, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostConfigurationInner sessionHostConfiguration, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 ManagementException 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + final String accept = "application/json"; + return service.getSync(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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostConfigurationInner get(String resourceGroupName, String hostPoolName) { + return getWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, sessionHostConfiguration, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, sessionHostConfiguration, + Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, sessionHostConfiguration, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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) { + Response response = updateWithResponse(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(response, + SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, Context.NONE); + } + + /** + * 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; + Response response = updateWithResponse(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(response, + SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, Context.NONE); + } + + /** + * 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) { + Response response + = updateWithResponse(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + return this.client.getLroResult(response, + 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 beginUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration).getFinalResult(); + } + + /** + * 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 beginUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration, context).getFinalResult(); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, + sessionHostConfiguration, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, + sessionHostConfiguration, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + SessionHostConfigurationInner sessionHostConfiguration, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, + sessionHostConfiguration, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hostPoolName, sessionHostConfiguration); + return this.client.getLroResult(response, + SessionHostConfigurationInner.class, SessionHostConfigurationInner.class, Context.NONE); + } + + /** + * 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + return this.client.getLroResult(response, + 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 beginCreateOrUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration).getFinalResult(); + } + + /** + * 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 beginCreateOrUpdate(resourceGroupName, hostPoolName, sessionHostConfiguration, context).getFinalResult(); + } + + /** + * 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName, Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostConfiguration definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostConfiguration definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/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..7760330f6808 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostConfigurationImpl(inner.getValue(), this.manager())); + } + + 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 update(String resourceGroupName, String hostPoolName) { + SessionHostConfigurationInner inner = this.serviceClient().update(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostConfiguration update(String resourceGroupName, String hostPoolName, + SessionHostConfigurationPatch sessionHostConfiguration, Context context) { + SessionHostConfigurationInner inner + = this.serviceClient().update(resourceGroupName, hostPoolName, sessionHostConfiguration, context); + if (inner != null) { + return new SessionHostConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public 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 PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostConfigurationImpl(inner1, this.manager())); + } + + private SessionHostConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java index 70d75a4b9d9f..f2aeb19ac9bb 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 @@ -1,30 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHost; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport; -import com.azure.resourcemanager.desktopvirtualization.models.Status; -import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class SessionHostImpl implements SessionHost { +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProperties; + +public final class SessionHostImpl implements SessionHost, SessionHost.Definition, SessionHost.Update { private SessionHostInner innerObject; private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - SessionHostImpl(SessionHostInner innerObject, - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -37,88 +33,147 @@ public String type() { return this.innerModel().type(); } + public SessionHostProperties properties() { + return this.innerModel().properties(); + } + public SystemData systemData() { return this.innerModel().systemData(); } - public String objectId() { - return this.innerModel().objectId(); + public String resourceGroupName() { + return resourceGroupName; } - public OffsetDateTime lastHeartBeat() { - return this.innerModel().lastHeartBeat(); + public SessionHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; } - public Integer sessions() { - return this.innerModel().sessions(); + private String resourceGroupName; + + private String hostPoolName; + + private String sessionHostName; + + private Boolean updateForce; + + private SessionHostPatch updateSessionHost; + + public SessionHostImpl withExistingHostPool(String resourceGroupName, String hostPoolName) { + this.resourceGroupName = resourceGroupName; + this.hostPoolName = hostPoolName; + return this; } - public String agentVersion() { - return this.innerModel().agentVersion(); + public SessionHost create() { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .createWithResponse(resourceGroupName, hostPoolName, sessionHostName, this.innerModel(), Context.NONE) + .getValue(); + return this; } - public Boolean allowNewSession() { - return this.innerModel().allowNewSession(); + public SessionHost create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .createWithResponse(resourceGroupName, hostPoolName, sessionHostName, this.innerModel(), context) + .getValue(); + return this; } - public String virtualMachineId() { - return this.innerModel().virtualMachineId(); + SessionHostImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = new SessionHostInner(); + this.serviceManager = serviceManager; + this.sessionHostName = name; } - public String resourceId() { - return this.innerModel().resourceId(); + public SessionHostImpl update() { + this.updateForce = null; + this.updateSessionHost = new SessionHostPatch(); + return this; } - public String assignedUser() { - return this.innerModel().assignedUser(); + public SessionHost apply() { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .updateWithResponse(resourceGroupName, hostPoolName, sessionHostName, updateForce, updateSessionHost, + Context.NONE) + .getValue(); + return this; } - public String friendlyName() { - return this.innerModel().friendlyName(); + public SessionHost apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .updateWithResponse(resourceGroupName, hostPoolName, sessionHostName, updateForce, updateSessionHost, + context) + .getValue(); + return this; } - public Status status() { - return this.innerModel().status(); + SessionHostImpl(SessionHostInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hostPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hostPools"); + this.sessionHostName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sessionHosts"); } - public OffsetDateTime statusTimestamp() { - return this.innerModel().statusTimestamp(); + public SessionHost refresh() { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .getWithResponse(resourceGroupName, hostPoolName, sessionHostName, Context.NONE) + .getValue(); + return this; } - public String osVersion() { - return this.innerModel().osVersion(); + public SessionHost refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSessionHosts() + .getWithResponse(resourceGroupName, hostPoolName, sessionHostName, context) + .getValue(); + return this; } - public String sxSStackVersion() { - return this.innerModel().sxSStackVersion(); + public Response retryProvisioningWithResponse(Context context) { + return serviceManager.sessionHosts() + .retryProvisioningWithResponse(resourceGroupName, hostPoolName, sessionHostName, context); } - public UpdateState updateState() { - return this.innerModel().updateState(); + public void retryProvisioning() { + serviceManager.sessionHosts().retryProvisioning(resourceGroupName, hostPoolName, sessionHostName); } - public OffsetDateTime lastUpdateTime() { - return this.innerModel().lastUpdateTime(); + public PagedIterable + listSingleSessionHostRegistrationTokens(ScopedRegistrationTokenProperties body) { + return serviceManager.sessionHosts() + .listSingleSessionHostRegistrationTokens(resourceGroupName, hostPoolName, sessionHostName, body); } - public String updateErrorMessage() { - return this.innerModel().updateErrorMessage(); + public PagedIterable + listSingleSessionHostRegistrationTokens(ScopedRegistrationTokenProperties body, Context context) { + return serviceManager.sessionHosts() + .listSingleSessionHostRegistrationTokens(resourceGroupName, hostPoolName, sessionHostName, body, context); } - public List sessionHostHealthCheckResults() { - List inner = this.innerModel().sessionHostHealthCheckResults(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SessionHostImpl withProperties(SessionHostProperties properties) { + this.innerModel().withProperties(properties); + return this; } - public SessionHostInner innerModel() { - return this.innerObject; + public SessionHostImpl withProperties(SessionHostPatchProperties properties) { + this.updateSessionHost.withProperties(properties); + return this; } - private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { - return this.serviceManager; + public SessionHostImpl withForce(Boolean force) { + this.updateForce = force; + return this; } } 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..7cb52ed0cf86 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; + +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 SessionHostManagementProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + 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/SessionHostManagementProvisioningStatusImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusImpl.java new file mode 100644 index 000000000000..b5df2e322028 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatusProperties; +import java.time.OffsetDateTime; + +public final class SessionHostManagementProvisioningStatusImpl implements SessionHostManagementProvisioningStatus { + private SessionHostManagementProvisioningStatusInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostManagementProvisioningStatusImpl(SessionHostManagementProvisioningStatusInner 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 SessionHostManagementProvisioningOperationStatus status() { + return this.innerModel().status(); + } + + public SessionHostManagementProvisioningStatusProperties properties() { + SessionHostManagementProvisioningStatusPropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new SessionHostManagementProvisioningStatusPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public SessionHostManagementProvisioningStatusInner 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/SessionHostManagementProvisioningStatusPropertiesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusPropertiesImpl.java new file mode 100644 index 000000000000..474648457189 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusPropertiesImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationProgress; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatusProperties; +import java.time.OffsetDateTime; + +public final class SessionHostManagementProvisioningStatusPropertiesImpl + implements SessionHostManagementProvisioningStatusProperties { + private SessionHostManagementProvisioningStatusPropertiesInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + SessionHostManagementProvisioningStatusPropertiesImpl( + SessionHostManagementProvisioningStatusPropertiesInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String correlationId() { + return this.innerModel().correlationId(); + } + + public SessionHostManagementProvisioningOperationProgress 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 SessionHostManagementProvisioningStatusPropertiesInner 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/SessionHostManagementProvisioningStatusesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesClientImpl.java new file mode 100644 index 000000000000..e55a324518f1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesClientImpl.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SessionHostManagementProvisioningStatusesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SessionHostManagementProvisioningStatusesClient. + */ +public final class SessionHostManagementProvisioningStatusesClientImpl + implements SessionHostManagementProvisioningStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostManagementProvisioningStatusesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of SessionHostManagementProvisioningStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostManagementProvisioningStatusesClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(SessionHostManagementProvisioningStatusesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * DesktopVirtualizationManagementClientSessionHostManagementProvisioningStatuses to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientSessionHostManagementProvisioningStatuses") + public interface SessionHostManagementProvisioningStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostProvisioningStatuses/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("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/sessionHostProvisioningStatuses/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName) { + return getWithResponseAsync(resourceGroupName, hostPoolName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String hostPoolName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, accept, context); + } + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementProvisioningStatusInner 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/SessionHostManagementProvisioningStatusesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesImpl.java new file mode 100644 index 000000000000..868a4ffb9926 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostManagementProvisioningStatusesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningStatuses; + +public final class SessionHostManagementProvisioningStatusesImpl implements SessionHostManagementProvisioningStatuses { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementProvisioningStatusesImpl.class); + + private final SessionHostManagementProvisioningStatusesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostManagementProvisioningStatusesImpl(SessionHostManagementProvisioningStatusesClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementProvisioningStatusImpl(inner.getValue(), this.manager())); + } + + public SessionHostManagementProvisioningStatus get(String resourceGroupName, String hostPoolName) { + SessionHostManagementProvisioningStatusInner inner = this.serviceClient().get(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostManagementProvisioningStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private SessionHostManagementProvisioningStatusesClient 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/SessionHostManagementUpdateStatusImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java new file mode 100644 index 000000000000..e273b690575f --- /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) TypeSpec 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.SessionHostManagementUpdateStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatusProperties; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateStatus; +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 UpdateStatus 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..71bdd3cc5f84 --- /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) TypeSpec 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/SessionHostManagementUpdateStatusesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesClientImpl.java new file mode 100644 index 000000000000..341336983956 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostManagementUpdateStatusesClient; +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 SessionHostManagementUpdateStatusesClient. + */ +public final class SessionHostManagementUpdateStatusesClientImpl implements SessionHostManagementUpdateStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SessionHostManagementUpdateStatusesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of SessionHostManagementUpdateStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostManagementUpdateStatusesClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(SessionHostManagementUpdateStatusesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * DesktopVirtualizationManagementClientSessionHostManagementUpdateStatuses to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientSessionHostManagementUpdateStatuses") + public interface SessionHostManagementUpdateStatusesService { + @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("endpoint") 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/sessionHostUpdateStatuses/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + final String accept = "application/json"; + return service.getSync(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. + */ + @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/SessionHostManagementUpdateStatusesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesImpl.java new file mode 100644 index 000000000000..17501a176e25 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.SessionHostManagementUpdateStatusesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatus; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementUpdateStatuses; + +public final class SessionHostManagementUpdateStatusesImpl implements SessionHostManagementUpdateStatuses { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementUpdateStatusesImpl.class); + + private final SessionHostManagementUpdateStatusesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostManagementUpdateStatusesImpl(SessionHostManagementUpdateStatusesClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementUpdateStatusImpl(inner.getValue(), this.manager())); + } + + 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 SessionHostManagementUpdateStatusesClient 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/SessionHostManagementsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java new file mode 100644 index 000000000000..0790091614b3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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 DesktopVirtualizationManagementClientImpl client; + + /** + * Initializes an instance of SessionHostManagementsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SessionHostManagementsClientImpl(DesktopVirtualizationManagementClientImpl client) { + this.service = RestProxy.create(SessionHostManagementsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationManagementClientSessionHostManagements to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientSessionHostManagements") + public interface SessionHostManagementsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") 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) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostManagementInner sessionHostManagement, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostManagementInner sessionHostManagement, 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostManagementPatch sessionHostManagement, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionHostManagementPatch sessionHostManagement, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostPool(@HostParam("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByHostPoolNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String hostPoolName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + final String accept = "application/json"; + return service.getSync(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. + */ + @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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, + sessionHostManagement, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, contentType, accept, + sessionHostManagement, 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. + */ + @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) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, sessionHostManagement, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, sessionHostManagement, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionHostManagementInner update(String resourceGroupName, String hostPoolName) { + final SessionHostManagementPatch sessionHostManagement = null; + return updateWithResponse(resourceGroupName, hostPoolName, sessionHostManagement, Context.NONE).getValue(); + } + + /** + * List SessionHostManagements. + * + * @param resourceGroupName 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) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, + String hostPoolName, Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName), + nextLink -> listByHostPoolNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, context), + nextLink -> listByHostPoolNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostManagement definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHostManagement definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/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..c6acd58eb967 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagements; + +public final class SessionHostManagementsImpl implements SessionHostManagements { + private static final ClientLogger LOGGER = new ClientLogger(SessionHostManagementsImpl.class); + + private final SessionHostManagementsClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public SessionHostManagementsImpl(SessionHostManagementsClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } + + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } + + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostManagementImpl(inner.getValue(), this.manager())); + } + + public SessionHostManagement update(String resourceGroupName, String hostPoolName) { + SessionHostManagementInner inner = this.serviceClient().update(resourceGroupName, hostPoolName); + if (inner != null) { + return new SessionHostManagementImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostManagementImpl(inner1, this.manager())); + } + + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Context context) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostManagementImpl(inner1, this.manager())); + } + + private SessionHostManagementsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java index b9a03129f802..4a9a5123cf45 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -14,6 +14,8 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -29,8 +31,11 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostList; +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; import reactor.core.publisher.Mono; @@ -46,73 +51,181 @@ public final class SessionHostsClientImpl implements SessionHostsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of SessionHostsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SessionHostsClientImpl(DesktopVirtualizationApiClientImpl client) { + SessionHostsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(SessionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientSessionHosts to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientSessionHosts to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientSessionHosts") public interface SessionHostsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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, + @PathParam("sessionHostName") String sessionHostName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @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}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") 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, @BodyParam("application/json") SessionHostPatch sessionHost, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") 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, @BodyParam("application/json") SessionHostPatch sessionHost, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") 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, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") 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, @QueryParam("force") Boolean force, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/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> update(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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, - @BodyParam("application/json") SessionHostPatch sessionHost, @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" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); + @QueryParam("initialSkip") Integer initialSkip, @QueryParam("vmPath") String vmPath, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SessionHostInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SessionHostInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> retryProvisioning(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retryProvisioningSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/listSingleSessionHostRegistrationTokens") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSingleSessionHostRegistrationTokens( + @HostParam("endpoint") 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, + @BodyParam("application/json") ScopedRegistrationTokenProperties body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/listSingleSessionHostRegistrationTokens") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSingleSessionHostRegistrationTokensSync( + @HostParam("endpoint") 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, + @BodyParam("application/json") ScopedRegistrationTokenProperties body, 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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -120,7 +233,7 @@ 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 sessionHostname The name of the session host within the specified host pool. + * @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. @@ -128,30 +241,11 @@ Mono> listNext(@PathParam(value = "nextLink", encoded */ @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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.")); - } + String sessionHostName) { 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)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -160,39 +254,36 @@ public Mono> getWithResponseAsync(String resourceGrou * * @param resourceGroupName The 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 a session host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.")); - } + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostName, Context context) { 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.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostName, accept, context); } /** @@ -200,90 +291,100 @@ private Mono> getWithResponseAsync(String resourceGro * * @param resourceGroupName The 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 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 on successful completion of {@link Mono}. + * @return a session host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostName) { + return getWithResponse(resourceGroupName, hostPoolName, sessionHostName, Context.NONE).getValue(); } /** - * Get a session host. + * 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 context The context to associate with this operation. + * @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 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 a session host along with {@link Response}. + * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String hostPoolName, - String sessionHostname, Context context) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, Boolean force, SessionHostPatch sessionHost) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, force, accept, + sessionHost, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a session host. + * 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 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 represents a SessionHost definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostname) { - return getWithResponse(resourceGroupName, hostPoolName, sessionHostname, Context.NONE).getValue(); + public Mono updateAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + final Boolean force = null; + final SessionHostPatch sessionHost = null; + return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, force, sessionHost) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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 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 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}. + * @return represents a SessionHost definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.")); - } + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostName, Boolean force, SessionHostPatch sessionHost, Context context) { 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, force, accept, + sessionHost, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostName) { + final Boolean force = null; + final SessionHostPatch sessionHost = null; + return updateWithResponse(resourceGroupName, hostPoolName, sessionHostName, force, sessionHost, Context.NONE) + .getValue(); } /** @@ -291,40 +392,20 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * * @param resourceGroupName The 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, sessionHostname, force, accept, context); + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, Boolean force) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, force, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -332,16 +413,16 @@ private Mono> deleteWithResponseAsync(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 sessionHostname The name of the session host within the specified host pool. + * @param sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { final Boolean force = null; - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force) + return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, force) .flatMap(ignored -> Mono.empty()); } @@ -350,7 +431,7 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, 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 sessionHostname The name of the session host within the specified host pool. + * @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. @@ -359,9 +440,10 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, Str * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Boolean force, Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, force, context); } /** @@ -369,135 +451,233 @@ public Response deleteWithResponse(String resourceGroupName, String hostPo * * @param resourceGroupName The 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 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) { + public void delete(String resourceGroupName, String hostPoolName, String sessionHostName) { final Boolean force = null; - deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, Context.NONE); + deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, force, Context.NONE); } /** - * Update 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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost 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 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 represents a SessionHost definition 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> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force, SessionHostPatch sessionHost) { - 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.")); - } - if (sessionHost != null) { - sessionHost.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, String vmPath) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, - 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())); } /** - * Update 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 force Force flag to update assign, unassign or reassign personal desktop. - * @param sessionHost Object containing SessionHost 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 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 list of SessionHost definitions as paginated response with {@link PagedFlux}. + */ + @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)); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, String vmPath) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, String vmPath, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 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) { + final Integer pageSize = null; + final Boolean isDescending = null; + final Integer initialSkip = null; + final String vmPath = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath), + nextLink -> listNextSinglePage(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 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<>( + () -> listSinglePage(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * create or update 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 resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force, SessionHostPatch sessionHost, 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.")); - } - if (sessionHost != null) { - sessionHost.validate(); - } + public Mono> createWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, SessionHostInner resource) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, accept, context); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a session host. + * create or update 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 sessionHostName The name of the session host within the specified host pool. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a SessionHost definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String hostPoolName, String sessionHostname) { - final Boolean force = null; - final SessionHostPatch sessionHost = null; - return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost) + public Mono createAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + SessionHostInner resource) { + return createWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, resource) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update a session host. + * create or update 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 sessionHostName The name of the session host within the specified host pool. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -505,213 +685,235 @@ public Mono updateAsync(String resourceGroupName, String hostP * @return represents a SessionHost definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String hostPoolName, - String sessionHostname, Boolean force, SessionHostPatch sessionHost, Context context) { - return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, context) - .block(); + public Response createWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostName, SessionHostInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, contentType, accept, + resource, context); } /** - * Update a session host. + * create or update 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 sessionHostName The name of the session host within the specified host pool. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a SessionHost definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostname) { - final Boolean force = null; - final SessionHostPatch sessionHost = null; - return updateWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, Context.NONE) - .getValue(); + public SessionHostInner create(String resourceGroupName, String hostPoolName, String sessionHostName, + SessionHostInner resource) { + return createWithResponse(resourceGroupName, hostPoolName, sessionHostName, resource, Context.NONE).getValue(); } /** - * List sessionHosts. + * Retry provisioning on a SessionHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. - * @param 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 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) { - 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"; + public Mono> retryProvisioningWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName) { 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.retryProvisioning(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List sessionHosts. + * Retry provisioning on a SessionHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. - * @param 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retryProvisioningAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + return retryProvisioningWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.")); - } + public Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostName, Context context) { + return service.retryProvisioningSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, context); + } + + /** + * Retry provisioning on a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostName) { + retryProvisioningWithResponse(resourceGroupName, hostPoolName, sessionHostName, Context.NONE); + } + + /** + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 list of RegistrationToken definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSingleSessionHostRegistrationTokensSinglePageAsync( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body) { 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 FluxUtil + .withContext(context -> service.listSingleSessionHostRegistrationTokens(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, + sessionHostName, accept, body, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedFlux}. + * @return list of RegistrationToken definitions 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)); + public PagedFlux listSingleSessionHostRegistrationTokensAsync( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body) { + return new PagedFlux<>(() -> listSingleSessionHostRegistrationTokensSinglePageAsync(resourceGroupName, + hostPoolName, sessionHostName, body)); } /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedFlux}. + * @return list of RegistrationToken definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSingleSessionHostRegistrationTokensSinglePage( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body) { + final String accept = "application/json"; + Response res = service.listSingleSessionHostRegistrationTokensSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + hostPoolName, sessionHostName, accept, body, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedFlux}. + * @return list of RegistrationToken definitions along with {@link PagedResponse}. */ - @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 PagedResponse listSingleSessionHostRegistrationTokensSinglePage( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body, + Context context) { + final String accept = "application/json"; + Response res = service.listSingleSessionHostRegistrationTokensSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + hostPoolName, sessionHostName, accept, body, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedIterable}. + * @return list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ @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)); + public PagedIterable listSingleSessionHostRegistrationTokens( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body) { + return new PagedIterable<>(() -> listSingleSessionHostRegistrationTokensSinglePage(resourceGroupName, + hostPoolName, sessionHostName, body)); } /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedIterable}. + * @return list of RegistrationToken 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)); + public PagedIterable listSingleSessionHostRegistrationTokens( + String resourceGroupName, String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body, + Context context) { + return new PagedIterable<>(() -> listSingleSessionHostRegistrationTokensSinglePage(resourceGroupName, + hostPoolName, sessionHostName, body, context)); } /** @@ -721,17 +923,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -739,6 +935,23 @@ private Mono> listNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SessionHost definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -747,21 +960,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..445270fe08cf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -10,9 +10,11 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHost; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; import com.azure.resourcemanager.desktopvirtualization.models.SessionHosts; public final class SessionHostsImpl implements SessionHosts { @@ -28,20 +30,16 @@ public SessionHostsImpl(SessionHostsClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, sessionHostname, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SessionHostImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, sessionHostName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionHostImpl(inner.getValue(), this.manager())); } - public SessionHost get(String resourceGroupName, String hostPoolName, String sessionHostname) { - SessionHostInner inner = this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostname); + public SessionHost get(String resourceGroupName, String hostPoolName, String sessionHostName) { + SessionHostInner inner = this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostName); if (inner != null) { return new SessionHostImpl(inner, this.manager()); } else { @@ -49,47 +47,127 @@ public SessionHost get(String resourceGroupName, String hostPoolName, String ses } } - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Boolean force, Context context) { return this.serviceClient() - .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, context); + .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, force, context); } - public void delete(String resourceGroupName, String hostPoolName, String sessionHostname) { - this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname); + 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() - .updateWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SessionHostImpl(inner.getValue(), this.manager())); - } else { - return null; + 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 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); + } + + public PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body) { + PagedIterable inner = this.serviceClient() + .listSingleSessionHostRegistrationTokens(resourceGroupName, hostPoolName, sessionHostName, body); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistrationTokenMinimalImpl(inner1, this.manager())); + } + + public PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body, Context context) { + PagedIterable inner = this.serviceClient() + .listSingleSessionHostRegistrationTokens(resourceGroupName, hostPoolName, sessionHostName, body, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistrationTokenMinimalImpl(inner1, this.manager())); + } + + public SessionHost getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); + if (hostPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } + String sessionHostName = ResourceManagerUtils.getValueFromIdByName(id, "sessionHosts"); + if (sessionHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionHosts'.", id))); + } + return this.getWithResponse(resourceGroupName, hostPoolName, sessionHostName, Context.NONE).getValue(); } - public SessionHost update(String resourceGroupName, String hostPoolName, String sessionHostname) { - SessionHostInner inner = this.serviceClient().update(resourceGroupName, hostPoolName, sessionHostname); - if (inner != null) { - return new SessionHostImpl(inner, this.manager()); - } else { - return null; + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); + if (hostPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } + String sessionHostName = ResourceManagerUtils.getValueFromIdByName(id, "sessionHosts"); + if (sessionHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionHosts'.", id))); + } + return this.getWithResponse(resourceGroupName, hostPoolName, sessionHostName, context); } - 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 void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); + if (hostPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + } + String sessionHostName = ResourceManagerUtils.getValueFromIdByName(id, "sessionHosts"); + if (sessionHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionHosts'.", id))); + } + Boolean localForce = null; + this.deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, localForce, Context.NONE); } - 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 Response deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); + if (hostPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + } + String sessionHostName = ResourceManagerUtils.getValueFromIdByName(id, "sessionHosts"); + if (sessionHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionHosts'.", id))); + } + return this.deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, force, context); } private SessionHostsClient serviceClient() { @@ -99,4 +177,8 @@ private SessionHostsClient serviceClient() { private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { return this.serviceManager; } + + public SessionHostImpl define(String name) { + return new SessionHostImpl(name, this.manager()); + } } 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..ff2dd357bdd4 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; 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..9794acd63ed5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.StartMenuItemList; import reactor.core.publisher.Mono; /** @@ -42,31 +42,42 @@ public final class StartMenuItemsClientImpl implements StartMenuItemsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of StartMenuItemsClientImpl. * * @param client the instance of the service client containing this operation class. */ - StartMenuItemsClientImpl(DesktopVirtualizationApiClientImpl client) { + StartMenuItemsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(StartMenuItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientStartMenuItems to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientStartMenuItems to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientStartMenuItems") public interface StartMenuItemsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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}/startMenuItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, @@ -78,7 +89,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -92,27 +110,12 @@ 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, 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.")); - } - 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 (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(), @@ -131,38 +134,17 @@ private Mono> listSinglePageAsync(String resou * @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 startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of StartMenuItem definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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(), - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @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)); } /** @@ -170,17 +152,16 @@ private Mono> listSinglePageAsync(String resou * * @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 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, - Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)); @@ -191,19 +172,23 @@ public PagedFlux listAsync(String resourceGroupName, String * * @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 startMenuItemList as paginated response with {@link PagedFlux}. + * @return list of StartMenuItem definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listSinglePage(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -218,13 +203,17 @@ 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 along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(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)); + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -235,7 +224,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) { @@ -243,7 +232,8 @@ public PagedIterable list(String resourceGroupName, String a final Boolean isDescending = null; final Integer initialSkip = null; return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -258,13 +248,14 @@ 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, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); + () -> listSinglePage(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -274,17 +265,11 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -292,6 +277,24 @@ private Mono> listNextSinglePageAsync(String n .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of StartMenuItem definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -300,21 +303,13 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java index e2482fd67aa8..006f910955e4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java index 0afac654868f..3888391c0fe1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java @@ -1,15 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.management.SystemData; 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.UserSession; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.desktopvirtualization.models.UserSessionProperties; public final class UserSessionImpl implements UserSession { private UserSessionInner innerObject; @@ -34,32 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String userPrincipalName() { - return this.innerModel().userPrincipalName(); - } - - public ApplicationType applicationType() { - return this.innerModel().applicationType(); - } - - public SessionState sessionState() { - return this.innerModel().sessionState(); + public UserSessionProperties properties() { + return this.innerModel().properties(); } - public String activeDirectoryUsername() { - return this.innerModel().activeDirectoryUsername(); - } - - public OffsetDateTime createTime() { - return this.innerModel().createTime(); + public SystemData systemData() { + return this.innerModel().systemData(); } public UserSessionInner innerModel() { 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..410f82f8e7f8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -30,8 +30,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.UserSessionList; import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -import com.azure.resourcemanager.desktopvirtualization.models.UserSessionList; import reactor.core.publisher.Mono; /** @@ -46,730 +46,608 @@ public final class UserSessionsClientImpl implements UserSessionsClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of UserSessionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - UserSessionsClientImpl(DesktopVirtualizationApiClientImpl client) { + UserSessionsClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(UserSessionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientUserSessions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientUserSessions to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientUserSessions") 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/{userSessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, + @QueryParam("force") Boolean force, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, - @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, + @QueryParam("force") Boolean force, 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, + Mono> list(@HostParam("endpoint") 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, + @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") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disconnect(@HostParam("$host") String endpoint, + Mono> listByHostPool(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @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" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> sendMessage(@HostParam("$host") String endpoint, + Response listByHostPoolSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, - @BodyParam("application/json") SendMessage sendMessage, @HeaderParam("Accept") String accept, + @QueryParam("$filter") String filter, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disconnect(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disconnectSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sendMessage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, + @BodyParam("application/json") SendMessage sendMessage, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response sendMessageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostName, @PathParam("userSessionId") String userSessionId, + @BodyParam("application/json") SendMessage sendMessage, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Response listByHostPoolNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List userSessions. + * Get 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 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 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a userSession along with {@link Response} 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) { - 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.")); - } + public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, String userSessionId) { 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)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(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. + * Get 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 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. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a userSession 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) { - 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, filter, 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 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 userSessionList as paginated response with {@link PagedFlux}. - */ - @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)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 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)); + public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId) { + return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List userSessions. + * Get 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 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 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 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 userSession along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostName, String userSessionId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostName, userSessionId, accept, context); } /** - * List userSessions. + * Get 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 PagedIterable}. + * @return a userSession. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId) { + return getWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, Context.NONE) + .getValue(); } /** - * List userSessions. + * Remove 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 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. + * @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 force Force flag to login off userSession. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, String userSessionId, Boolean force) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, force, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a userSession. + * Remove 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 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 a userSession along with {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(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.")); - } - 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.")); - } - 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.get(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())); + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force) + .flatMap(ignored -> Mono.empty()); } /** - * Get a userSession. + * Remove 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 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 force Force flag to login off userSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a userSession along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(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.")); - } - 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.")); - } - 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.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, context); + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Boolean force, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, force, + context); } /** - * Get a userSession. + * Remove 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 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 a userSession on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public void delete(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + final Boolean force = null; + deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force, Context.NONE); } /** - * Get a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param context The context to associate with this operation. + * @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 a userSession along with {@link Response}. + * @return list of UserSession definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, Context context) { - return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + String sessionHostName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @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 a userSession. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId) { - return getWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE) - .getValue(); + @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)); } /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. + * @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}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, Boolean force) { - 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.")); - } - 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @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)); } /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. - * @param context The context to associate with this operation. + * @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 the {@link Response} on successful completion of {@link Mono}. + * @return list of UserSession definitions along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, - String sessionHostname, String userSessionId, Boolean force, 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.")); - } - if (userSessionId == null) { - return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + String sessionHostName, Integer pageSize, Boolean isDescending, Integer initialSkip) { 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, userSessionId, force, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, pageSize, isDescending, + initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId) { - final Boolean force = null; - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force) - .flatMap(ignored -> Mono.empty()); + private PagedResponse listSinglePage(String resourceGroupName, String hostPoolName, + String sessionHostName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostName, pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. - * @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 ManagementException thrown if 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) - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Boolean force, Context context) { - return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, context) - .block(); + @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<>( + () -> listSinglePage(resourceGroupName, hostPoolName, sessionHostName, pageSize, isDescending, initialSkip), + nextLink -> listNextSinglePage(nextLink)); } /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { - final Boolean force = null; - deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, hostPoolName, sessionHostName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * List userSessions. + * 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 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 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> 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.")); - } - 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.")); - } + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { 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)) + .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())); } /** - * List userSessions. + * 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 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 userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of UserSession definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 - .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)); + @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)); } /** - * List userSessions. + * 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 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 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)); + 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)); } /** - * List userSessions. + * 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 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 userSessionList as paginated response with {@link PagedFlux}. + * @return list of UserSession definitions along with {@link PagedResponse}. */ - @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) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, String hostPoolName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, filter, + pageSize, isDescending, initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List userSessions. + * 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 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. @@ -777,41 +655,45 @@ public PagedFlux listAsync(String resourceGroupName, String ho * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolSinglePage(String resourceGroupName, String hostPoolName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + final String accept = "application/json"; + Response res = service.listByHostPoolSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, hostPoolName, filter, + pageSize, isDescending, initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List userSessions. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list(String resourceGroupName, String hostPoolName, String sessionHostname) { + 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<>( - listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip)); + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePage(nextLink)); } /** - * List userSessions. + * 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 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. @@ -819,13 +701,13 @@ 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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context)); + return new PagedIterable<>(() -> listByHostPoolSinglePage(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePage(nextLink, context)); } /** @@ -833,7 +715,7 @@ public PagedIterable list(String resourceGroupName, String hos * * @param resourceGroupName The 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 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. @@ -842,34 +724,11 @@ public PagedIterable list(String resourceGroupName, String hos */ @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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.")); - } - if (userSessionId == null) { - return Mono.error(new IllegalArgumentException("Parameter userSessionId is required and cannot be null.")); - } - final String accept = "application/json"; + String sessionHostName, String userSessionId) { return FluxUtil .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, - accept, context)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -878,52 +737,7 @@ public Mono> disconnectWithResponseAsync(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. - * @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 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) { - 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.")); - } - 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.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, - context); - } - - /** - * 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 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. @@ -931,9 +745,9 @@ 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 disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { - return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) + return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId) .flatMap(ignored -> Mono.empty()); } @@ -942,7 +756,7 @@ public Mono disconnectAsync(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 sessionHostname The name of the session host within the specified host pool. + * @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. @@ -951,10 +765,10 @@ public Mono disconnectAsync(String resourceGroupName, String hostPoolName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Context context) { - return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context) - .block(); + return service.disconnectSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, context); } /** @@ -962,16 +776,16 @@ public Response disconnectWithResponse(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 sessionHostname The name of the session host within the specified host pool. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { - disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE); + disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, Context.NONE); } /** @@ -979,9 +793,9 @@ public void disconnect(String resourceGroupName, String hostPoolName, String ses * * @param resourceGroupName The 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 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 sendMessage Represents message sent to a UserSession. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -989,37 +803,11 @@ public void disconnect(String resourceGroupName, String hostPoolName, String ses */ @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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.")); - } - 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"; + String sessionHostName, String userSessionId, SendMessage sendMessage) { return FluxUtil .withContext(context -> service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, + sendMessage, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1028,56 +816,7 @@ public Mono> sendMessageWithResponseAsync(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 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 ManagementException thrown if 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> 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.")); - } - 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.")); - } - 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); - } - - /** - * 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 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. @@ -1085,10 +824,10 @@ private Mono> sendMessageWithResponseAsync(String resourceGroupNa * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + public Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { final SendMessage sendMessage = null; - return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, + return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage).flatMap(ignored -> Mono.empty()); } @@ -1097,9 +836,9 @@ public Mono sendMessageAsync(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 sessionHostname The name of the session host within the specified host pool. + * @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 sendMessage Represents message sent to a UserSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1107,10 +846,11 @@ public Mono sendMessageAsync(String resourceGroupName, String hostPoolName * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage, Context context) { - return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, - sendMessage, context).block(); + return service.sendMessageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, + sendMessage, context); } /** @@ -1118,17 +858,17 @@ public Response sendMessageWithResponse(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 sessionHostname The name of the session host within the specified host pool. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, + public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { final SendMessage sendMessage = null; - sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, + sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage, Context.NONE); } @@ -1139,25 +879,35 @@ 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) { - 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.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { 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())); } + /** + * 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 UserSession definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1166,22 +916,14 @@ 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}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1191,24 +933,37 @@ 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) { - 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.")); - } + private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { 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())); } + /** + * 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 UserSession definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByHostPoolNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1217,21 +972,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByHostPoolNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByHostPoolNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/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..07a16538a685 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -28,34 +28,18 @@ public UserSessionsImpl(UserSessionsClient innerClient, this.serviceManager = serviceManager; } - 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())); - } - - public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Context context) { Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UserSessionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UserSessionImpl(inner.getValue(), this.manager())); } - public UserSession get(String resourceGroupName, String hostPoolName, String sessionHostname, + public UserSession get(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { UserSessionInner inner - = this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostname, userSessionId); + = this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostName, userSessionId); if (inner != null) { return new UserSessionImpl(inner, this.manager()); } else { @@ -63,50 +47,62 @@ public UserSession get(String resourceGroupName, String hostPoolName, String ses } } - public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Boolean force, Context context) { return this.serviceClient() - .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, context); + .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force, context); } - public void delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { - this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname, userSessionId); + public void delete(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostName, userSessionId); } - public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName) { PagedIterable inner - = this.serviceClient().list(resourceGroupName, hostPoolName, sessionHostname); + = 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 PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + 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() - .list(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context); + .listByHostPool(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Context context) { return this.serviceClient() - .disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context); + .disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, context); } - public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { - this.serviceClient().disconnect(resourceGroupName, hostPoolName, sessionHostname, userSessionId); + this.serviceClient().disconnect(resourceGroupName, hostPoolName, sessionHostName, userSessionId); } - public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage, Context context) { return this.serviceClient() - .sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, + .sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage, context); } - public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, + public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { - this.serviceClient().sendMessage(resourceGroupName, hostPoolName, sessionHostname, userSessionId); + this.serviceClient().sendMessage(resourceGroupName, hostPoolName, sessionHostName, userSessionId); } private UserSessionsClient serviceClient() { 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..090fd983da4d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -8,15 +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.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.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.Plan; +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 com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties; import java.util.Collections; -import java.util.List; import java.util.Map; public final class WorkspaceImpl implements Workspace, Workspace.Definition, Workspace.Update { @@ -49,70 +48,36 @@ public Map tags() { } } - public String managedBy() { - return this.innerModel().managedBy(); + public WorkspaceProperties properties() { + return this.innerModel().properties(); } - 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String objectId() { - return this.innerModel().objectId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String friendlyName() { - return this.innerModel().friendlyName(); - } - - public List applicationGroupReferences() { - List inner = this.innerModel().applicationGroupReferences(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean cloudPcResource() { - return this.innerModel().cloudPcResource(); - } - - public PublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); + public Sku sku() { + return this.innerModel().sku(); } - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -234,72 +199,42 @@ public WorkspaceImpl withTags(Map tags) { } } - public WorkspaceImpl withManagedBy(String managedBy) { - this.innerModel().withManagedBy(managedBy); + public WorkspaceImpl withProperties(WorkspaceProperties properties) { + this.innerModel().withProperties(properties); return this; } - public WorkspaceImpl withKind(String kind) { - this.innerModel().withKind(kind); + public WorkspaceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); return this; } - public WorkspaceImpl withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { - this.innerModel().withIdentity(identity); + public WorkspaceImpl withKind(String kind) { + this.innerModel().withKind(kind); return this; } - public WorkspaceImpl withSku(ResourceModelWithAllowedPropertySetSku sku) { - this.innerModel().withSku(sku); + public WorkspaceImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); return this; } - public WorkspaceImpl withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + public WorkspaceImpl withPlan(Plan plan) { this.innerModel().withPlan(plan); return this; } - public WorkspaceImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateWorkspace.withDescription(description); - return this; - } - } - - public WorkspaceImpl withFriendlyName(String friendlyName) { - if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); - return this; - } else { - this.updateWorkspace.withFriendlyName(friendlyName); - return this; - } - } - - public WorkspaceImpl withApplicationGroupReferences(List applicationGroupReferences) { - if (isInCreateMode()) { - this.innerModel().withApplicationGroupReferences(applicationGroupReferences); - return this; - } else { - this.updateWorkspace.withApplicationGroupReferences(applicationGroupReferences); - return this; - } + public WorkspaceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; } - public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (isInCreateMode()) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } else { - this.updateWorkspace.withPublicNetworkAccess(publicNetworkAccess); - return this; - } + public WorkspaceImpl withProperties(WorkspacePatchProperties properties) { + this.updateWorkspace.withProperties(properties); + return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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..a972101dd7fa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.desktopvirtualization.models.WorkspaceList; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.WorkspaceList; import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch; import reactor.core.publisher.Mono; @@ -47,69 +47,115 @@ public final class WorkspacesClientImpl implements WorkspacesClient { /** * The service client containing this operation class. */ - private final DesktopVirtualizationApiClientImpl client; + private final DesktopVirtualizationManagementClientImpl client; /** * Initializes an instance of WorkspacesClientImpl. * * @param client the instance of the service client containing this operation class. */ - WorkspacesClientImpl(DesktopVirtualizationApiClientImpl client) { + WorkspacesClientImpl(DesktopVirtualizationManagementClientImpl client) { this.service = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DesktopVirtualizationApiClientWorkspaces to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for DesktopVirtualizationManagementClientWorkspaces to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DesktopVirtualizatio") + @Host("{endpoint}") + @ServiceInterface(name = "DesktopVirtualizationManagementClientWorkspaces") public interface WorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceInner workspace, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceInner workspace, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceInner workspace, @HeaderParam("Accept") String accept, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WorkspacePatch workspace, Context context); @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WorkspacePatch workspace, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") 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); + Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspacePatch workspace, @HeaderParam("Accept") String accept, - Context context); + @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") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") 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, @@ -119,7 +165,15 @@ Mono> listByResourceGroup(@HostParam("$host") String end @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.DesktopVirtualization/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -128,7 +182,15 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -136,7 +198,15 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -153,21 +223,6 @@ Mono> listBySubscriptionNext( @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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(), @@ -175,41 +230,6 @@ public Mono> getByResourceGroupWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 ManagementException 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 (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); - } - /** * Get a workspace. * @@ -240,7 +260,9 @@ public Mono getByResourceGroupAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** @@ -272,74 +294,15 @@ public WorkspaceInner getByResourceGroup(String resourceGroupName, String worksp @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - 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 (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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, workspace, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 represents a Workspace definition 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) { - 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 (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); - } - /** * Create or update a workspace. * @@ -373,7 +336,10 @@ public Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, workspace, context); } /** @@ -393,246 +359,141 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN } /** - * Remove a 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 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}. + * @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) { - 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } + public Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspacePatch workspace) { 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, workspace, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - 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 (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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, accept, context); - } - - /** - * Remove a workspace. + * Update 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 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 updateAsync(String resourceGroupName, String workspaceName) { + final WorkspacePatch workspace = null; + return updateWithResponseAsync(resourceGroupName, workspaceName, workspace) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Remove a 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 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}. + * @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 updateWithResponse(String resourceGroupName, String workspaceName, + WorkspacePatch workspace, Context context) { + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, workspace, context); } /** - * Remove a workspace. + * Update 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 represents a Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName) { - deleteWithResponse(resourceGroupName, workspaceName, Context.NONE); + public WorkspaceInner update(String resourceGroupName, String workspaceName) { + final WorkspacePatch workspace = null; + return updateWithResponse(resourceGroupName, workspaceName, workspace, Context.NONE).getValue(); } /** - * Update a workspace. + * Remove 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspacePatch workspace) { - 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (workspace != null) { - workspace.validate(); - } - final String accept = "application/json"; + public Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspacePatch workspace, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (workspace != null) { - workspace.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, workspace, accept, context); - } - - /** - * Update a workspace. + * 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 represents a Workspace definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String workspaceName) { - final WorkspacePatch workspace = null; - return updateWithResponseAsync(resourceGroupName, workspaceName, workspace) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String workspaceName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName).flatMap(ignored -> Mono.empty()); } /** - * Update a workspace. + * Remove 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String workspaceName, - WorkspacePatch workspace, Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, context); } /** - * Update a workspace. + * 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 represents a Workspace definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update(String resourceGroupName, String workspaceName) { - final WorkspacePatch workspace = null; - return updateWithResponse(resourceGroupName, workspaceName, workspace, Context.NONE).getValue(); + public void delete(String resourceGroupName, String workspaceName) { + deleteWithResponse(resourceGroupName, workspaceName, Context.NONE); } /** @@ -645,23 +506,11 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -672,42 +521,6 @@ private Mono> listByResourceGroupSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String 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. * @@ -718,7 +531,7 @@ private Mono> listByResourceGroupSinglePageAsync(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 workspaceList as paginated response with {@link PagedFlux}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, @@ -735,7 +548,7 @@ public PagedFlux listByResourceGroupAsync(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 workspaceList as paginated response with {@link PagedFlux}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -747,6 +560,29 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNa 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List workspaces. * @@ -758,14 +594,17 @@ public PagedFlux listByResourceGroupAsync(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 workspaceList as paginated response with {@link PagedFlux}. + * @return list of Workspace definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, + initialSkip, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -775,14 +614,16 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @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)); + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -796,13 +637,14 @@ public PagedIterable listByResourceGroup(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 workspaceList as paginated response with {@link PagedIterable}. + * @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)); + () -> listByResourceGroupSinglePage(resourceGroupName, pageSize, isDescending, initialSkip, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -810,18 +652,10 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * * @throws 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> 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(), @@ -834,29 +668,14 @@ private Mono> listSinglePageAsync() { /** * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Workspace definitions as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** @@ -864,12 +683,15 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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 list of Workspace definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -879,12 +701,15 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Workspace definitions along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -892,11 +717,11 @@ private PagedFlux listAsync(Context context) { * * @throws 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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** @@ -906,11 +731,12 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -920,17 +746,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) { - 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( @@ -940,6 +759,24 @@ private Mono> listByResourceGroupNextSinglePageAsy .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -948,23 +785,15 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -974,17 +803,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) { - 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( @@ -994,6 +816,24 @@ private Mono> listBySubscriptionNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Workspace definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1002,22 +842,14 @@ 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } 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..15457698f689 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.implementation; @@ -31,12 +31,8 @@ public Response getByResourceGroupWithResponse(String resourceGroupNa Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WorkspaceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceImpl(inner.getValue(), this.manager())); } public Workspace getByResourceGroup(String resourceGroupName, String workspaceName) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ActiveSessionHostConfigurationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ActiveSessionHostConfigurationList.java new file mode 100644 index 000000000000..d878664bacd5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ActiveSessionHostConfigurationList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of ActiveSessionHostConfiguration definitions. + */ +@Immutable +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. + */ + private ActiveSessionHostConfigurationList() { + } + + /** + * Get the value property: The ActiveSessionHostConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/AppAttachPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/AppAttachPackageList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/AppAttachPackageList.java index 208512a65b36..19dcaa568a0e 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/implementation/models/AppAttachPackageList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * AppAttachPackageList - * * List of App Attach Package definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of AppAttachPackageList class. */ - public AppAttachPackageList() { + private 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,18 +44,7 @@ public List value() { } /** - * Set the value property: List of App Attach Package definitions. - * - * @param value the value value to set. - * @return the AppAttachPackageList object itself. - */ - public AppAttachPackageList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/ApplicationGroupList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationGroupList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationGroupList.java index d4b7297c2a71..ec799beaf217 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/implementation/models/ApplicationGroupList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ApplicationGroupList - * * List of ApplicationGroup definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of ApplicationGroupList class. */ - public ApplicationGroupList() { + private ApplicationGroupList() { } /** - * Get the value property: List of ApplicationGroup definitions. + * Get the value property: The ApplicationGroup items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of ApplicationGroup definitions. - * - * @param value the value value to set. - * @return the ApplicationGroupList object itself. - */ - public ApplicationGroupList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/ApplicationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationList.java index 92ec800a9eae..f7cdf49e634f 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/implementation/models/ApplicationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ApplicationList - * * List of Application definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of ApplicationList class. */ - public ApplicationList() { + private ApplicationList() { } /** - * Get the value property: List of Application definitions. + * Get the value property: The Application items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of Application definitions. - * - * @param value the value value to set. - * @return the ApplicationList object itself. - */ - public ApplicationList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/DesktopList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/DesktopList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/DesktopList.java index 80eb5ddd846a..ca08588bf653 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/implementation/models/DesktopList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * DesktopList - * * List of Desktop definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of DesktopList class. */ - public DesktopList() { + private DesktopList() { } /** - * Get the value property: List of Desktop definitions. + * Get the value property: The Desktop items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of Desktop definitions. - * - * @param value the value value to set. - * @return the DesktopList object itself. - */ - public DesktopList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/ExpandMsixImageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ExpandMsixImageList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ExpandMsixImageList.java index a6cfdf37f5f9..488170f94799 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/implementation/models/ExpandMsixImageList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ExpandMsixImageList - * * List of MSIX package properties retrieved from MSIX Image expansion. */ -@Fluent +@Immutable 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; /** * Creates an instance of ExpandMsixImageList class. */ - public ExpandMsixImageList() { + private 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,18 +44,7 @@ public List value() { } /** - * Set the value property: List of MSIX package properties from give MSIX Image. - * - * @param value the value value to set. - * @return the ExpandMsixImageList object itself. - */ - public ExpandMsixImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/models/HostPoolList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/HostPoolList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/HostPoolList.java index 16238b8f04aa..04a6fad46b6d 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/implementation/models/HostPoolList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * HostPoolList - * * List of HostPool definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of HostPoolList class. */ - public HostPoolList() { + private HostPoolList() { } /** - * Get the value property: List of HostPool definitions. + * Get the value property: The HostPool items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of HostPool definitions. - * - * @param value the value value to set. - * @return the HostPoolList object itself. - */ - public HostPoolList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/MsixPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/MSIXPackageList.java similarity index 54% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/MSIXPackageList.java index ab50d938508c..e7b2290fc2b7 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/implementation/models/MSIXPackageList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * MsixPackageList - * * List of MSIX Package definitions. */ -@Fluent -public final class MsixPackageList implements JsonSerializable { +@Immutable +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; /** - * Creates an instance of MsixPackageList class. + * Creates an instance of MSIXPackageList class. */ - public MsixPackageList() { + private 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,18 +44,7 @@ public List value() { } /** - * Set the value property: List of MSIX Package definitions. - * - * @param value the value value to set. - * @return the MsixPackageList object itself. - */ - public MsixPackageList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,35 +59,37 @@ 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(); } /** - * Reads an instance of MsixPackageList from the JsonReader. + * Reads an instance of MSIXPackageList from the JsonReader. * * @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 + * @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 IOException If an error occurs while reading the MsixPackageList. + * @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 { + public static MSIXPackageList fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MsixPackageList deserializedMsixPackageList = new MsixPackageList(); + MSIXPackageList deserializedMSIXPackageList = new MSIXPackageList(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> MsixPackageInner.fromJson(reader1)); - deserializedMsixPackageList.value = value; + deserializedMSIXPackageList.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedMsixPackageList.nextLink = reader.getString(); + deserializedMSIXPackageList.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedMsixPackageList; + return deserializedMSIXPackageList; }); } } 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/implementation/models/PrivateEndpointConnectionListResultWithSystemData.java similarity index 73% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/PrivateEndpointConnectionListResultWithSystemData.java index 93861715e483..262b7f2968b3 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/implementation/models/PrivateEndpointConnectionListResultWithSystemData.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,29 @@ 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 +@Immutable 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; /** * Creates an instance of PrivateEndpointConnectionListResultWithSystemData class. */ - public PrivateEndpointConnectionListResultWithSystemData() { + private 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,19 +45,7 @@ public List value() { } /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResultWithSystemData object itself. - */ - public PrivateEndpointConnectionListResultWithSystemData - withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +53,6 @@ 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} */ @@ -83,6 +60,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 +70,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/PrivateLinkResourceListResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/PrivateLinkResourceListResult.java similarity index 73% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/PrivateLinkResourceListResult.java index acfe449dc07e..f6fd71acef6b 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/implementation/models/PrivateLinkResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * A list of private link resources. */ -@Fluent +@Immutable 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; /** * Creates an instance of PrivateLinkResourceListResult class. */ - public PrivateLinkResourceListResult() { + private 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,18 +44,7 @@ public List value() { } /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. - */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -81,6 +59,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 +69,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/implementation/models/ResourceProviderOperationListResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ResourceProviderOperationListResult.java new file mode 100644 index 000000000000..e2bbdd023bab --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ResourceProviderOperationListResult.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.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. + */ +@Immutable +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. + */ + private ResourceProviderOperationListResult() { + } + + /** + * Get the value property: The ResourceProviderOperation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/ScalingPlanList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanList.java index 94766566782e..3d10756b9b9e 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/implementation/models/ScalingPlanList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ScalingPlanList - * * List of scaling plan definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of ScalingPlanList class. */ - public ScalingPlanList() { + private 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,18 +44,7 @@ public List value() { } /** - * Set the value property: List of scaling plan definitions. - * - * @param value the value value to set. - * @return the ScalingPlanList object itself. - */ - public ScalingPlanList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/ScalingPlanPersonalScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPersonalScheduleList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPersonalScheduleList.java index 21f5c39476a4..e90437d54ce9 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/implementation/models/ScalingPlanPersonalScheduleList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ScalingPlanPersonalScheduleList - * * List of ScalingPlanPersonalSchedule definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of ScalingPlanPersonalScheduleList class. */ - public ScalingPlanPersonalScheduleList() { + private ScalingPlanPersonalScheduleList() { } /** - * Get the value property: List of ScalingPlanPersonalSchedule definitions. + * Get the value property: The ScalingPlanPersonalSchedule items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of ScalingPlanPersonalSchedule definitions. - * - * @param value the value value to set. - * @return the ScalingPlanPersonalScheduleList object itself. - */ - public ScalingPlanPersonalScheduleList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/ScalingPlanPooledScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPooledScheduleList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPooledScheduleList.java index 7395266343a5..0e0669e73bf4 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/implementation/models/ScalingPlanPooledScheduleList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * ScalingPlanPooledScheduleList - * * List of ScalingPlanPooledSchedule definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of ScalingPlanPooledScheduleList class. */ - public ScalingPlanPooledScheduleList() { + private ScalingPlanPooledScheduleList() { } /** - * Get the value property: List of ScalingPlanPooledSchedule definitions. + * Get the value property: The ScalingPlanPooledSchedule items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of ScalingPlanPooledSchedule definitions. - * - * @param value the value value to set. - * @return the ScalingPlanPooledScheduleList object itself. - */ - public ScalingPlanPooledScheduleList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/implementation/models/SessionHostConfigurationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostConfigurationList.java new file mode 100644 index 000000000000..20b832eafb79 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostConfigurationList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of SessionHostConfiguration definitions. + */ +@Immutable +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. + */ + private SessionHostConfigurationList() { + } + + /** + * Get the value property: The SessionHostConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/SessionHostList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostList.java index a69f2f8c8c9a..918a88a60758 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/implementation/models/SessionHostList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * SessionHostList - * * List of SessionHost definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of SessionHostList class. */ - public SessionHostList() { + private SessionHostList() { } /** - * Get the value property: List of SessionHost definitions. + * Get the value property: The SessionHost items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of SessionHost definitions. - * - * @param value the value value to set. - * @return the SessionHostList object itself. - */ - public SessionHostList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/implementation/models/SessionHostManagementList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostManagementList.java new file mode 100644 index 000000000000..03e4e9ac0a42 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostManagementList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import java.io.IOException; +import java.util.List; + +/** + * List of SessionHostManagement definitions. + */ +@Immutable +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. + */ + private SessionHostManagementList() { + } + + /** + * Get the value property: The SessionHostManagement items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/StartMenuItemList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/StartMenuItemList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/StartMenuItemList.java index 0b60ad2e0cf3..06dc05e59ed0 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/implementation/models/StartMenuItemList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * StartMenuItemList - * * List of StartMenuItem definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of StartMenuItemList class. */ - public StartMenuItemList() { + private StartMenuItemList() { } /** - * Get the value property: List of StartMenuItem definitions. + * Get the value property: The StartMenuItem items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of StartMenuItem definitions. - * - * @param value the value value to set. - * @return the StartMenuItemList object itself. - */ - public StartMenuItemList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/models/UserSessionList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/UserSessionList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/UserSessionList.java index 00c30fba7426..004be00ae9ff 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/implementation/models/UserSessionList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * UserSessionList - * * List of UserSession definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of UserSessionList class. */ - public UserSessionList() { + private UserSessionList() { } /** - * Get the value property: List of UserSession definitions. + * Get the value property: The UserSession items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of UserSession definitions. - * - * @param value the value value to set. - * @return the UserSessionList object itself. - */ - public UserSessionList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/WorkspaceList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/WorkspaceList.java similarity index 71% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/WorkspaceList.java index cca1d1c61fc7..802c8cc5a3d9 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/implementation/models/WorkspaceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.desktopvirtualization.models; +package com.azure.resourcemanager.desktopvirtualization.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,30 +14,28 @@ import java.util.List; /** - * WorkspaceList - * * List of Workspace definitions. */ -@Fluent +@Immutable 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; /** * Creates an instance of WorkspaceList class. */ - public WorkspaceList() { + private WorkspaceList() { } /** - * Get the value property: List of Workspace definitions. + * Get the value property: The Workspace items on this page. * * @return the value value. */ @@ -46,18 +44,7 @@ public List value() { } /** - * Set the value property: List of Workspace definitions. - * - * @param value the value value to set. - * @return the WorkspaceList object itself. - */ - public WorkspaceList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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 +52,6 @@ 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} */ @@ -83,6 +59,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 +69,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/implementation/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java index fcc669a8bf54..2bfe2316bba2 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for DesktopVirtualizationApiClient. - * null. + * Package containing the implementations for DesktopVirtualization. + * 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..9a25db3a98e4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoPatchProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..3bc56c7fe5c6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 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; + } + + /** + * {@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..ee32fcfe364e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner; + +/** + * 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 properties property: Detailed properties for ActiveSessionHostConfiguration. + * + * @return the properties value. + */ + ActiveSessionHostConfigurationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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/ActiveSessionHostConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationProperties.java new file mode 100644 index 000000000000..d0e65fc81aa3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationProperties.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration properties + * except provisioningState. + */ +@Immutable +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. + */ + private 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the vmNamePrefix property: The prefix that should be associated with session host names. + * + * @return the vmNamePrefix value. + */ + public String vmNamePrefix() { + return this.vmNamePrefix; + } + + /** + * 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; + } + + /** + * Get the networkInfo property: Network information. + * + * @return the networkInfo value. + */ + public NetworkInfoProperties networkInfo() { + return this.networkInfo; + } + + /** + * 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; + } + + /** + * Get the diskInfo property: Disk information. + * + * @return the diskInfo value. + */ + public DiskInfoProperties diskInfo() { + return this.diskInfo; + } + + /** + * 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; + } + + /** + * Get the imageInfo property: Image configurations of the HostPool. + * + * @return the imageInfo value. + */ + public ImageInfoProperties imageInfo() { + return this.imageInfo; + } + + /** + * Get the domainInfo property: Domain configurations of session hosts. + * + * @return the domainInfo value. + */ + public DomainInfoProperties domainInfo() { + return this.domainInfo; + } + + /** + * Get the securityInfo property: Security information. + * + * @return the securityInfo value. + */ + public SecurityInfoProperties securityInfo() { + return this.securityInfo; + } + + /** + * Get the vmAdminCredentials property: Local Admin credentials for session hosts. + * + * @return the vmAdminCredentials value. + */ + public KeyVaultCredentialsProperties vmAdminCredentials() { + return this.vmAdminCredentials; + } + + /** + * Get the bootDiagnosticsInfo property: Boot Diagnostics information. + * + * @return the bootDiagnosticsInfo value. + */ + public BootDiagnosticsInfoProperties bootDiagnosticsInfo() { + return this.bootDiagnosticsInfo; + } + + /** + * {@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/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..ac817588a795 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ActiveSessionHostConfigurations. + */ +public interface ActiveSessionHostConfigurations { + /** + * Get 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); + + /** + * 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); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java index 0d320df65485..e1db303d83cb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -130,17 +130,6 @@ public List maintenanceWindows() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (maintenanceWindows() != null) { - maintenanceWindows().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java index 40f25415b7cb..388b7f6333d3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -129,17 +129,6 @@ public AgentUpdateProperties withMaintenanceWindows(List e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AllowRDPShortPathWithPrivateLink.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AllowRDPShortPathWithPrivateLink.java new file mode 100644 index 000000000000..a5b96e74fc0e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AllowRDPShortPathWithPrivateLink.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Controls if the use of RDPShortPath transport is allowed, possibly bypassing Private Link routes. + */ +public final class AllowRDPShortPathWithPrivateLink extends ExpandableStringEnum { + /** + * Blocks the use of RDPShortPath if the hostpool PublicNetworkAccess setting is configured to require private link. + */ + public static final AllowRDPShortPathWithPrivateLink DISABLED = fromString("Disabled"); + + /** + * Allows the use of RDPShortPath even if the hostpool PublicNetworkAccess is configured to require the use of + * private link. + */ + public static final AllowRDPShortPathWithPrivateLink ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of AllowRDPShortPathWithPrivateLink value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllowRDPShortPathWithPrivateLink() { + } + + /** + * Creates or finds a AllowRDPShortPathWithPrivateLink from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowRDPShortPathWithPrivateLink. + */ + public static AllowRDPShortPathWithPrivateLink fromString(String name) { + return fromString(name, AllowRDPShortPathWithPrivateLink.class); + } + + /** + * Gets known AllowRDPShortPathWithPrivateLink values. + * + * @return known AllowRDPShortPathWithPrivateLink values. + */ + public static Collection values() { + return values(AllowRDPShortPathWithPrivateLink.class); + } +} 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..456ec4e497b9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -200,7 +200,7 @@ interface WithTags { /** * The template for AppAttachPackage update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -221,6 +221,19 @@ interface Update extends UpdateStages.WithProperties { * The AppAttachPackage update stages. */ interface UpdateStages { + /** + * The stage of the AppAttachPackage update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: tags to be updated. + * + * @param tags tags to be updated. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** * The stage of the AppAttachPackage update allowing to specify properties. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java index 44354602f315..e2602a5c7ca7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,37 +12,37 @@ */ public final class AppAttachPackageArchitectures extends ExpandableStringEnum { /** - * Static value ARM for AppAttachPackageArchitectures. + * ARM 32-bit. */ public static final AppAttachPackageArchitectures ARM = fromString("ARM"); /** - * Static value ARM64 for AppAttachPackageArchitectures. + * ARM 64-bit. */ public static final AppAttachPackageArchitectures ARM64 = fromString("ARM64"); /** - * Static value x86 for AppAttachPackageArchitectures. + * 32-bit x86. */ public static final AppAttachPackageArchitectures X86 = fromString("x86"); /** - * Static value x64 for AppAttachPackageArchitectures. + * 64-bit. */ public static final AppAttachPackageArchitectures X64 = fromString("x64"); /** - * Static value Neutral for AppAttachPackageArchitectures. + * Any architecture can be used. */ public static final AppAttachPackageArchitectures NEUTRAL = fromString("Neutral"); /** - * Static value x86a64 for AppAttachPackageArchitectures. + * X86 Compiled Hybrid Portable Executable for ARM64. */ public static final AppAttachPackageArchitectures X86A64 = fromString("x86a64"); /** - * Static value ALL for AppAttachPackageArchitectures. + * Select all listed applications, no filters. */ public static final AppAttachPackageArchitectures ALL = fromString("ALL"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java index 2e6acbe77ee2..dc062249e4d3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -428,20 +428,6 @@ public AppAttachPackageInfoProperties withIsPackageTimestamped(PackageTimestampe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (packageDependencies() != null) { - packageDependencies().forEach(e -> e.validate()); - } - if (packageApplications() != null) { - packageApplications().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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..cc5654f8e6c1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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 Information to import 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. @@ -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 Information to import 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. 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..0cddc092e359 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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. * @@ -107,23 +133,13 @@ public String id() { return this.id; } - /** - * 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.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -150,6 +166,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..86157b33e2ba 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -37,6 +37,16 @@ public final class AppAttachPackagePatchProperties implements JsonSerializable getByResourceGroupWithResponse(String resourceGroupNa * * @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 the {@link Response}. */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Boolean force, Context context); /** @@ -61,7 +62,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName); + void delete(String resourceGroupName, String appAttachPackageName); /** * List App Attach packages in resource group. @@ -70,7 +71,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -83,7 +84,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); @@ -92,7 +93,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -105,7 +106,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of App Attach Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String filter, Context context); @@ -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..3d389ff6d8f7 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 @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; 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. @@ -35,111 +34,18 @@ public interface Application { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of Application. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the description property: Description of Application. - * - * @return the description value. - */ - String description(); - - /** - * Gets the friendlyName property: Friendly name of Application. + * Gets the properties property: Detailed properties for Application. * - * @return the friendlyName value. + * @return the properties value. */ - String friendlyName(); + ApplicationProperties properties(); /** - * Gets the filePath property: Specifies a path for the executable file for the application. - * - * @return the filePath value. - */ - String filePath(); - - /** - * Gets the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * - * @return the msixPackageFamilyName value. - */ - String msixPackageFamilyName(); - - /** - * Gets the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * - * @return the msixPackageApplicationId value. - */ - String msixPackageApplicationId(); - - /** - * Gets the applicationType property: Resource Type of Application. - * - * @return the applicationType value. - */ - RemoteApplicationType applicationType(); - - /** - * Gets 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. - */ - CommandLineSetting commandLineSetting(); - - /** - * Gets the commandLineArguments property: Command Line Arguments for Application. - * - * @return the commandLineArguments value. - */ - String commandLineArguments(); - - /** - * Gets the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * - * @return the showInPortal value. - */ - Boolean showInPortal(); - - /** - * Gets the iconPath property: Path to icon. - * - * @return the iconPath value. - */ - String iconPath(); - - /** - * Gets the iconIndex property: Index of the icon. - * - * @return the iconIndex value. - */ - Integer iconIndex(); - - /** - * Gets the iconHash property: Hash of the icon. - * - * @return the iconHash value. - */ - String iconHash(); - - /** - * Gets the iconContent property: the icon a 64 bit string as a byte array. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the iconContent value. + * @return the systemData value. */ - byte[] iconContent(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -159,7 +65,7 @@ public interface Application { * The entirety of the Application definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithCommandLineSetting, DefinitionStages.WithCreate { + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -183,35 +89,27 @@ interface WithParentResource { * @param applicationGroupName The name of the application group. * @return the next definition stage. */ - WithCommandLineSetting withExistingApplicationGroup(String resourceGroupName, String applicationGroupName); + WithProperties withExistingApplicationGroup(String resourceGroupName, String applicationGroupName); } /** - * The stage of the Application definition allowing to specify commandLineSetting. + * The stage of the Application definition allowing to specify properties. */ - interface WithCommandLineSetting { + interface WithProperties { /** - * 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.. + * Specifies the properties property: Detailed properties for Application. * - * @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. + * @param properties Detailed properties for Application. * @return the next definition stage. */ - WithCreate withCommandLineSetting(CommandLineSetting commandLineSetting); + WithCreate withProperties(ApplicationProperties properties); } /** * The stage of the Application 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.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithFilePath, - DefinitionStages.WithMsixPackageFamilyName, DefinitionStages.WithMsixPackageApplicationId, - DefinitionStages.WithApplicationType, DefinitionStages.WithCommandLineArguments, - DefinitionStages.WithShowInPortal, DefinitionStages.WithIconPath, DefinitionStages.WithIconIndex { + interface WithCreate { /** * Executes the create request. * @@ -227,138 +125,6 @@ interface WithCreate */ Application create(Context context); } - - /** - * The stage of the Application definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of Application.. - * - * @param description Description of Application. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withFriendlyName(String friendlyName); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withFilePath(String filePath); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withMsixPackageFamilyName(String msixPackageFamilyName); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withMsixPackageApplicationId(String msixPackageApplicationId); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withApplicationType(RemoteApplicationType applicationType); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withCommandLineArguments(String commandLineArguments); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withShowInPortal(Boolean showInPortal); - } - - /** - * The stage of the Application definition allowing to specify iconPath. - */ - interface WithIconPath { - /** - * Specifies the iconPath property: Path to icon.. - * - * @param iconPath Path to icon. - * @return the next definition stage. - */ - WithCreate withIconPath(String iconPath); - } - - /** - * The stage of the Application definition 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. - */ - WithCreate withIconIndex(Integer iconIndex); - } } /** @@ -371,11 +137,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 +159,16 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, Up */ interface UpdateStages { /** - * The stage of the Application 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 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. + * The stage of the Application update allowing to specify properties. */ - interface WithApplicationType { + interface WithProperties { /** - * Specifies the applicationType property: Resource Type of Application.. + * Specifies the properties property: Detailed properties for Application. * - * @param applicationType Resource Type of Application. + * @param properties Detailed properties for 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..16433898a062 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -50,116 +50,67 @@ 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 properties property: Detailed properties for ApplicationGroup. * - * @return the managedBy value. + * @return the properties value. */ - String managedBy(); + ApplicationGroupProperties properties(); /** - * 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 - * validate and persist this value. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the kind value. + * @return the identity value. */ - String kind(); + ManagedServiceIdentity identity(); /** - * 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 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 identity property: The identity property. + * 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 + * validate and persist this value. * - * @return the identity value. + * @return the kind value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + String kind(); /** - * Gets the sku property: The sku property. + * 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 sku value. + * @return the managedBy value. */ - ResourceModelWithAllowedPropertySetSku sku(); + String managedBy(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Details of the resource plan. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of ApplicationGroup. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the description property: Description of ApplicationGroup. - * - * @return the description value. - */ - String description(); + Plan plan(); /** - * Gets the friendlyName property: Friendly name of ApplicationGroup. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the friendlyName value. - */ - String friendlyName(); - - /** - * Gets the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * - * @return the hostPoolArmPath value. - */ - String hostPoolArmPath(); - - /** - * Gets the workspaceArmPath property: Workspace arm path of ApplicationGroup. - * - * @return the workspaceArmPath value. - */ - String workspaceArmPath(); - - /** - * Gets the applicationGroupType property: Resource Type of ApplicationGroup. - * - * @return the applicationGroupType value. - */ - ApplicationGroupType applicationGroupType(); - - /** - * Gets the cloudPcResource property: Is cloud pc resource. - * - * @return the cloudPcResource value. + * @return the sku value. */ - Boolean cloudPcResource(); + Sku sku(); /** - * Gets the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the showInFeed value. + * @return the systemData value. */ - Boolean showInFeed(); + SystemData systemData(); /** * Gets the region of the resource. @@ -192,9 +143,8 @@ public interface ApplicationGroup { /** * The entirety of the ApplicationGroup definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithHostPoolArmPath, DefinitionStages.WithApplicationGroupType, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -238,33 +188,20 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithHostPoolArmPath withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the ApplicationGroup definition allowing to specify hostPoolArmPath. - */ - interface WithHostPoolArmPath { - /** - * Specifies the hostPoolArmPath property: HostPool arm path of ApplicationGroup.. - * - * @param hostPoolArmPath HostPool arm path of ApplicationGroup. - * @return the next definition stage. - */ - WithApplicationGroupType withHostPoolArmPath(String hostPoolArmPath); + WithProperties withExistingResourceGroup(String resourceGroupName); } /** - * The stage of the ApplicationGroup definition allowing to specify applicationGroupType. + * The stage of the ApplicationGroup definition allowing to specify properties. */ - interface WithApplicationGroupType { + interface WithProperties { /** - * Specifies the applicationGroupType property: Resource Type of ApplicationGroup.. + * Specifies the properties property: Detailed properties for ApplicationGroup. * - * @param applicationGroupType Resource Type of ApplicationGroup. + * @param properties Detailed properties for ApplicationGroup. * @return the next definition stage. */ - WithCreate withApplicationGroupType(ApplicationGroupType applicationGroupType); + WithCreate withProperties(ApplicationGroupProperties properties); } /** @@ -272,9 +209,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, - DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithShowInFeed { + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, DefinitionStages.WithSku { /** * Executes the create request. * @@ -305,21 +241,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 +259,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,29 +271,21 @@ interface WithKind { } /** - * The stage of the ApplicationGroup definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity property.. - * - * @param identity The identity property. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); - } - - /** - * The stage of the ApplicationGroup definition allowing to specify sku. + * The stage of the ApplicationGroup definition allowing to specify managedBy. */ - interface WithSku { + interface WithManagedBy { /** - * Specifies the sku property: The sku 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 sku The sku 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 withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withManagedBy(String managedBy); } /** @@ -370,52 +293,25 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. - * - * @param plan The plan property. - * @return the next definition stage. - */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); - } - - /** - * The stage of the ApplicationGroup definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of ApplicationGroup.. + * Specifies the plan property: Details of the resource plan.. * - * @param description Description of ApplicationGroup. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withPlan(Plan plan); } /** - * The stage of the ApplicationGroup definition allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of ApplicationGroup.. - * - * @param friendlyName Friendly name of ApplicationGroup. - * @return the next definition stage. - */ - WithCreate withFriendlyName(String friendlyName); - } - - /** - * The stage of the ApplicationGroup definition allowing to specify showInFeed. + * The stage of the ApplicationGroup definition allowing to specify sku. */ - interface WithShowInFeed { + interface WithSku { /** - * Specifies the showInFeed property: Boolean representing whether the applicationGroup is show in the - * feed.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param showInFeed Boolean representing whether the applicationGroup is show in the feed. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withShowInFeed(Boolean showInFeed); + WithCreate withSku(Sku sku); } } @@ -429,8 +325,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 +360,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. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of ApplicationGroup.. - * - * @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. + * The stage of the ApplicationGroup update allowing to specify properties. */ - interface WithShowInFeed { + interface WithProperties { /** - * Specifies the showInFeed property: Boolean representing whether the applicationGroup is show in the - * feed.. + * Specifies the properties property: ApplicationGroup properties that can be patched.. * - * @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/ApplicationGroupPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java index 77ebddb82534..1d52abd247cd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,86 +133,6 @@ 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(); - } - } - /** * {@inheritDoc} */ @@ -210,7 +140,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 +170,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 94% 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..e8b017011644 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 @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -97,14 +97,6 @@ public ApplicationGroupPatchProperties withShowInFeed(Boolean showInFeed) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupProperties.java similarity index 83% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupProperties.java index 2dcc2c5fcf98..f5e0a314dbf2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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.ApplicationGroupType; import java.io.IOException; /** @@ -58,6 +56,16 @@ public final class ApplicationGroupProperties implements JsonSerializable { /** - * Static value RemoteApp for ApplicationGroupType. + * Application group is Remote and can launch individual applications without a Desktop. */ public static final ApplicationGroupType REMOTE_APP = fromString("RemoteApp"); /** - * Static value Desktop for ApplicationGroupType. + * Application Group delivers a full expected Desktop experience. */ public static final ApplicationGroupType DESKTOP = fromString("Desktop"); 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..8d712d6fc990 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -70,7 +70,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -86,7 +86,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -96,7 +96,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, St * * @throws com.azure.core.management.exception.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 list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -108,7 +108,7 @@ PagedIterable listByResourceGroup(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 applicationGroupList as paginated response with {@link PagedIterable}. + * @return list of ApplicationGroup definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String filter, Context context); 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..2a476735a747 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,310 +28,32 @@ public ApplicationPatch() { } /** - * Get the tags property: tags to be updated. + * Get the properties property: Detailed properties for Application. * - * @return the tags value. + * @return the properties value. */ - public Map tags() { - return this.tags; + public ApplicationPatchProperties properties() { + return this.properties; } /** - * Set the tags property: tags to be updated. + * Set the properties property: Detailed properties for Application. * - * @param tags the tags value to set. + * @param properties the properties value to set. * @return the ApplicationPatch object itself. */ - public ApplicationPatch withTags(Map tags) { - this.tags = tags; + public ApplicationPatch withProperties(ApplicationPatchProperties properties) { + this.properties = properties; 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. - * - * @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. - */ - public CommandLineSetting commandLineSetting() { - return this.innerProperties() == null ? null : this.innerProperties().commandLineSetting(); - } - - /** - * 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. - * - * @param commandLineSetting the commandLineSetting 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); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -357,11 +72,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 96% 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..23d0a3d78eca 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 @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; /** @@ -304,14 +302,6 @@ public ApplicationPatchProperties withApplicationType(RemoteApplicationType appl return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationProperties.java similarity index 94% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationProperties.java index b86fd5c46140..f144496a7237 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationProperties.java @@ -1,18 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; -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.CommandLineSetting; -import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import java.io.IOException; /** @@ -348,21 +345,6 @@ public byte[] iconContent() { return CoreUtils.clone(this.iconContent); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (commandLineSetting() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property commandLineSetting in model ApplicationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java index 58a661bac723..a6903fad1670 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class ApplicationType extends ExpandableStringEnum { /** - * Static value RemoteApp for ApplicationType. + * Remote Applications (non-desktop). */ public static final ApplicationType REMOTE_APP = fromString("RemoteApp"); /** - * Static value Desktop for ApplicationType. + * Desktop Applications. */ public static final ApplicationType DESKTOP = fromString("Desktop"); 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..93bcd1fa71d2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -75,7 +75,7 @@ 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 applicationList as paginated response with {@link PagedIterable}. + * @return list of Application definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -91,7 +91,7 @@ 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 applicationList as paginated response with {@link PagedIterable}. + * @return list of Application 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/AzureActiveDirectoryInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java new file mode 100644 index 000000000000..6e0aa5721381 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + +/** + * 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; + } + + /** + * {@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..f3c615d75b27 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoPatchProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..e2bad7c4384a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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/CanaryPolicy.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CanaryPolicy.java new file mode 100644 index 000000000000..465618e72101 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CanaryPolicy.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session host + * provisioning operation. + */ +public final class CanaryPolicy extends ExpandableStringEnum { + /** + * Decided by service whether to provision Canary VM. + */ + public static final CanaryPolicy AUTO = fromString("Auto"); + + /** + * Never provision Canary VM. + */ + public static final CanaryPolicy NEVER = fromString("Never"); + + /** + * Always provision Canary VM. + */ + public static final CanaryPolicy ALWAYS = fromString("Always"); + + /** + * Creates a new instance of CanaryPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CanaryPolicy() { + } + + /** + * Creates or finds a CanaryPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding CanaryPolicy. + */ + public static CanaryPolicy fromString(String name) { + return fromString(name, CanaryPolicy.class); + } + + /** + * Gets known CanaryPolicy values. + * + * @return known CanaryPolicy values. + */ + public static Collection values() { + return values(CanaryPolicy.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java index 19fdf2db5b71..162f8c2aaf9a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,17 +13,17 @@ */ public final class CommandLineSetting extends ExpandableStringEnum { /** - * Static value DoNotAllow for CommandLineSetting. + * Cannot be launched with command line arguments. */ public static final CommandLineSetting DO_NOT_ALLOW = fromString("DoNotAllow"); /** - * Static value Allow for CommandLineSetting. + * Can optionally be launched with command line arguments. */ public static final CommandLineSetting ALLOW = fromString("Allow"); /** - * Static value Require for CommandLineSetting. + * Required to be launched with command line arguments. */ public static final CommandLineSetting REQUIRE = fromString("Require"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostProvisionings.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostProvisionings.java new file mode 100644 index 000000000000..82da4630141b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostProvisionings.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ControlSessionHostProvisionings. + */ +public interface ControlSessionHostProvisionings { + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter); + + /** + * Control provisioning of a hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param hostPoolProvisioningControlParameter 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, + HostPoolProvisioningControlParameter hostPoolProvisioningControlParameter, Context context); +} 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..eb15f22b1807 --- /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) TypeSpec 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/CreateDeleteProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java new file mode 100644 index 000000000000..339fd832ede0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ +@Fluent +public final class CreateDeleteProperties implements JsonSerializable { + /* + * Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool + * to have a session host config property. + */ + private Integer rampUpMaximumHostPoolSize; + + /* + * Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts + * when this limit is met. This requires the assigned hostpool to have a session host config property. + */ + private Integer rampUpMinimumHostPoolSize; + + /* + * Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool + * to have a session host config property. + */ + private Integer rampDownMaximumHostPoolSize; + + /* + * Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts + * when this limit is met. This requires the assigned hostpool to have a session host config property. + */ + private Integer rampDownMinimumHostPoolSize; + + /** + * Creates an instance of CreateDeleteProperties class. + */ + public CreateDeleteProperties() { + } + + /** + * Get the rampUpMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @return the rampUpMaximumHostPoolSize value. + */ + public Integer rampUpMaximumHostPoolSize() { + return this.rampUpMaximumHostPoolSize; + } + + /** + * Set the rampUpMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @param rampUpMaximumHostPoolSize the rampUpMaximumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampUpMaximumHostPoolSize(Integer rampUpMaximumHostPoolSize) { + this.rampUpMaximumHostPoolSize = rampUpMaximumHostPoolSize; + return this; + } + + /** + * Get the rampUpMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @return the rampUpMinimumHostPoolSize value. + */ + public Integer rampUpMinimumHostPoolSize() { + return this.rampUpMinimumHostPoolSize; + } + + /** + * Set the rampUpMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @param rampUpMinimumHostPoolSize the rampUpMinimumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampUpMinimumHostPoolSize(Integer rampUpMinimumHostPoolSize) { + this.rampUpMinimumHostPoolSize = rampUpMinimumHostPoolSize; + return this; + } + + /** + * Get the rampDownMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @return the rampDownMaximumHostPoolSize value. + */ + public Integer rampDownMaximumHostPoolSize() { + return this.rampDownMaximumHostPoolSize; + } + + /** + * Set the rampDownMaximumHostPoolSize property: Maximum number of session hosts that may be created by the Scaling + * Service. This requires the assigned hostpool to have a session host config property. + * + * @param rampDownMaximumHostPoolSize the rampDownMaximumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampDownMaximumHostPoolSize(Integer rampDownMaximumHostPoolSize) { + this.rampDownMaximumHostPoolSize = rampDownMaximumHostPoolSize; + return this; + } + + /** + * Get the rampDownMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @return the rampDownMinimumHostPoolSize value. + */ + public Integer rampDownMinimumHostPoolSize() { + return this.rampDownMinimumHostPoolSize; + } + + /** + * Set the rampDownMinimumHostPoolSize property: Minimum number of session hosts that will be be created by the + * Scaling Service. Scaling will not delete any hosts when this limit is met. This requires the assigned hostpool to + * have a session host config property. + * + * @param rampDownMinimumHostPoolSize the rampDownMinimumHostPoolSize value to set. + * @return the CreateDeleteProperties object itself. + */ + public CreateDeleteProperties withRampDownMinimumHostPoolSize(Integer rampDownMinimumHostPoolSize) { + this.rampDownMinimumHostPoolSize = rampDownMinimumHostPoolSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("rampUpMaximumHostPoolSize", this.rampUpMaximumHostPoolSize); + jsonWriter.writeNumberField("rampUpMinimumHostPoolSize", this.rampUpMinimumHostPoolSize); + jsonWriter.writeNumberField("rampDownMaximumHostPoolSize", this.rampDownMaximumHostPoolSize); + jsonWriter.writeNumberField("rampDownMinimumHostPoolSize", this.rampDownMinimumHostPoolSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateDeleteProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateDeleteProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateDeleteProperties. + */ + public static CreateDeleteProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateDeleteProperties deserializedCreateDeleteProperties = new CreateDeleteProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rampUpMaximumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampUpMaximumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpMinimumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampUpMinimumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownMaximumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampDownMaximumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownMinimumHostPoolSize".equals(fieldName)) { + deserializedCreateDeleteProperties.rampDownMinimumHostPoolSize + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateDeleteProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java new file mode 100644 index 000000000000..d1d715177081 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..d08db457b861 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 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; + } + + /** + * {@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..3cbe4767c2f0 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 @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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/DeploymentScope.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DeploymentScope.java new file mode 100644 index 000000000000..19f374156e9f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DeploymentScope.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeploymentScope type for HostPool. + */ +public final class DeploymentScope extends ExpandableStringEnum { + /** + * For geographical Broker and ArmProvider talking to Geographical SQL DB. + */ + public static final DeploymentScope GEOGRAPHICAL = fromString("Geographical"); + + /** + * For regional Broker and ArmProvider talking to regional SQL DB. + */ + public static final DeploymentScope REGIONAL = fromString("Regional"); + + /** + * Creates a new instance of DeploymentScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentScope() { + } + + /** + * Creates or finds a DeploymentScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentScope. + */ + public static DeploymentScope fromString(String name) { + return fromString(name, DeploymentScope.class); + } + + /** + * Gets known DeploymentScope values. + * + * @return known DeploymentScope values. + */ + public static Collection values() { + return values(DeploymentScope.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java index ed363a804c89..6890a932b026 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -33,46 +33,18 @@ public interface Desktop { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of Desktop. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the description property: Description of Desktop. + * Gets the properties property: Detailed properties for Desktop. * - * @return the description value. + * @return the properties value. */ - String description(); + DesktopProperties properties(); /** - * Gets the friendlyName property: Friendly name of Desktop. - * - * @return the friendlyName value. - */ - String friendlyName(); - - /** - * Gets the iconHash property: Hash of the icon. - * - * @return the iconHash value. - */ - String iconHash(); - - /** - * Gets the iconContent property: The icon a 64 bit string as a byte array. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the iconContent value. + * @return the systemData value. */ - byte[] iconContent(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner object. 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..d2194411a36a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,99 +28,32 @@ public DesktopPatch() { } /** - * Get the tags property: tags to be updated. + * Get the properties property: Detailed properties for Desktop. * - * @return the tags value. + * @return the properties value. */ - public Map tags() { - return this.tags; + public DesktopPatchProperties properties() { + return this.properties; } /** - * Set the tags property: tags to be updated. + * Set the properties property: Detailed properties for Desktop. * - * @param tags the tags value to set. + * @param properties the properties value to set. * @return the DesktopPatch object itself. */ - public DesktopPatch withTags(Map tags) { - this.tags = tags; + public DesktopPatch withProperties(DesktopPatchProperties properties) { + this.properties = properties; 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. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of Desktop. - * - * @param description the description 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); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -146,11 +72,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 92% 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..e5ff24128c4a 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 @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -72,14 +72,6 @@ public DesktopPatchProperties withFriendlyName(String friendlyName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopProperties.java similarity index 79% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopProperties.java index 2d7a8bb27df9..fd127f8fb921 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Schema for Desktop properties. */ -@Fluent +@Immutable public final class DesktopProperties implements JsonSerializable { /* * ObjectId of Desktop. (internal use) @@ -45,7 +45,7 @@ public final class DesktopProperties implements JsonSerializable getWithResponse(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 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. @@ -77,7 +77,7 @@ 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 desktopList as paginated response with {@link PagedIterable}. + * @return list of Desktop definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String applicationGroupName); @@ -93,7 +93,7 @@ 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 desktopList as paginated response with {@link PagedIterable}. + * @return list of Desktop 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/DiffDiskOption.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskOption.java new file mode 100644 index 000000000000..daf1a8aa2d81 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskOption.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the ephemeral disk settings for operating system disk. + */ +public final class DiffDiskOption extends ExpandableStringEnum { + /** + * Operating system disk local setting. + */ + public static final DiffDiskOption LOCAL = fromString("Local"); + + /** + * Creates a new instance of DiffDiskOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskOption() { + } + + /** + * Creates or finds a DiffDiskOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskOption. + */ + public static DiffDiskOption fromString(String name) { + return fromString(name, DiffDiskOption.class); + } + + /** + * Gets known DiffDiskOption values. + * + * @return known DiffDiskOption values. + */ + public static Collection values() { + return values(DiffDiskOption.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskPlacement.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskPlacement.java new file mode 100644 index 000000000000..d182f35cde64 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskPlacement.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gets or sets specifies the ephemeral disk placement for operating system disk. The defaulting behavior is: CacheDisk + * if one is configured for the VM size otherwise ResourceDisk is used. Refer to the VM size documentation for Windows + * VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible + * values include: 'CacheDisk', 'ResourceDisk'. + */ +public final class DiffDiskPlacement extends ExpandableStringEnum { + /** + * Cache disk placement. + */ + public static final DiffDiskPlacement CACHE_DISK = fromString("CacheDisk"); + + /** + * Resource disk placement. + */ + public static final DiffDiskPlacement RESOURCE_DISK = fromString("ResourceDisk"); + + /** + * Creates a new instance of DiffDiskPlacement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskPlacement() { + } + + /** + * Creates or finds a DiffDiskPlacement from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskPlacement. + */ + public static DiffDiskPlacement fromString(String name) { + return fromString(name, DiffDiskPlacement.class); + } + + /** + * Gets known DiffDiskPlacement values. + * + * @return known DiffDiskPlacement values. + */ + public static Collection values() { + return values(DiffDiskPlacement.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskProperties.java new file mode 100644 index 000000000000..7fb11c5afad0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Specifies the ephemeral disk settings for the operating system disk used by the virtual machine. + */ +@Fluent +public final class DiffDiskProperties implements JsonSerializable { + /* + * Specifies the ephemeral disk settings for operating system disk. + */ + private DiffDiskOption option; + + /* + * Gets or sets specifies the ephemeral disk placement for operating system disk. The defaulting behavior is: + * CacheDisk if one is configured for the VM size otherwise ResourceDisk is used. Refer to the VM size documentation + * for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * Possible values include: 'CacheDisk', 'ResourceDisk'. + */ + private DiffDiskPlacement placement; + + /** + * Creates an instance of DiffDiskProperties class. + */ + public DiffDiskProperties() { + } + + /** + * Get the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @return the option value. + */ + public DiffDiskOption option() { + return this.option; + } + + /** + * Set the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @param option the option value to set. + * @return the DiffDiskProperties object itself. + */ + public DiffDiskProperties withOption(DiffDiskOption option) { + this.option = option; + return this; + } + + /** + * Get the placement property: Gets or sets specifies the ephemeral disk placement for operating system disk. The + * defaulting behavior is: CacheDisk if one is configured for the VM size otherwise ResourceDisk is used. Refer to + * the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and + * Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache + * disk. Possible values include: 'CacheDisk', 'ResourceDisk'. + * + * @return the placement value. + */ + public DiffDiskPlacement placement() { + return this.placement; + } + + /** + * Set the placement property: Gets or sets specifies the ephemeral disk placement for operating system disk. The + * defaulting behavior is: CacheDisk if one is configured for the VM size otherwise ResourceDisk is used. Refer to + * the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and + * Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache + * disk. Possible values include: 'CacheDisk', 'ResourceDisk'. + * + * @param placement the placement value to set. + * @return the DiffDiskProperties object itself. + */ + public DiffDiskProperties withPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("option", this.option == null ? null : this.option.toString()); + jsonWriter.writeStringField("placement", this.placement == null ? null : this.placement.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiffDiskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiffDiskProperties 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 DiffDiskProperties. + */ + public static DiffDiskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiffDiskProperties deserializedDiffDiskProperties = new DiffDiskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("option".equals(fieldName)) { + deserializedDiffDiskProperties.option = DiffDiskOption.fromString(reader.getString()); + } else if ("placement".equals(fieldName)) { + deserializedDiffDiskProperties.placement = DiffDiskPlacement.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiffDiskProperties; + }); + } +} 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..926601664d7c --- /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) TypeSpec 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 { + /** + * AVD-wide settings are used to determine connection availability. + */ + public static final DirectUDP DEFAULT = fromString("Default"); + + /** + * UDP will attempt this connection type when making connections. + */ + public static final DirectUDP ENABLED = fromString("Enabled"); + + /** + * UDP will not attempt this connection type when making connections. + */ + 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/DiskInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java new file mode 100644 index 000000000000..dc2ef94b37a1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 DiskInfoProperties implements JsonSerializable { + /* + * The managed disk parameters. + */ + private ManagedDiskProperties managedDisk; + + /* + * Specifies the ephemeral disk settings for the operating system disk used by the virtual machine. + */ + private DiffDiskProperties diffDiskSettings; + + /** + * Creates an instance of DiskInfoProperties class. + */ + public DiskInfoProperties() { + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public ManagedDiskProperties managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the DiskInfoProperties object itself. + */ + public DiskInfoProperties withManagedDisk(ManagedDiskProperties managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diffDiskSettings property: Specifies the ephemeral disk settings for the operating system disk used by + * the virtual machine. + * + * @return the diffDiskSettings value. + */ + public DiffDiskProperties diffDiskSettings() { + return this.diffDiskSettings; + } + + /** + * Set the diffDiskSettings property: Specifies the ephemeral disk settings for the operating system disk used by + * the virtual machine. + * + * @param diffDiskSettings the diffDiskSettings value to set. + * @return the DiskInfoProperties object itself. + */ + public DiskInfoProperties withDiffDiskSettings(DiffDiskProperties diffDiskSettings) { + this.diffDiskSettings = diffDiskSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedDisk", this.managedDisk); + jsonWriter.writeJsonField("diffDiskSettings", this.diffDiskSettings); + 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 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 ("managedDisk".equals(fieldName)) { + deserializedDiskInfoProperties.managedDisk = ManagedDiskProperties.fromJson(reader); + } else if ("diffDiskSettings".equals(fieldName)) { + deserializedDiskInfoProperties.diffDiskSettings = DiffDiskProperties.fromJson(reader); + } 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..de7232716704 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoPatchProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..07213a8085c8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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; + } + + /** + * {@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..805b258f0dcc --- /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) TypeSpec 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 { + /** + * Using microsoft active directory. + */ + public static final DomainJoinType ACTIVE_DIRECTORY = fromString("ActiveDirectory"); + + /** + * Using microsoft azure active directory. + */ + 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..99a69f0191e5 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 @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; 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/fluent/models/ExpandMsixImageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageProperties.java similarity index 63% 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..477b71046b59 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 @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import 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; @@ -20,7 +18,7 @@ /** * Schema for Expand MSIX Image properties. */ -@Fluent +@Immutable public final class ExpandMsixImageProperties implements JsonSerializable { /* * Alias of MSIX Package. @@ -100,7 +98,7 @@ public final class ExpandMsixImageProperties implements JsonSerializable packageDependencies() { return this.packageDependencies; } - /** - * Set the packageDependencies property: List of package dependencies. - * - * @param packageDependencies the packageDependencies value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withPackageDependencies(List packageDependencies) { - this.packageDependencies = packageDependencies; - return this; - } - /** * Get the version property: Package version found in the appxmanifest.xml. * @@ -314,17 +201,6 @@ public String version() { return this.version; } - /** - * Set the version property: Package version found in the appxmanifest.xml. - * - * @param version the version value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withVersion(String version) { - this.version = version; - return this; - } - /** * Get the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. * @@ -334,17 +210,6 @@ public OffsetDateTime lastUpdated() { return this.lastUpdated; } - /** - * Set the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * - * @param lastUpdated the lastUpdated value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withLastUpdated(OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; - return this; - } - /** * Get the packageApplications property: List of package applications. * @@ -354,17 +219,6 @@ public List packageApplications() { return this.packageApplications; } - /** - * Set the packageApplications property: List of package applications. - * - * @param packageApplications the packageApplications value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withPackageApplications(List packageApplications) { - this.packageApplications = packageApplications; - return this; - } - /** * Get the certificateName property: Certificate name found in the appxmanifest.xml. * @@ -374,17 +228,6 @@ public String certificateName() { return this.certificateName; } - /** - * Set the certificateName property: Certificate name found in the appxmanifest.xml. - * - * @param certificateName the certificateName value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withCertificateName(String certificateName) { - this.certificateName = certificateName; - return this; - } - /** * Get the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. * @@ -394,31 +237,6 @@ public OffsetDateTime certificateExpiry() { return this.certificateExpiry; } - /** - * Set the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. - * - * @param certificateExpiry the certificateExpiry value to set. - * @return the ExpandMsixImageProperties object itself. - */ - public ExpandMsixImageProperties withCertificateExpiry(OffsetDateTime certificateExpiry) { - this.certificateExpiry = certificateExpiry; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (packageDependencies() != null) { - packageDependencies().forEach(e -> e.validate()); - } - if (packageApplications() != null) { - packageApplications().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java index 1190796b54df..fa182ea9dd96 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,17 @@ */ public final class FailHealthCheckOnStagingFailure extends ExpandableStringEnum { /** - * Static value Unhealthy for FailHealthCheckOnStagingFailure. + * Health Check will report unhealthy. */ public static final FailHealthCheckOnStagingFailure UNHEALTHY = fromString("Unhealthy"); /** - * Static value NeedsAssistance for FailHealthCheckOnStagingFailure. + * Health Check will report NeedsAssistance. */ public static final FailHealthCheckOnStagingFailure NEEDS_ASSISTANCE = fromString("NeedsAssistance"); /** - * Static value DoNotFail for FailHealthCheckOnStagingFailure. + * Health Check will not report failure. */ public static final FailHealthCheckOnStagingFailure DO_NOT_FAIL = fromString("DoNotFail"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailedSessionHostCleanupPolicySHC.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailedSessionHostCleanupPolicySHC.java new file mode 100644 index 000000000000..63a117a85dcc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailedSessionHostCleanupPolicySHC.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The policy that should be applied when the Session Host provisioning operation fails. + */ +public final class FailedSessionHostCleanupPolicySHC extends ExpandableStringEnum { + /** + * Keep All. + */ + public static final FailedSessionHostCleanupPolicySHC KEEP_ALL = fromString("KeepAll"); + + /** + * Keep One. + */ + public static final FailedSessionHostCleanupPolicySHC KEEP_ONE = fromString("KeepOne"); + + /** + * Keep None. + */ + public static final FailedSessionHostCleanupPolicySHC KEEP_NONE = fromString("KeepNone"); + + /** + * Creates a new instance of FailedSessionHostCleanupPolicySHC value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FailedSessionHostCleanupPolicySHC() { + } + + /** + * Creates or finds a FailedSessionHostCleanupPolicySHC from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailedSessionHostCleanupPolicySHC. + */ + public static FailedSessionHostCleanupPolicySHC fromString(String name) { + return fromString(name, FailedSessionHostCleanupPolicySHC.class); + } + + /** + * Gets known FailedSessionHostCleanupPolicySHC values. + * + * @return known FailedSessionHostCleanupPolicySHC values. + */ + public static Collection values() { + return values(FailedSessionHostCleanupPolicySHC.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java index 84a258bbabdb..c3a0c7870c47 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,57 +12,81 @@ */ public final class HealthCheckName extends ExpandableStringEnum { /** - * Static value DomainJoinedCheck for HealthCheckName. + * Verifies the SessionHost is joined to a domain. If this check fails is classified as fatal as no connection can + * succeed if the SessionHost is not joined to the domain. (Currently Enabled). */ public static final HealthCheckName DOMAIN_JOINED_CHECK = fromString("DomainJoinedCheck"); /** - * Static value DomainTrustCheck for HealthCheckName. + * Verifies the SessionHost is not experiencing domain trust issues that will prevent authentication on SessionHost + * at connection time when session is created. If this check fails is classified as fatal as no connection can + * succeed if we cannot reach the domain for authentication on the SessionHost. (Currently Enabled). */ public static final HealthCheckName DOMAIN_TRUST_CHECK = fromString("DomainTrustCheck"); /** - * Static value FSLogixHealthCheck for HealthCheckName. + * Verifies the FSLogix service is up and running to make sure users' profiles are loaded in the session. If this + * check fails is classified as fatal as even if the connection can succeed, user experience is bad as the user + * profile cannot be loaded and user will get a temporary profile in the session. (Currently Disabled). */ public static final HealthCheckName FSLOGIX_HEALTH_CHECK = fromString("FSLogixHealthCheck"); /** - * Static value SxSStackListenerCheck for HealthCheckName. + * Verifies that the SxS stack is up and running so connections can succeed. If this check fails is classified as + * fatal as no connection can succeed if the SxS stack is not ready. (Currently Enabled). */ public static final HealthCheckName SX_SSTACK_LISTENER_CHECK = fromString("SxSStackListenerCheck"); /** - * Static value UrlsAccessibleCheck for HealthCheckName. + * Verifies that the required WVD service and Geneva URLs are reachable from the SessionHost. These URLs are: + * RdTokenUri, RdBrokerURI, RdDiagnosticsUri and storage blob URLs for agent monitoring (geneva). If this check + * fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is + * unable to store warm path data (logs, operations ...). (Currently Disabled). */ public static final HealthCheckName URLS_ACCESSIBLE_CHECK = fromString("UrlsAccessibleCheck"); /** - * Static value MonitoringAgentCheck for HealthCheckName. + * Verifies that the required Geneva agent is running. If this check fails, it is non fatal and the machine still + * can service connections, main issue may be that monitoring agent is missing or running (possibly) older version. + * (Currently Enabled). */ public static final HealthCheckName MONITORING_AGENT_CHECK = fromString("MonitoringAgentCheck"); /** - * Static value DomainReachable for HealthCheckName. + * Verifies the domain the SessionHost is joined to is still reachable. If this check fails is classified as fatal + * as no connection can succeed if the domain the SessionHost is joined is not reachable at the time of connection. + * (Currently Disabled). */ public static final HealthCheckName DOMAIN_REACHABLE = fromString("DomainReachable"); /** - * Static value WebRTCRedirectorCheck for HealthCheckName. + * Verifies whether the WebRTCRedirector component is healthy. The WebRTCRedirector component is used to optimize + * video and audio performance in Microsoft Teams. This checks whether the component is still running, and whether + * there is a higher version available. If this check fails, it is non fatal and the machine still can service + * connections, main issue may be the WebRTCRedirector component has to be restarted or updated. (Currently + * Disabled). */ public static final HealthCheckName WEB_RTCREDIRECTOR_CHECK = fromString("WebRTCRedirectorCheck"); /** - * Static value SupportedEncryptionCheck for HealthCheckName. + * Verifies the value of SecurityLayer registration key. If the value is 0 (SecurityLayer.RDP) this check fails with + * Error code = NativeMethodErrorCode.E_FAIL and is fatal. If the value is 1 (SecurityLayer.Negotiate) this check + * fails with Error code = NativeMethodErrorCode.ERROR_SUCCESS and is non fatal. (Currently Disabled). */ public static final HealthCheckName SUPPORTED_ENCRYPTION_CHECK = fromString("SupportedEncryptionCheck"); /** - * Static value MetaDataServiceCheck for HealthCheckName. + * Verifies the metadata service is accessible and return compute properties. (Currently Enabled). */ public static final HealthCheckName META_DATA_SERVICE_CHECK = fromString("MetaDataServiceCheck"); /** - * Static value AppAttachHealthCheck for HealthCheckName. + * Verifies that the AppAttachService is healthy (there were no issues during package staging). The AppAttachService + * is used to enable the staging/registration (and eventual de-registration/destaging) of MSIX apps that have been + * set up by the tenant admin. This checks whether the component had any failures during package staging. Failures + * in staging will prevent some MSIX apps from working properly for the end user. If this check fails, it is non + * fatal and the machine still can service connections, main issue may be certain apps will not work for end-users. + * (Currently Enabled). */ public static final HealthCheckName APP_ATTACH_HEALTH_CHECK = fromString("AppAttachHealthCheck"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java index 73d35a4db64a..ce6e5ea9042c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,22 +12,22 @@ */ public final class HealthCheckResult extends ExpandableStringEnum { /** - * Static value Unknown for HealthCheckResult. + * Health check result is not currently known. */ public static final HealthCheckResult UNKNOWN = fromString("Unknown"); /** - * Static value HealthCheckSucceeded for HealthCheckResult. + * Health check passed. */ public static final HealthCheckResult HEALTH_CHECK_SUCCEEDED = fromString("HealthCheckSucceeded"); /** - * Static value HealthCheckFailed for HealthCheckResult. + * Health check failed. */ public static final HealthCheckResult HEALTH_CHECK_FAILED = fromString("HealthCheckFailed"); /** - * Static value SessionHostShutdown for HealthCheckResult. + * We received a Shutdown notification. */ public static final HealthCheckResult SESSION_HOST_SHUTDOWN = fromString("SessionHostShutdown"); 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..3036b5093b8c 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 @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; -import java.util.List; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner; import java.util.Map; /** @@ -53,233 +53,67 @@ 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 properties property: Detailed properties for HostPool. * - * @return the managedBy value. + * @return the properties value. */ - String managedBy(); + HostPoolProperties properties(); /** - * 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 - * validate and persist this value. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the kind value. + * @return the identity value. */ - String kind(); + ManagedServiceIdentity identity(); /** - * 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 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 identity property: The identity property. + * 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 + * validate and persist this value. * - * @return the identity value. + * @return the kind value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + String kind(); /** - * Gets the sku property: The sku property. + * 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 sku value. + * @return the managedBy value. */ - ResourceModelWithAllowedPropertySetSku sku(); + String managedBy(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Details of the resource plan. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of HostPool. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the friendlyName property: Friendly name of HostPool. - * - * @return the friendlyName value. - */ - String friendlyName(); - - /** - * Gets the description property: Description of HostPool. - * - * @return the description value. - */ - String description(); - - /** - * Gets the hostPoolType property: HostPool type for desktop. - * - * @return the hostPoolType value. - */ - HostPoolType hostPoolType(); - - /** - * Gets the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * - * @return the personalDesktopAssignmentType value. - */ - PersonalDesktopAssignmentType personalDesktopAssignmentType(); - - /** - * Gets the customRdpProperty property: Custom rdp property of HostPool. - * - * @return the customRdpProperty value. - */ - String customRdpProperty(); - - /** - * Gets the maxSessionLimit property: The max session limit of HostPool. - * - * @return the maxSessionLimit value. - */ - Integer maxSessionLimit(); + Plan plan(); /** - * Gets the loadBalancerType property: The type of the load balancer. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the loadBalancerType value. - */ - LoadBalancerType loadBalancerType(); - - /** - * Gets the ring property: The ring number of HostPool. - * - * @return the ring value. - */ - Integer ring(); - - /** - * Gets the validationEnvironment property: Is validation environment. - * - * @return the validationEnvironment value. - */ - Boolean validationEnvironment(); - - /** - * Gets the registrationInfo property: The registration info of HostPool. - * - * @return the registrationInfo value. - */ - RegistrationInfo registrationInfo(); - - /** - * Gets the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * - * @return the vmTemplate value. - */ - String vmTemplate(); - - /** - * Gets the applicationGroupReferences property: List of applicationGroup links. - * - * @return the applicationGroupReferences value. - */ - List applicationGroupReferences(); - - /** - * Gets the appAttachPackageReferences property: List of App Attach Package links. - * - * @return the appAttachPackageReferences value. - */ - List appAttachPackageReferences(); - - /** - * Gets the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * - * @return the ssoadfsAuthority value. - */ - String ssoadfsAuthority(); - - /** - * Gets the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * - * @return the ssoClientId value. - */ - String ssoClientId(); - - /** - * Gets the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication - * to ADFS. - * - * @return the ssoClientSecretKeyVaultPath value. - */ - String ssoClientSecretKeyVaultPath(); - - /** - * Gets the ssoSecretType property: The type of single sign on Secret Type. - * - * @return the ssoSecretType value. - */ - SsoSecretType ssoSecretType(); - - /** - * Gets the preferredAppGroupType property: The type of preferred application group type, default to Desktop - * Application Group. - * - * @return the preferredAppGroupType value. - */ - PreferredAppGroupType preferredAppGroupType(); - - /** - * Gets the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * - * @return the startVMOnConnect value. - */ - Boolean startVMOnConnect(); - - /** - * Gets the cloudPcResource property: Is cloud pc resource. - * - * @return the cloudPcResource value. - */ - Boolean cloudPcResource(); - - /** - * Gets the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. - * - * @return the publicNetworkAccess value. - */ - HostpoolPublicNetworkAccess publicNetworkAccess(); - - /** - * Gets the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. - * - * @return the agentUpdate value. + * @return the sku value. */ - AgentUpdateProperties agentUpdate(); + Sku sku(); /** - * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified - * resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the privateEndpointConnections value. + * @return the systemData value. */ - List privateEndpointConnections(); + SystemData systemData(); /** * Gets the region of the resource. @@ -313,8 +147,7 @@ public interface HostPool { * The entirety of the HostPool definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithHostPoolType, DefinitionStages.WithLoadBalancerType, - DefinitionStages.WithPreferredAppGroupType, DefinitionStages.WithCreate { + DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -358,64 +191,29 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithHostPoolType withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the HostPool definition allowing to specify hostPoolType. - */ - interface WithHostPoolType { - /** - * Specifies the hostPoolType property: HostPool type for desktop.. - * - * @param hostPoolType HostPool type for desktop. - * @return the next definition stage. - */ - WithLoadBalancerType withHostPoolType(HostPoolType hostPoolType); - } - - /** - * The stage of the HostPool definition 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. - */ - WithPreferredAppGroupType withLoadBalancerType(LoadBalancerType loadBalancerType); + WithProperties withExistingResourceGroup(String resourceGroupName); } /** - * The stage of the HostPool definition allowing to specify preferredAppGroupType. + * The stage of the HostPool definition allowing to specify properties. */ - interface WithPreferredAppGroupType { + interface WithProperties { /** - * Specifies the preferredAppGroupType property: The type of preferred application group type, default to - * Desktop Application Group. + * Specifies the properties property: Detailed properties for HostPool. * - * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application - * Group. + * @param properties Detailed properties for HostPool. * @return the next definition stage. */ - WithCreate withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); + WithCreate withProperties(HostPoolPropertiesInner properties); } /** * 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, - 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 { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, DefinitionStages.WithSku { /** * Executes the create request. * @@ -446,21 +244,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 +262,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,29 +274,21 @@ interface WithKind { } /** - * The stage of the HostPool definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity property.. - * - * @param identity The identity property. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); - } - - /** - * The stage of the HostPool definition allowing to specify sku. + * The stage of the HostPool definition allowing to specify managedBy. */ - interface WithSku { + interface WithManagedBy { /** - * Specifies the sku property: The sku 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 sku The sku 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 withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withManagedBy(String managedBy); } /** @@ -511,227 +296,25 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. - * - * @param plan The plan property. - * @return the next definition stage. - */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); - } - - /** - * The stage of the HostPool definition allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of HostPool.. - * - * @param friendlyName Friendly name of HostPool. - * @return the next definition stage. - */ - WithCreate withFriendlyName(String friendlyName); - } - - /** - * The stage of the HostPool definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of HostPool.. - * - * @param description Description of HostPool. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the HostPool definition allowing to specify personalDesktopAssignmentType. - */ - interface WithPersonalDesktopAssignmentType { - /** - * Specifies the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool.. + * Specifies the plan property: Details of the resource plan.. * - * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); + WithCreate withPlan(Plan plan); } /** - * The stage of the HostPool definition allowing to specify customRdpProperty. - */ - interface WithCustomRdpProperty { - /** - * Specifies the customRdpProperty property: Custom rdp property of HostPool.. - * - * @param customRdpProperty Custom rdp property of HostPool. - * @return the next definition stage. - */ - WithCreate withCustomRdpProperty(String customRdpProperty); - } - - /** - * The stage of the HostPool definition allowing to specify maxSessionLimit. - */ - interface WithMaxSessionLimit { - /** - * Specifies the maxSessionLimit property: The max session limit of HostPool.. - * - * @param maxSessionLimit The max session limit of HostPool. - * @return the next definition stage. - */ - WithCreate withMaxSessionLimit(Integer maxSessionLimit); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withRing(Integer ring); - } - - /** - * The stage of the HostPool definition allowing to specify validationEnvironment. - */ - interface WithValidationEnvironment { - /** - * Specifies the validationEnvironment property: Is validation environment.. - * - * @param validationEnvironment Is validation environment. - * @return the next definition stage. - */ - WithCreate withValidationEnvironment(Boolean validationEnvironment); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withRegistrationInfo(RegistrationInfoInner registrationInfo); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withVmTemplate(String vmTemplate); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withSsoadfsAuthority(String ssoadfsAuthority); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withSsoClientId(String ssoClientId); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); - } - - /** - * The stage of the HostPool definition 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. - */ - WithCreate withSsoSecretType(SsoSecretType ssoSecretType); - } - - /** - * The stage of the HostPool definition allowing to specify startVMOnConnect. - */ - 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. - */ - WithCreate withStartVMOnConnect(Boolean startVMOnConnect); - } - - /** - * The stage of the HostPool definition allowing to specify publicNetworkAccess. - */ - interface WithPublicNetworkAccess { - /** - * Specifies the publicNetworkAccess property: Enabled allows this resource to be accessed from both public - * and private networks, Disabled allows this resource to only be accessed via private endpoints. - * - * @param publicNetworkAccess Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. - * @return the next definition stage. - */ - WithCreate withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess); - } - - /** - * The stage of the HostPool definition allowing to specify agentUpdate. + * The stage of the HostPool definition allowing to specify sku. */ - interface WithAgentUpdate { + interface WithSku { /** - * Specifies the agentUpdate property: The session host configuration for updating agent, monitoring agent, - * and stack component.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param agentUpdate The session host configuration for updating agent, monitoring agent, and stack - * component. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withAgentUpdate(AgentUpdateProperties agentUpdate); + WithCreate withSku(Sku sku); } } @@ -745,13 +328,7 @@ interface WithAgentUpdate { /** * 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 { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -786,245 +363,29 @@ interface WithTags { } /** - * The stage of the HostPool update allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: Friendly name of HostPool.. - * - * @param friendlyName Friendly name of HostPool. - * @return the next definition stage. - */ - Update withFriendlyName(String friendlyName); - } - - /** - * The stage of the HostPool update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of HostPool.. - * - * @param description Description of HostPool. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the HostPool update allowing to specify customRdpProperty. - */ - interface WithCustomRdpProperty { - /** - * Specifies the customRdpProperty property: Custom rdp property of HostPool.. - * - * @param customRdpProperty Custom rdp property of HostPool. - * @return the next definition stage. - */ - Update withCustomRdpProperty(String customRdpProperty); - } - - /** - * The stage of the HostPool update allowing to specify maxSessionLimit. - */ - interface WithMaxSessionLimit { - /** - * Specifies the maxSessionLimit property: The max session limit of HostPool.. - * - * @param maxSessionLimit The max session limit of HostPool. - * @return the next definition stage. - */ - Update withMaxSessionLimit(Integer maxSessionLimit); - } - - /** - * The stage of the HostPool update allowing to specify personalDesktopAssignmentType. - */ - interface WithPersonalDesktopAssignmentType { - /** - * Specifies the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool.. - * - * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. - * @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); - } - - /** - * 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); - } - - /** - * The stage of the HostPool update allowing to specify preferredAppGroupType. - */ - 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); - } - - /** - * The stage of the HostPool update allowing to specify startVMOnConnect. + * The stage of the HostPool update allowing to specify properties. */ - interface WithStartVMOnConnect { + interface WithProperties { /** - * Specifies the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature.. + * Specifies the properties property: HostPool properties that can be patched.. * - * @param startVMOnConnect The flag to turn on/off StartVMOnConnect feature. + * @param properties HostPool properties that can be patched. * @return the next definition stage. */ - Update withStartVMOnConnect(Boolean startVMOnConnect); + Update withProperties(HostPoolPatchProperties properties); } /** - * The stage of the HostPool update allowing to specify publicNetworkAccess. + * The stage of the HostPool update allowing to specify identity. */ - interface WithPublicNetworkAccess { - /** - * Specifies the publicNetworkAccess property: Enabled to allow this resource to be access from the public - * network. - * - * @param publicNetworkAccess Enabled to allow this resource to be access from the public network. - * @return the next definition stage. - */ - Update withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess); - } - - /** - * The stage of the HostPool update allowing to specify agentUpdate. - */ - interface WithAgentUpdate { + interface WithIdentity { /** - * Specifies the agentUpdate property: The session host configuration for updating agent, monitoring agent, - * and stack component.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param agentUpdate The session host configuration for updating agent, monitoring agent, and stack - * component. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - Update withAgentUpdate(AgentUpdatePatchProperties agentUpdate); + Update withIdentity(ManagedServiceIdentity identity); } } @@ -1044,42 +405,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 as paginated response with {@link PagedIterable}. */ - Response retrieveRegistrationTokenWithResponse(Context context); + PagedIterable listRegistrationTokens(); /** - * 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. + * @return list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ - RegistrationInfo retrieveRegistrationToken(); + PagedIterable listRegistrationTokens(Context context); /** - * 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/HostPoolPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java index 66bd112d6ccc..a5f1731a6aae 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,12 @@ public final class HostPoolPatch extends ProxyResource { /* * HostPool properties that can be patched. */ - private HostPoolPatchProperties innerProperties; + private HostPoolPatchProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -76,483 +80,82 @@ public HostPoolPatch withTags(Map tags) { } /** - * Get the innerProperties property: HostPool properties that can be patched. - * - * @return the innerProperties value. - */ - private HostPoolPatchProperties 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 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. + * Get the properties property: HostPool properties that can be patched. * - * @return the customRdpProperty value. + * @return the properties value. */ - public String customRdpProperty() { - return this.innerProperties() == null ? null : this.innerProperties().customRdpProperty(); + public HostPoolPatchProperties properties() { + return this.properties; } /** - * Set the customRdpProperty property: Custom rdp property of HostPool. + * Set the properties property: HostPool properties that can be patched. * - * @param customRdpProperty the customRdpProperty value to set. + * @param properties the properties 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); + public HostPoolPatch withProperties(HostPoolPatchProperties properties) { + this.properties = properties; return this; } /** - * Get the maxSessionLimit property: The max session limit of HostPool. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the maxSessionLimit value. + * @return the identity value. */ - public Integer maxSessionLimit() { - return this.innerProperties() == null ? null : this.innerProperties().maxSessionLimit(); + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Set the maxSessionLimit property: The max session limit of HostPool. + * Set the identity property: The managed service identities assigned to this resource. * - * @param maxSessionLimit the maxSessionLimit value to set. + * @param identity the identity 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); + public HostPoolPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; 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. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the HostPoolPatch object itself. + * @return the systemData value. */ - public HostPoolPatch withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. + * Get the type property: The type of the resource. * - * @return the agentUpdate value. + * @return the type value. */ - public AgentUpdatePatchProperties agentUpdate() { - return this.innerProperties() == null ? null : this.innerProperties().agentUpdate(); + @Override + public String type() { + return this.type; } /** - * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack - * component. + * Get the name property: The name of the resource. * - * @param agentUpdate the agentUpdate value to set. - * @return the HostPoolPatch object itself. + * @return the name value. */ - public HostPoolPatch withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { - if (this.innerProperties() == null) { - this.innerProperties = new HostPoolPatchProperties(); - } - this.innerProperties().withAgentUpdate(agentUpdate); - return this; + @Override + public String name() { + return this.name; } /** - * Validates the instance. + * Get the id property: Fully qualified resource Id for the resource. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the id value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + @Override + public String id() { + return this.id; } /** @@ -562,7 +165,8 @@ 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); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -592,7 +196,9 @@ 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 ("identity".equals(fieldName)) { + deserializedHostPoolPatch.identity = ManagedServiceIdentity.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 68% 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..3dfe83b86c4b 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 @@ -1,21 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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,43 @@ 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 deploymentScope property: DeploymentScope type for HostPool. + * + * @return the deploymentScope value. + */ + DeploymentScope deploymentScope(); + + /** + * Gets the oboTenantId property: Tenant that the resource is being requested on behalf of. + * + * @return the oboTenantId value. + */ + String oboTenantId(); + + /** + * Gets the allowRDPShortPathWithPrivateLink property: Controls if the use of RDPShortPath transport is allowed, + * possibly bypassing Private Link routes. + * + * @return the allowRDPShortPathWithPrivateLink value. + */ + AllowRDPShortPathWithPrivateLink allowRDPShortPathWithPrivateLink(); + /** * 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/HostPoolProvisioningAction.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningAction.java new file mode 100644 index 000000000000..a9968622f097 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningAction.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action types for controlling hostpool provisioning. + */ +public final class HostPoolProvisioningAction extends ExpandableStringEnum { + /** + * Cancel the hostpool provisioning. + */ + public static final HostPoolProvisioningAction CANCEL = fromString("Cancel"); + + /** + * Creates a new instance of HostPoolProvisioningAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostPoolProvisioningAction() { + } + + /** + * Creates or finds a HostPoolProvisioningAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostPoolProvisioningAction. + */ + public static HostPoolProvisioningAction fromString(String name) { + return fromString(name, HostPoolProvisioningAction.class); + } + + /** + * Gets known HostPoolProvisioningAction values. + * + * @return known HostPoolProvisioningAction values. + */ + public static Collection values() { + return values(HostPoolProvisioningAction.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningControlParameter.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningControlParameter.java new file mode 100644 index 000000000000..6548bac25f37 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningControlParameter.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Object containing control action for hostpool provisioning. + */ +@Fluent +public final class HostPoolProvisioningControlParameter + implements JsonSerializable { + /* + * Action types for controlling hostpool update. + */ + private HostPoolProvisioningAction action; + + /* + * The cancel message sent to the user on the session host. + */ + private String cancelMessage; + + /** + * Creates an instance of HostPoolProvisioningControlParameter class. + */ + public HostPoolProvisioningControlParameter() { + } + + /** + * Get the action property: Action types for controlling hostpool update. + * + * @return the action value. + */ + public HostPoolProvisioningAction action() { + return this.action; + } + + /** + * Set the action property: Action types for controlling hostpool update. + * + * @param action the action value to set. + * @return the HostPoolProvisioningControlParameter object itself. + */ + public HostPoolProvisioningControlParameter withAction(HostPoolProvisioningAction action) { + this.action = action; + return this; + } + + /** + * Get the cancelMessage property: The cancel message sent to the user on the session host. + * + * @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. + * + * @param cancelMessage the cancelMessage value to set. + * @return the HostPoolProvisioningControlParameter object itself. + */ + public HostPoolProvisioningControlParameter withCancelMessage(String cancelMessage) { + this.cancelMessage = cancelMessage; + return this; + } + + /** + * {@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 HostPoolProvisioningControlParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolProvisioningControlParameter 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 HostPoolProvisioningControlParameter. + */ + public static HostPoolProvisioningControlParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolProvisioningControlParameter deserializedHostPoolProvisioningControlParameter + = new HostPoolProvisioningControlParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedHostPoolProvisioningControlParameter.action + = HostPoolProvisioningAction.fromString(reader.getString()); + } else if ("cancelMessage".equals(fieldName)) { + deserializedHostPoolProvisioningControlParameter.cancelMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolProvisioningControlParameter; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java index 7099c7232561..c2a68d61f7c9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,20 @@ */ public final class HostPoolType extends ExpandableStringEnum { /** - * Static value Personal for HostPoolType. + * Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon + * connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their + * assigned SessionHost. */ public static final HostPoolType PERSONAL = fromString("Personal"); /** - * Static value Pooled for HostPoolType. + * Users get a new (random) SessionHost every time it connects to the HostPool. */ public static final HostPoolType POOLED = fromString("Pooled"); /** - * Static value BYODesktop for HostPoolType. + * Users assign their own machines, load balancing logic remains the same as Personal. PersonalDesktopAssignmentType + * must be Direct. */ public static final HostPoolType BYODESKTOP = fromString("BYODesktop"); 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..270190f85f3c --- /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) TypeSpec 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 { + /** + * Start the hostpool update. + */ + public static final HostPoolUpdateAction START = fromString("Start"); + + /** + * Pause the hostpool update. + */ + public static final HostPoolUpdateAction PAUSE = fromString("Pause"); + + /** + * Cancel the hostpool update. + */ + public static final HostPoolUpdateAction CANCEL = fromString("Cancel"); + + /** + * Retry the hostpool update. + */ + public static final HostPoolUpdateAction RETRY = fromString("Retry"); + + /** + * Resume the hostpool update. + */ + 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..732ab74de997 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationPatchProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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..d3b51f032c64 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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..c97dffc2caf6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateControlParameter.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + +/** + * 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; + } + + /** + * {@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..d7847077a456 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -69,7 +69,7 @@ public interface HostPools { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -84,7 +84,7 @@ public interface HostPools { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -94,7 +94,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer pa * * @throws com.azure.core.management.exception.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 list of HostPool definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -108,38 +108,38 @@ 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 hostPoolList as paginated response with {@link PagedIterable}. + * @return list of HostPool definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. */ - Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, - Context context); + PagedIterable listRegistrationTokens(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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. */ - RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName); + PagedIterable listRegistrationTokens(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. @@ -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..0a191c1ca196 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -8,28 +8,27 @@ 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 { /** - * Static value Enabled for HostpoolPublicNetworkAccess. + * Allows this resource to be accessed from the public network. */ public static final HostpoolPublicNetworkAccess ENABLED = fromString("Enabled"); /** - * Static value Disabled for HostpoolPublicNetworkAccess. + * Prevents this resource from being accessed from the public network. */ public static final HostpoolPublicNetworkAccess DISABLED = fromString("Disabled"); /** - * Static value EnabledForSessionHostsOnly for HostpoolPublicNetworkAccess. + * Allows SessionHosts to be accessed from the public network. */ public static final HostpoolPublicNetworkAccess ENABLED_FOR_SESSION_HOSTS_ONLY = fromString("EnabledForSessionHostsOnly"); /** - * Static value EnabledForClientsOnly for HostpoolPublicNetworkAccess. + * Allows Clients to be accessed from the public network. */ public static final HostpoolPublicNetworkAccess ENABLED_FOR_CLIENTS_ONLY = fromString("EnabledForClientsOnly"); 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..a9d61fbe2142 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoPatchProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Image configurations of session host in a HostPool. + */ +@Fluent +public final class ImageInfoPatchProperties implements JsonSerializable { + /* + * The type of image session hosts use in the hostpool. + */ + private Type imageType; + + /* + * The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + */ + private MarketplaceInfoPatchProperties marketplaceInfo; + + /* + * The values to uniquely identify a custom image. Only one should be populated based on the image type. + */ + private CustomInfoPatchProperties customInfo; + + /** + * Creates an instance of ImageInfoPatchProperties class. + */ + public ImageInfoPatchProperties() { + } + + /** + * Get the imageType property: The type of image session hosts use in the hostpool. + * + * @return the imageType value. + */ + public Type imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of image session hosts use in the hostpool. + * + * @param imageType the imageType value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withImageType(Type imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @return the marketplaceInfo value. + */ + public MarketplaceInfoPatchProperties marketplaceInfo() { + return this.marketplaceInfo; + } + + /** + * Set the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @param marketplaceInfo the marketplaceInfo value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withMarketplaceInfo(MarketplaceInfoPatchProperties marketplaceInfo) { + this.marketplaceInfo = marketplaceInfo; + return this; + } + + /** + * Get the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @return the customInfo value. + */ + public CustomInfoPatchProperties customInfo() { + return this.customInfo; + } + + /** + * Set the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @param customInfo the customInfo value to set. + * @return the ImageInfoPatchProperties object itself. + */ + public ImageInfoPatchProperties withCustomInfo(CustomInfoPatchProperties customInfo) { + this.customInfo = customInfo; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.imageType == null ? null : this.imageType.toString()); + jsonWriter.writeJsonField("marketplaceInfo", this.marketplaceInfo); + jsonWriter.writeJsonField("customInfo", this.customInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageInfoPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageInfoPatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageInfoPatchProperties. + */ + public static ImageInfoPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageInfoPatchProperties deserializedImageInfoPatchProperties = new ImageInfoPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedImageInfoPatchProperties.imageType = Type.fromString(reader.getString()); + } else if ("marketplaceInfo".equals(fieldName)) { + deserializedImageInfoPatchProperties.marketplaceInfo + = MarketplaceInfoPatchProperties.fromJson(reader); + } else if ("customInfo".equals(fieldName)) { + deserializedImageInfoPatchProperties.customInfo = CustomInfoPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageInfoPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java new file mode 100644 index 000000000000..6570fe784744 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ImageInfoProperties implements JsonSerializable { + /* + * The type of image session hosts use in the hostpool. + */ + private Type imageType; + + /* + * The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + */ + private MarketplaceInfoProperties marketplaceInfo; + + /* + * The values to uniquely identify a custom image. Only one should be populated based on the image type. + */ + private CustomInfoProperties customInfo; + + /** + * Creates an instance of ImageInfoProperties class. + */ + public ImageInfoProperties() { + } + + /** + * Get the imageType property: The type of image session hosts use in the hostpool. + * + * @return the imageType value. + */ + public Type imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of image session hosts use in the hostpool. + * + * @param imageType the imageType value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withImageType(Type imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @return the marketplaceInfo value. + */ + public MarketplaceInfoProperties marketplaceInfo() { + return this.marketplaceInfo; + } + + /** + * Set the marketplaceInfo property: The values to uniquely identify a marketplace image. Only one should be + * populated based on the image type. + * + * @param marketplaceInfo the marketplaceInfo value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withMarketplaceInfo(MarketplaceInfoProperties marketplaceInfo) { + this.marketplaceInfo = marketplaceInfo; + return this; + } + + /** + * Get the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @return the customInfo value. + */ + public CustomInfoProperties customInfo() { + return this.customInfo; + } + + /** + * Set the customInfo property: The values to uniquely identify a custom image. Only one should be populated based + * on the image type. + * + * @param customInfo the customInfo value to set. + * @return the ImageInfoProperties object itself. + */ + public ImageInfoProperties withCustomInfo(CustomInfoProperties customInfo) { + this.customInfo = customInfo; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.imageType == null ? null : this.imageType.toString()); + jsonWriter.writeJsonField("marketplaceInfo", this.marketplaceInfo); + jsonWriter.writeJsonField("customInfo", this.customInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageInfoProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageInfoProperties. + */ + public static ImageInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageInfoProperties deserializedImageInfoProperties = new ImageInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedImageInfoProperties.imageType = Type.fromString(reader.getString()); + } else if ("marketplaceInfo".equals(fieldName)) { + deserializedImageInfoProperties.marketplaceInfo = MarketplaceInfoProperties.fromJson(reader); + } else if ("customInfo".equals(fieldName)) { + deserializedImageInfoProperties.customInfo = CustomInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java index 4c420a71a61b..90acc69e61d3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -74,14 +74,6 @@ public ImportPackageInfoRequest withPackageArchitecture(AppAttachPackageArchitec return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..8ec9cd92aa6c --- /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) TypeSpec 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..360f5cfdefc5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsPatchProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..acd4f832c6f3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 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; + } + + /** + * {@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..a5390f35440d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,20 +12,25 @@ */ public final class LoadBalancerType extends ExpandableStringEnum { /** - * Static value BreadthFirst for LoadBalancerType. + * Uses BreadthFirst algorithm for load balancing. */ public static final LoadBalancerType BREADTH_FIRST = fromString("BreadthFirst"); /** - * Static value DepthFirst for LoadBalancerType. + * Uses DepthFirst algorithm for load balancing. */ public static final LoadBalancerType DEPTH_FIRST = fromString("DepthFirst"); /** - * Static value Persistent for LoadBalancerType. + * Maintains persistent connections. */ public static final LoadBalancerType PERSISTENT = fromString("Persistent"); + /** + * Maintains multiple persistents connections. + */ + public static final LoadBalancerType MULTIPLE_PERSISTENT = fromString("MultiplePersistent"); + /** * Creates a new instance of LoadBalancerType value. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java index 8eb95ebd6191..da121d44bc8a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Specifications of the Log for Azure Monitoring. */ -@Fluent +@Immutable public final class LogSpecification implements JsonSerializable { /* * Name of the log @@ -34,7 +34,7 @@ public final class LogSpecification implements JsonSerializable { + /* + * Managed Disk information. + */ + private VirtualMachineDiskType type; + + /** + * Creates an instance of ManagedDiskProperties class. + */ + public ManagedDiskProperties() { + } + + /** + * Get the type property: Managed Disk information. + * + * @return the type value. + */ + public VirtualMachineDiskType type() { + return this.type; + } + + /** + * Set the type property: Managed Disk information. + * + * @param type the type value to set. + * @return the ManagedDiskProperties object itself. + */ + public ManagedDiskProperties withType(VirtualMachineDiskType type) { + this.type = type; + return this; + } + + /** + * {@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 ManagedDiskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedDiskProperties 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 ManagedDiskProperties. + */ + public static ManagedDiskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedDiskProperties deserializedManagedDiskProperties = new ManagedDiskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedDiskProperties.type = VirtualMachineDiskType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedDiskProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedPrivateUDP.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedPrivateUDP.java new file mode 100644 index 000000000000..c1b59a504c81 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedPrivateUDP.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Managed Private UDP Connection Settings. + */ +public final class ManagedPrivateUDP extends ExpandableStringEnum { + /** + * AVD-wide settings are used to determine connection availability. + */ + public static final ManagedPrivateUDP DEFAULT = fromString("Default"); + + /** + * UDP will attempt this connection type when making connections. + */ + public static final ManagedPrivateUDP ENABLED = fromString("Enabled"); + + /** + * UDP will not attempt this connection type when making connections. + */ + 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..70602ba70c81 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/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..27b406e365e2 --- /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) TypeSpec 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 { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/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..b4feea15d6a4 --- /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) TypeSpec 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 { + /** + * Automated management of the hostpool. + */ + public static final ManagementType AUTOMATED = fromString("Automated"); + + /** + * Standard management of the hostpool. + */ + 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..6b6975ab0965 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoPatchProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..677fb0d9e26f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 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; + } + + /** + * {@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/MsixImageUri.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java index 89e7251e10a7..43ae9ad5837c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -47,14 +47,6 @@ public MsixImageUri withUri(String uri) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..2c5a14e58567 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,29 +13,33 @@ 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 Represents URI referring to MSIX Image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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); + 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 Represents URI referring to MSIX Image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, + 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..3074e530c3e6 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 @@ -1,14 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; -import java.time.OffsetDateTime; -import java.util.List; /** * An immutable client-side representation of MsixPackage. @@ -36,89 +34,18 @@ public interface MsixPackage { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * 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 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. - * - * @return the packageRelativePath value. - */ - String packageRelativePath(); - - /** - * 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. + * Gets the properties property: Detailed properties for MSIX Package. * - * @return the packageDependencies value. + * @return the properties value. */ - List packageDependencies(); + MsixPackageProperties properties(); /** - * 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. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the packageApplications value. + * @return the systemData value. */ - List packageApplications(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -137,8 +64,8 @@ public interface MsixPackage { /** * The entirety of the MsixPackage definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -162,18 +89,27 @@ interface WithParentResource { * @param hostPoolName The name of the host pool within the specified resource group. * @return the next definition stage. */ - WithCreate withExistingHostPool(String resourceGroupName, String hostPoolName); + WithProperties withExistingHostPool(String resourceGroupName, String hostPoolName); + } + + /** + * The stage of the MsixPackage definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for MSIX Package. + * + * @param properties Detailed properties for MSIX Package. + * @return the next definition stage. + */ + WithCreate withProperties(MsixPackageProperties properties); } /** * The stage of the MsixPackage 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.WithImagePath, DefinitionStages.WithPackageName, - DefinitionStages.WithPackageFamilyName, DefinitionStages.WithDisplayName, - DefinitionStages.WithPackageRelativePath, DefinitionStages.WithIsRegularRegistration, - DefinitionStages.WithIsActive, DefinitionStages.WithPackageDependencies, DefinitionStages.WithVersion, - DefinitionStages.WithLastUpdated, DefinitionStages.WithPackageApplications { + interface WithCreate { /** * Executes the create request. * @@ -189,151 +125,6 @@ interface WithCreate extends DefinitionStages.WithImagePath, DefinitionStages.Wi */ MsixPackage create(Context context); } - - /** - * The stage of the MsixPackage definition allowing to specify imagePath. - */ - interface WithImagePath { - /** - * Specifies the imagePath property: VHD/CIM image path on Network Share.. - * - * @param imagePath VHD/CIM image path on Network Share. - * @return the next definition stage. - */ - WithCreate withImagePath(String imagePath); - } - - /** - * The stage of the MsixPackage definition allowing to specify packageName. - */ - interface WithPackageName { - /** - * Specifies the packageName property: Package Name from appxmanifest.xml. . - * - * @param packageName Package Name from appxmanifest.xml. - * @return the next definition stage. - */ - WithCreate withPackageName(String packageName); - } - - /** - * The stage of the MsixPackage definition allowing to specify packageFamilyName. - */ - interface WithPackageFamilyName { - /** - * Specifies the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package - * Name and Publisher name. . - * - * @param packageFamilyName Package Family Name from appxmanifest.xml. Contains Package Name and Publisher - * name. - * @return the next definition stage. - */ - WithCreate withPackageFamilyName(String packageFamilyName); - } - - /** - * The stage of the MsixPackage definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * 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. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the MsixPackage definition allowing to specify packageRelativePath. - */ - interface WithPackageRelativePath { - /** - * 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. - */ - WithCreate withPackageRelativePath(String packageRelativePath); - } - - /** - * The stage of the MsixPackage definition allowing to specify isRegularRegistration. - */ - interface WithIsRegularRegistration { - /** - * Specifies the isRegularRegistration property: Specifies how to register Package in feed.. - * - * @param isRegularRegistration Specifies how to register Package in feed. - * @return the next definition stage. - */ - WithCreate withIsRegularRegistration(Boolean isRegularRegistration); - } - - /** - * The stage of the MsixPackage definition allowing to specify isActive. - */ - interface WithIsActive { - /** - * 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. - */ - WithCreate withIsActive(Boolean isActive); - } - - /** - * The stage of the MsixPackage definition allowing to specify packageDependencies. - */ - interface WithPackageDependencies { - /** - * Specifies the packageDependencies property: List of package dependencies. . - * - * @param packageDependencies List of package dependencies. - * @return the next definition stage. - */ - WithCreate withPackageDependencies(List packageDependencies); - } - - /** - * The stage of the MsixPackage definition allowing to specify version. - */ - interface WithVersion { - /** - * 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. - */ - WithCreate withVersion(String version); - } - - /** - * The stage of the MsixPackage definition allowing to specify lastUpdated. - */ - interface WithLastUpdated { - /** - * 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. - */ - WithCreate withLastUpdated(OffsetDateTime lastUpdated); - } - - /** - * The stage of the MsixPackage definition allowing to specify packageApplications. - */ - interface WithPackageApplications { - /** - * Specifies the packageApplications property: List of package applications. . - * - * @param packageApplications List of package applications. - * @return the next definition stage. - */ - WithCreate withPackageApplications(List packageApplications); - } } /** @@ -346,8 +137,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 +159,16 @@ interface Update */ interface UpdateStages { /** - * The stage of the MsixPackage update allowing to specify isActive. - */ - 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. + * The stage of the MsixPackage update allowing to specify properties. */ - 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/MsixPackageApplications.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java index f9a131e740fa..bb90aedcf952 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -30,7 +30,7 @@ public final class MsixPackageApplications implements JsonSerializable e.validate()); - } - if (packageApplications() != null) { - packageApplications().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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..f1255ccf5a94 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -75,7 +75,7 @@ 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 msixPackageList as paginated response with {@link PagedIterable}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String hostPoolName); @@ -91,7 +91,7 @@ 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 msixPackageList as paginated response with {@link PagedIterable}. + * @return list of MSIX Package definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); 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..7da275e8a9b8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoPatchProperties.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..741cf3dddad9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 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; + } + + /** + * {@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/OperationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java index d4bfacf7d23e..2d7232f20a73 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Properties of the operation. */ -@Fluent +@Immutable public final class OperationProperties implements JsonSerializable { /* * Service specification payload @@ -24,7 +24,7 @@ public final class OperationProperties implements JsonSerializable 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/PackageTimestamped.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java index 2e42460e4d53..e8db3b0654b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class PackageTimestamped extends ExpandableStringEnum { /** - * Static value Timestamped for PackageTimestamped. + * Package is timestamped. */ public static final PackageTimestamped TIMESTAMPED = fromString("Timestamped"); /** - * Static value NotTimestamped for PackageTimestamped. + * Package is not timestamped, use certificate expiry date. */ public static final PackageTimestamped NOT_TIMESTAMPED = fromString("NotTimestamped"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java index 2afe39a19ec3..431d17f1d983 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class PersonalDesktopAssignmentType extends ExpandableStringEnum { /** - * Static value Automatic for PersonalDesktopAssignmentType. + * Automatically assigns an available personal desktop to the user. */ public static final PersonalDesktopAssignmentType AUTOMATIC = fromString("Automatic"); /** - * Static value Direct for PersonalDesktopAssignmentType. + * Manually assigns a specific personal desktop to the user. */ public static final PersonalDesktopAssignmentType DIRECT = fromString("Direct"); 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..1e22ff8ccbc7 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -16,7 +15,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. */ @@ -153,26 +152,6 @@ public Plan withVersion(String version) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Plan")); - } - if (publisher() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property publisher in model Plan")); - } - if (product() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property product in model Plan")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Plan.class); - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java index 124466af81c7..054935aec6f0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,17 @@ */ public final class PreferredAppGroupType extends ExpandableStringEnum { /** - * Static value None for PreferredAppGroupType. + * Internal Use Only. */ public static final PreferredAppGroupType NONE = fromString("None"); /** - * Static value Desktop for PreferredAppGroupType. + * Use Desktop Application Group. */ public static final PreferredAppGroupType DESKTOP = fromString("Desktop"); /** - * Static value RailApplications for PreferredAppGroupType. + * Use RailApplications (RemoteApp). */ public static final PreferredAppGroupType RAIL_APPLICATIONS = fromString("RailApplications"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java index c4987ad99041..1a3ea2781332 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -36,14 +36,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..93e2785444de 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 @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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.fluent.models.PrivateEndpointConnectionProperties; import java.io.IOException; -import java.util.List; /** * The private endpoint connection resource. */ -@Fluent -public class PrivateEndpointConnection extends ProxyResource { +@Immutable +public final class PrivateEndpointConnection extends ProxyResource { /* * Resource properties. */ - private PrivateEndpointConnectionProperties innerProperties; + private PrivateEndpointConnectionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -47,27 +45,16 @@ public class PrivateEndpointConnection extends ProxyResource { /** * Creates an instance of PrivateEndpointConnection class. */ - public PrivateEndpointConnection() { + private 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; - } - - /** - * Set the innerProperties property: Resource properties. - * - * @param innerProperties the innerProperties value to set. - * @return the PrivateEndpointConnection object itself. - */ - PrivateEndpointConnection withInnerProperties(PrivateEndpointConnectionProperties innerProperties) { - this.innerProperties = innerProperties; - return this; + public PrivateEndpointConnectionProperties properties() { + return this.properties; } /** @@ -79,17 +66,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,91 +96,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +129,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/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProperties.java similarity index 83% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProperties.java index cc7adc4c52ce..3e18321a177a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProperties.java @@ -1,18 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; import java.io.IOException; import java.util.List; @@ -109,26 +105,6 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java index 33488bd3ae0c..126e8d5b2227 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,22 +13,22 @@ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + * Provisioning was successful. */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Creating for PrivateEndpointConnectionProvisioningState. + * A PrivateEndpointConnection is being created. */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. + * A PrivateEndpointConnection is being deleted. */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. + * Provisioning failed. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java index eb50adcefc29..0fafa1ef78a3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import java.util.List; /** * An immutable client-side representation of PrivateEndpointConnectionWithSystemData. @@ -34,40 +33,18 @@ public interface PrivateEndpointConnectionWithSystemData { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - List groupIds(); - - /** - * Gets the privateEndpoint property: The private endpoint resource. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the privateEndpoint value. + * @return the properties value. */ - PrivateEndpoint privateEndpoint(); + PrivateEndpointConnectionProperties properties(); /** - * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the - * connection between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); - - /** - * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the provisioningState value. + * @return the systemData value. */ - PrivateEndpointConnectionProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the inner 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..32163912d78b 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 @@ -1,263 +1,252 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName); + Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, 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 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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData. */ - PagedIterable listByWorkspace(String resourceGroupName, - String workspaceName, Context context); + PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 a private endpoint connection along with {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response getByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, Context context); + Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @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 private endpoint connection. + * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a 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 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 {@link Response}. */ - Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context); /** - * Remove a 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 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. */ - void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with hostpool. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ - Response updateByWorkspaceWithResponse(String resourceGroupName, - String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName); /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with hostpool. * * @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 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 the Private Endpoint Connection resource. + * @return list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ - PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context 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. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData along with {@link Response}. */ - PagedIterable listByHostPool(String resourceGroupName, - String hostPoolName); + Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context 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 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. + * @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 PagedIterable}. + * @return a PrivateEndpointConnectionWithSystemData. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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 a private endpoint connection along with {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response getByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, Context context); + Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnectionWithSystemDataInner connection, Context context); /** - * Get a private endpoint connection. + * Approve or reject a private endpoint connection. * * @param resourceGroupName The 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 private endpoint connection. + * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionWithSystemDataInner connection); /** - * Remove a 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 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 {@link Response}. */ - Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** - * Remove a 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 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. */ - void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + void deleteByWorkspace(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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 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 the Private Endpoint Connection resource along with {@link Response}. + * @return list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ - Response updateByHostPoolWithResponse(String resourceGroupName, - String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, - Context context); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); /** - * Approve or reject a private endpoint connection. + * List private endpoint connections associated with 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 list of private endpoint connection associated with the specified HostPool as paginated response with + * {@link PagedIterable}. */ - PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, - String privateEndpointConnectionName, PrivateEndpointConnection connection); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java index f5f95a6ea5df..86f901bdece5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,17 +13,17 @@ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. + * Connection is Pending. */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. + * Connection was Approved. */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. + * Connection was rejected. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); 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..44abb6b0def7 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; 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/fluent/models/PrivateLinkResourceProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceProperties.java similarity index 81% 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..dcbcfdeda717 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Properties of a private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. @@ -35,7 +35,7 @@ public final class PrivateLinkResourceProperties implements JsonSerializable requiredZoneNames() { return this.requiredZoneNames; } - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..1b547753fae1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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/PrivateLinkServiceConnectionState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java index 56f0a4d9d858..561b660e0db9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -101,14 +101,6 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java index 760c92bc42cc..92265b13ce9b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,22 +12,22 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ProvisioningState. + * Provisioning Successful. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Provisioning for ProvisioningState. + * Provisioning in Progress. */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); /** - * Static value Failed for ProvisioningState. + * Provisioning Failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Provisioning was Canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); 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..3c409fe62d96 --- /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) TypeSpec 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 { + /** + * Provisioning Successful. + */ + public static final ProvisioningStateSHC SUCCEEDED = fromString("Succeeded"); + + /** + * Provisioning Failed. + */ + public static final ProvisioningStateSHC FAILED = fromString("Failed"); + + /** + * Provisioning was Canceled. + */ + public static final ProvisioningStateSHC CANCELED = fromString("Canceled"); + + /** + * Provisioning in Progress. + */ + 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..9ec89c49d8c6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -8,17 +8,16 @@ 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 { /** - * Static value Enabled for PublicNetworkAccess. + * This resource is accessible from the public network. */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); /** - * Static value Disabled for PublicNetworkAccess. + * This resource is not accessible from the public network. */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); 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..1315003c3fe1 --- /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) TypeSpec 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 { + /** + * AVD-wide settings are used to determine connection availability. + */ + public static final PublicUDP DEFAULT = fromString("Default"); + + /** + * UDP will attempt this connection type when making connections. + */ + public static final PublicUDP ENABLED = fromString("Enabled"); + + /** + * UDP will not attempt this connection type when making connections. + */ + 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/RegistrationInfo.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java index b89d4ebb1ccd..8fb501455e04 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java index 62437ac69794..28144108ed1f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -75,14 +75,6 @@ public RegistrationInfoPatch withRegistrationTokenOperation(RegistrationTokenOpe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java index e5400f51275e..e419a3b92830 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java index 447cd1c8fe76..dabfeea5658f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java @@ -1,126 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; /** - * Represents a Minimal set of properties for RegistrationToken definition. + * An immutable client-side representation of RegistrationTokenMinimal. */ -@Fluent -public final class RegistrationTokenMinimal implements JsonSerializable { - /* - * Expiration time of registration token. - */ - private OffsetDateTime expirationTime; - - /* - * The registration token base64 encoded string. - */ - private String token; - - /** - * Creates an instance of RegistrationTokenMinimal class. - */ - public RegistrationTokenMinimal() { - } - +public interface RegistrationTokenMinimal { /** - * Get the expirationTime property: Expiration time of registration token. + * Gets the expirationTime property: Expiration time of registration token. * * @return the expirationTime value. */ - public OffsetDateTime expirationTime() { - return this.expirationTime; - } - - /** - * Set the expirationTime property: Expiration time of registration token. - * - * @param expirationTime the expirationTime value to set. - * @return the RegistrationTokenMinimal object itself. - */ - public RegistrationTokenMinimal withExpirationTime(OffsetDateTime expirationTime) { - this.expirationTime = expirationTime; - return this; - } + OffsetDateTime expirationTime(); /** - * Get the token property: The registration token base64 encoded string. + * Gets the token property: The registration token base64 encoded string. * * @return the token value. */ - public String token() { - return this.token; - } - - /** - * Set the token property: The registration token base64 encoded string. - * - * @param token the token value to set. - * @return the RegistrationTokenMinimal object itself. - */ - public RegistrationTokenMinimal withToken(String token) { - this.token = token; - 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("expirationTime", - this.expirationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTime)); - jsonWriter.writeStringField("token", this.token); - return jsonWriter.writeEndObject(); - } + String token(); /** - * Reads an instance of RegistrationTokenMinimal from the JsonReader. + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner + * object. * - * @param jsonReader The JsonReader being read. - * @return An instance of RegistrationTokenMinimal 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 RegistrationTokenMinimal. + * @return the inner object. */ - public static RegistrationTokenMinimal fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegistrationTokenMinimal deserializedRegistrationTokenMinimal = new RegistrationTokenMinimal(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expirationTime".equals(fieldName)) { - deserializedRegistrationTokenMinimal.expirationTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("token".equals(fieldName)) { - deserializedRegistrationTokenMinimal.token = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRegistrationTokenMinimal; - }); - } + RegistrationTokenMinimalInner innerModel(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java index 1d35a425b3e0..957e0560f22f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,17 @@ */ public final class RegistrationTokenOperation extends ExpandableStringEnum { /** - * Static value Delete for RegistrationTokenOperation. + * Delete operation. */ public static final RegistrationTokenOperation DELETE = fromString("Delete"); /** - * Static value None for RegistrationTokenOperation. + * No Operation. */ public static final RegistrationTokenOperation NONE = fromString("None"); /** - * Static value Update for RegistrationTokenOperation. + * Update Operation. */ public static final RegistrationTokenOperation UPDATE = fromString("Update"); 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..4042c7d10251 --- /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) TypeSpec 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 { + /** + * AVD-wide settings are used to determine connection availability. + */ + public static final RelayUDP DEFAULT = fromString("Default"); + + /** + * UDP will attempt this connection type when making connections. + */ + public static final RelayUDP ENABLED = fromString("Enabled"); + + /** + * UDP will not attempt this connection type when making connections. + */ + 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/RemoteApplicationType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java index 7d152191e6e1..20d76082418c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class RemoteApplicationType extends ExpandableStringEnum { /** - * Static value InBuilt for RemoteApplicationType. + * Built-in applications. */ public static final RemoteApplicationType IN_BUILT = fromString("InBuilt"); /** - * Static value MsixApplication for RemoteApplicationType. + * Imported MSIX application packages. */ public static final RemoteApplicationType MSIX_APPLICATION = fromString("MsixApplication"); 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/ResourceProviderOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java index 1b40ef2ba3da..ac01223b3244 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java index c8cdb5eb938f..6a80cb837885 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Display metadata associated with the operation. */ -@Fluent +@Immutable public final class ResourceProviderOperationDisplay implements JsonSerializable { /* * Resource provider: Microsoft Desktop Virtualization. @@ -39,7 +39,7 @@ public final class ResourceProviderOperationDisplay implements JsonSerializable< /** * Creates an instance of ResourceProviderOperationDisplay class. */ - public ResourceProviderOperationDisplay() { + private ResourceProviderOperationDisplay() { } /** @@ -51,17 +51,6 @@ public String provider() { return this.provider; } - /** - * Set the provider property: Resource provider: Microsoft Desktop Virtualization. - * - * @param provider the provider value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - /** * Get the resource property: Resource on which the operation is performed. * @@ -71,17 +60,6 @@ public String resource() { return this.resource; } - /** - * Set the resource property: Resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - /** * Get the operation property: Type of operation: get, read, delete, etc. * @@ -91,17 +69,6 @@ public String operation() { return this.operation; } - /** - * Set the operation property: Type of operation: get, read, delete, etc. - * - * @param operation the operation value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - /** * Get the description property: Description of this operation. * @@ -111,25 +78,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description of this operation. - * - * @param description the description value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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/ScalingHostPoolReference.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java index 434efa40134c..bdd5fb8eb4c1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -72,14 +72,6 @@ public ScalingHostPoolReference withScalingPlanEnabled(Boolean scalingPlanEnable return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..93105a3c8873 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,10 +12,17 @@ */ public final class ScalingHostPoolType extends ExpandableStringEnum { /** - * Static value Pooled for ScalingHostPoolType. + * Users get a new (random) SessionHost every time it connects to the HostPool. */ public static final ScalingHostPoolType POOLED = fromString("Pooled"); + /** + * Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon + * connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their + * assigned SessionHost. + */ + public static final ScalingHostPoolType PERSONAL = fromString("Personal"); + /** * Creates a new instance of ScalingHostPoolType value. * diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingMethodType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingMethodType.java new file mode 100644 index 000000000000..f31471e9bdf8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingMethodType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ +public final class ScalingMethodType extends ExpandableStringEnum { + /** + * Scaling will manage hosts in the host pool by power managing the hosts, but will not change the host pool size. + */ + public static final ScalingMethodType POWER_MANAGE = fromString("PowerManage"); + + /** + * Scaling will manage hosts in the host pool by power managing the hosts, as well as creating and deleting hosts + * that will change the host pool size. This requires the createDelete property to be set, and the assigned hostpool + * to have a session host config property. + */ + public static final ScalingMethodType CREATE_DELETE_POWER_MANAGE = fromString("CreateDeletePowerManage"); + + /** + * Creates a new instance of ScalingMethodType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScalingMethodType() { + } + + /** + * Creates or finds a ScalingMethodType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScalingMethodType. + */ + public static ScalingMethodType fromString(String name) { + return fromString(name, ScalingMethodType.class); + } + + /** + * Gets known ScalingMethodType values. + * + * @return known ScalingMethodType values. + */ + public static Collection values() { + return values(ScalingMethodType.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java index 1c7e1041fdfc..d6a716ba7508 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -8,7 +8,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner; -import java.util.List; import java.util.Map; /** @@ -51,116 +50,67 @@ public interface ScalingPlan { 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 properties property: Detailed properties for scaling plan. * - * @return the managedBy value. + * @return the properties value. */ - String managedBy(); + ScalingPlanProperties properties(); /** - * 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 - * validate and persist this value. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the kind value. + * @return the identity value. */ - String kind(); + ManagedServiceIdentity identity(); /** - * 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 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 identity property: The identity property. + * 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 + * validate and persist this value. * - * @return the identity value. + * @return the kind value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + String kind(); /** - * Gets the sku property: The sku property. + * 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 sku value. + * @return the managedBy value. */ - ResourceModelWithAllowedPropertySetSku sku(); + String managedBy(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Details of the resource plan. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of scaling plan. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the description property: Description of scaling plan. - * - * @return the description value. - */ - String description(); - - /** - * Gets the friendlyName property: User friendly name of scaling plan. - * - * @return the friendlyName value. - */ - String friendlyName(); - - /** - * Gets the timeZone property: Timezone of the scaling plan. - * - * @return the timeZone value. - */ - String timeZone(); - - /** - * Gets the hostPoolType property: HostPool type for desktop. - * - * @return the hostPoolType value. - */ - ScalingHostPoolType hostPoolType(); + Plan plan(); /** - * Gets the exclusionTag property: Exclusion tag for scaling plan. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the exclusionTag value. - */ - String exclusionTag(); - - /** - * Gets the schedules property: List of ScalingPlanPooledSchedule definitions. - * - * @return the schedules value. + * @return the sku value. */ - List schedules(); + Sku sku(); /** - * Gets the hostPoolReferences property: List of ScalingHostPoolReference definitions. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the hostPoolReferences value. + * @return the systemData value. */ - List hostPoolReferences(); + SystemData systemData(); /** * Gets the region of the resource. @@ -194,7 +144,7 @@ public interface ScalingPlan { * The entirety of the ScalingPlan definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithTimeZone, DefinitionStages.WithCreate { + DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -238,20 +188,20 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithTimeZone withExistingResourceGroup(String resourceGroupName); + WithProperties withExistingResourceGroup(String resourceGroupName); } /** - * The stage of the ScalingPlan definition allowing to specify timeZone. + * The stage of the ScalingPlan definition allowing to specify properties. */ - interface WithTimeZone { + interface WithProperties { /** - * Specifies the timeZone property: Timezone of the scaling plan.. + * Specifies the properties property: Detailed properties for scaling plan.. * - * @param timeZone Timezone of the scaling plan. + * @param properties Detailed properties for scaling plan. * @return the next definition stage. */ - WithCreate withTimeZone(String timeZone); + WithCreate withProperties(ScalingPlanProperties properties); } /** @@ -259,10 +209,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, - DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithHostPoolType, - DefinitionStages.WithExclusionTag, DefinitionStages.WithSchedules, DefinitionStages.WithHostPoolReferences { + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithKind, + DefinitionStages.WithManagedBy, DefinitionStages.WithPlan, DefinitionStages.WithSku { /** * Executes the create request. * @@ -293,21 +241,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 +259,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,29 +271,21 @@ interface WithKind { } /** - * The stage of the ScalingPlan definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The identity property.. - * - * @param identity The identity property. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); - } - - /** - * The stage of the ScalingPlan definition allowing to specify sku. + * The stage of the ScalingPlan definition allowing to specify managedBy. */ - interface WithSku { + interface WithManagedBy { /** - * Specifies the sku property: The sku 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 sku The sku 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 withSku(ResourceModelWithAllowedPropertySetSku sku); + WithCreate withManagedBy(String managedBy); } /** @@ -358,90 +293,25 @@ interface WithSku { */ interface WithPlan { /** - * Specifies the plan property: The plan property.. - * - * @param plan The plan property. - * @return the next definition stage. - */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); - } - - /** - * The stage of the ScalingPlan definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of scaling plan.. - * - * @param description Description of scaling plan. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the ScalingPlan definition 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. - */ - WithCreate withFriendlyName(String friendlyName); - } - - /** - * The stage of the ScalingPlan definition allowing to specify hostPoolType. - */ - interface WithHostPoolType { - /** - * Specifies the hostPoolType property: HostPool type for desktop.. - * - * @param hostPoolType HostPool type for desktop. - * @return the next definition stage. - */ - WithCreate withHostPoolType(ScalingHostPoolType hostPoolType); - } - - /** - * The stage of the ScalingPlan definition 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. - */ - WithCreate withExclusionTag(String exclusionTag); - } - - /** - * The stage of the ScalingPlan definition allowing to specify schedules. - */ - interface WithSchedules { - /** - * Specifies the schedules property: List of ScalingPlanPooledSchedule definitions.. + * Specifies the plan property: Details of the resource plan.. * - * @param schedules List of ScalingPlanPooledSchedule definitions. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withSchedules(List schedules); + WithCreate withPlan(Plan plan); } /** - * The stage of the ScalingPlan definition allowing to specify hostPoolReferences. + * The stage of the ScalingPlan definition allowing to specify sku. */ - interface WithHostPoolReferences { + interface WithSku { /** - * Specifies the hostPoolReferences property: List of ScalingHostPoolReference definitions.. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param hostPoolReferences List of ScalingHostPoolReference definitions. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withHostPoolReferences(List hostPoolReferences); + WithCreate withSku(Sku sku); } } @@ -455,9 +325,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 +360,16 @@ interface WithTags { } /** - * The stage of the ScalingPlan update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of 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. + * The stage of the ScalingPlan update allowing to specify properties. */ - interface WithHostPoolReferences { + interface WithProperties { /** - * Specifies the hostPoolReferences property: List of ScalingHostPoolReference definitions.. + * Specifies the properties property: Detailed properties for scaling plan. * - * @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/ScalingPlanPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java index 76138d328cca..9a0cdf644476 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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. - * @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. + * @param properties the properties 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); + public ScalingPlanPatch withProperties(ScalingPlanPatchProperties properties) { + this.properties = properties; 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); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -220,7 +80,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 +103,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 91% 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..d76163efab79 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 @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -175,20 +173,6 @@ public ScalingPlanPatchProperties withHostPoolReferences(List e.validate()); - } - if (hostPoolReferences() != null) { - hostPoolReferences().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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..a4d4fa705766 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 @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -import java.util.List; /** * An immutable client-side representation of ScalingPlanPersonalSchedule. @@ -35,209 +34,18 @@ public interface ScalingPlanPersonalSchedule { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the daysOfWeek property: Set of days of the week on which this schedule is active. - * - * @return the daysOfWeek value. - */ - List daysOfWeek(); - - /** - * Gets the rampUpStartTime property: Starting time for ramp up period. - * - * @return the rampUpStartTime value. - */ - Time rampUpStartTime(); - - /** - * Gets the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms - * in the hostpool. - * - * @return the rampUpAutoStartHosts value. - */ - StartupBehavior rampUpAutoStartHosts(); - - /** - * Gets 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. - */ - SetStartVMOnConnect rampUpStartVMOnConnect(); - - /** - * Gets the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * - * @return the rampUpActionOnDisconnect value. - */ - SessionHandlingOperation rampUpActionOnDisconnect(); - - /** - * Gets 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. - */ - Integer rampUpMinutesToWaitOnDisconnect(); - - /** - * Gets the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * - * @return the rampUpActionOnLogoff value. - */ - SessionHandlingOperation rampUpActionOnLogoff(); - - /** - * Gets 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. - */ - Integer rampUpMinutesToWaitOnLogoff(); - - /** - * Gets the peakStartTime property: Starting time for peak period. - * - * @return the peakStartTime value. - */ - Time peakStartTime(); - - /** - * Gets the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during - * the peak phase. - * - * @return the peakStartVMOnConnect value. - */ - SetStartVMOnConnect peakStartVMOnConnect(); - - /** - * Gets the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * - * @return the peakActionOnDisconnect value. - */ - SessionHandlingOperation peakActionOnDisconnect(); - - /** - * Gets 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. - */ - Integer peakMinutesToWaitOnDisconnect(); - - /** - * Gets the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * - * @return the peakActionOnLogoff value. - */ - SessionHandlingOperation peakActionOnLogoff(); - - /** - * Gets 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. - */ - Integer peakMinutesToWaitOnLogoff(); - - /** - * Gets the rampDownStartTime property: Starting time for ramp down period. - * - * @return the rampDownStartTime value. - */ - Time rampDownStartTime(); - - /** - * Gets the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool - * during the ramp down phase. - * - * @return the rampDownStartVMOnConnect value. - */ - SetStartVMOnConnect rampDownStartVMOnConnect(); - - /** - * Gets the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down - * period. - * - * @return the rampDownActionOnDisconnect value. - */ - SessionHandlingOperation rampDownActionOnDisconnect(); - - /** - * Gets 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. - */ - Integer rampDownMinutesToWaitOnDisconnect(); - - /** - * Gets the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * - * @return the rampDownActionOnLogoff value. - */ - SessionHandlingOperation rampDownActionOnLogoff(); - - /** - * Gets 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. - */ - Integer rampDownMinutesToWaitOnLogoff(); - - /** - * Gets the offPeakStartTime property: Starting time for off-peak period. - * - * @return the offPeakStartTime value. - */ - Time offPeakStartTime(); - - /** - * Gets the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool - * during the off-peak phase. - * - * @return the offPeakStartVMOnConnect value. - */ - SetStartVMOnConnect offPeakStartVMOnConnect(); - - /** - * Gets the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak - * period. - * - * @return the offPeakActionOnDisconnect value. - */ - SessionHandlingOperation offPeakActionOnDisconnect(); - - /** - * Gets 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. - */ - Integer offPeakMinutesToWaitOnDisconnect(); - - /** - * Gets the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. + * Gets the properties property: Detailed properties for ScalingPlanPersonalSchedule. * - * @return the offPeakActionOnLogoff value. + * @return the properties value. */ - SessionHandlingOperation offPeakActionOnLogoff(); + ScalingPlanPersonalScheduleProperties properties(); /** - * Gets 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. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the offPeakMinutesToWaitOnLogoff value. + * @return the systemData value. */ - Integer offPeakMinutesToWaitOnLogoff(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -257,8 +65,8 @@ 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.WithProperties, DefinitionStages.WithCreate { } /** @@ -282,26 +90,27 @@ interface WithParentResource { * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. */ - WithCreate withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + WithProperties withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + } + + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for ScalingPlanPersonalSchedule. + * + * @param properties Detailed properties for ScalingPlanPersonalSchedule. + * @return the next definition stage. + */ + WithCreate withProperties(ScalingPlanPersonalScheduleProperties properties); } /** * 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.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 WithCreate { /** * Executes the create request. * @@ -317,796 +126,50 @@ interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.W */ ScalingPlanPersonalSchedule create(Context context); } + } - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify daysOfWeek. - */ - interface WithDaysOfWeek { - /** - * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * - * @param daysOfWeek Set of days of the week on which this schedule is active. - * @return the next definition stage. - */ - WithCreate withDaysOfWeek(List daysOfWeek); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartTime. - */ - interface WithRampUpStartTime { - /** - * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * - * @param rampUpStartTime Starting time for ramp up period. - * @return the next definition stage. - */ - WithCreate withRampUpStartTime(Time rampUpStartTime); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpAutoStartHosts. - */ - interface WithRampUpAutoStartHosts { - /** - * Specifies the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for - * personal vms in the hostpool.. - * - * @param rampUpAutoStartHosts The desired startup behavior during the ramp up period for personal vms in - * the hostpool. - * @return the next definition stage. - */ - WithCreate withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - 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. - */ - 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. - */ - WithCreate withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff); - } + /** + * Begins update for the ScalingPlanPersonalSchedule resource. + * + * @return the stage of resource update. + */ + ScalingPlanPersonalSchedule.Update update(); + /** + * The template for ScalingPlanPersonalSchedule update. + */ + interface Update extends UpdateStages.WithProperties { /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartTime. + * Executes the update request. + * + * @return the updated resource. */ - 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); - } + ScalingPlanPersonalSchedule apply(); /** - * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartVMOnConnect. + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. */ - 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. - */ - WithCreate withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - 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. - */ - 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. - */ - WithCreate withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - */ - WithCreate withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff); - } - - /** - * The stage of the ScalingPlanPersonalSchedule definition 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. - * @return the next definition stage. - */ - WithCreate withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff); - } - } - - /** - * Begins update for the ScalingPlanPersonalSchedule resource. - * - * @return the stage of resource update. - */ - ScalingPlanPersonalSchedule.Update update(); - - /** - * 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 { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ScalingPlanPersonalSchedule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ScalingPlanPersonalSchedule apply(Context context); - } + ScalingPlanPersonalSchedule apply(Context context); + } /** * The ScalingPlanPersonalSchedule update stages. */ 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. - */ - interface WithRampUpAutoStartHosts { - /** - * Specifies the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for - * personal vms in the hostpool.. - * - * @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. + * The stage of the ScalingPlanPersonalSchedule update allowing to specify properties. */ - interface WithOffPeakMinutesToWaitOnLogoff { + interface WithProperties { /** - * 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.. + * Specifies the properties property: Detailed properties for ScalingPlanPersonalSchedule. * - * @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/ScalingPlanPersonalSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java index 3fcce4e285df..3c1c6a8388d4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,670 +28,32 @@ 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. - * @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. + * @param properties the properties 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); + public ScalingPlanPersonalSchedulePatch withProperties(ScalingPlanPersonalSchedulePatchProperties properties) { + this.properties = properties; 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); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -714,8 +74,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..309057bf014f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatchProperties.java @@ -0,0 +1,884 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpAutoStartHosts", + this.rampUpAutoStartHosts == null ? null : this.rampUpAutoStartHosts.toString()); + jsonWriter.writeStringField("rampUpStartVMOnConnect", + this.rampUpStartVMOnConnect == null ? null : this.rampUpStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampUpActionOnDisconnect", + this.rampUpActionOnDisconnect == null ? null : this.rampUpActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnDisconnect", this.rampUpMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampUpActionOnLogoff", + this.rampUpActionOnLogoff == null ? null : this.rampUpActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnLogoff", this.rampUpMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakStartVMOnConnect", + this.peakStartVMOnConnect == null ? null : this.peakStartVMOnConnect.toString()); + jsonWriter.writeStringField("peakActionOnDisconnect", + this.peakActionOnDisconnect == null ? null : this.peakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnDisconnect", this.peakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("peakActionOnLogoff", + this.peakActionOnLogoff == null ? null : this.peakActionOnLogoff.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnLogoff", this.peakMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownStartVMOnConnect", + this.rampDownStartVMOnConnect == null ? null : this.rampDownStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampDownActionOnDisconnect", + this.rampDownActionOnDisconnect == null ? null : this.rampDownActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnDisconnect", this.rampDownMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampDownActionOnLogoff", + this.rampDownActionOnLogoff == null ? null : this.rampDownActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnLogoff", this.rampDownMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakStartVMOnConnect", + this.offPeakStartVMOnConnect == null ? null : this.offPeakStartVMOnConnect.toString()); + jsonWriter.writeStringField("offPeakActionOnDisconnect", + this.offPeakActionOnDisconnect == null ? null : this.offPeakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnDisconnect", this.offPeakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("offPeakActionOnLogoff", + this.offPeakActionOnLogoff == null ? null : this.offPeakActionOnLogoff.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnLogoff", this.offPeakMinutesToWaitOnLogoff); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalSchedulePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalSchedulePatchProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPersonalSchedulePatchProperties. + */ + public static ScalingPlanPersonalSchedulePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalSchedulePatchProperties deserializedScalingPlanPersonalSchedulePatchProperties + = new ScalingPlanPersonalSchedulePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPersonalSchedulePatchProperties.daysOfWeek = daysOfWeek; + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpAutoStartHosts".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpAutoStartHosts + = StartupBehavior.fromString(reader.getString()); + } else if ("rampUpStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampUpActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampUpMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("peakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("peakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.peakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampDownActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.rampDownMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("offPeakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatchProperties.offPeakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalSchedulePatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleProperties.java similarity index 97% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleProperties.java index 727528381460..5e54799818f2 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/models/ScalingPlanPersonalScheduleProperties.java @@ -1,19 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; -import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; -import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.io.IOException; import java.util.List; @@ -736,26 +731,6 @@ public Integer 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} */ 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..2712c4cd9617 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -75,7 +75,7 @@ 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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String scalingPlanName); @@ -91,7 +91,7 @@ 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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPersonalSchedule definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); 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..40173ca0327a 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 @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import java.util.List; /** * An immutable client-side representation of ScalingPlanPooledSchedule. @@ -35,130 +34,18 @@ public interface ScalingPlanPooledSchedule { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the daysOfWeek property: Set of days of the week on which this schedule is active. - * - * @return the daysOfWeek value. - */ - List daysOfWeek(); - - /** - * Gets the rampUpStartTime property: Starting time for ramp up period. - * - * @return the rampUpStartTime value. - */ - Time rampUpStartTime(); - - /** - * Gets the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * - * @return the rampUpLoadBalancingAlgorithm value. - */ - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm(); - - /** - * Gets the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * - * @return the rampUpMinimumHostsPct value. - */ - Integer rampUpMinimumHostsPct(); - - /** - * Gets the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * - * @return the rampUpCapacityThresholdPct value. - */ - Integer rampUpCapacityThresholdPct(); - - /** - * Gets the peakStartTime property: Starting time for peak period. - * - * @return the peakStartTime value. - */ - Time peakStartTime(); - - /** - * Gets the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * - * @return the peakLoadBalancingAlgorithm value. - */ - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm(); - - /** - * Gets the rampDownStartTime property: Starting time for ramp down period. - * - * @return the rampDownStartTime value. - */ - Time rampDownStartTime(); - - /** - * Gets the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * - * @return the rampDownLoadBalancingAlgorithm value. - */ - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm(); - - /** - * Gets the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. + * Gets the properties property: Detailed properties for ScalingPlanPooledSchedule. * - * @return the rampDownMinimumHostsPct value. + * @return the properties value. */ - Integer rampDownMinimumHostsPct(); + ScalingPlanPooledScheduleProperties properties(); /** - * Gets the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * - * @return the rampDownCapacityThresholdPct value. - */ - Integer rampDownCapacityThresholdPct(); - - /** - * Gets the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * - * @return the rampDownForceLogoffUsers value. - */ - Boolean rampDownForceLogoffUsers(); - - /** - * Gets the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * - * @return the rampDownStopHostsWhen value. - */ - StopHostsWhen rampDownStopHostsWhen(); - - /** - * Gets the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * - * @return the rampDownWaitTimeMinutes value. - */ - Integer rampDownWaitTimeMinutes(); - - /** - * Gets the rampDownNotificationMessage property: Notification message for users during ramp down period. - * - * @return the rampDownNotificationMessage value. - */ - String rampDownNotificationMessage(); - - /** - * Gets the offPeakStartTime property: Starting time for off-peak period. - * - * @return the offPeakStartTime value. - */ - Time offPeakStartTime(); - - /** - * Gets the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the offPeakLoadBalancingAlgorithm value. + * @return the systemData value. */ - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm(); + SystemData systemData(); /** * Gets the name of the resource group. @@ -178,8 +65,8 @@ 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.WithProperties, DefinitionStages.WithCreate { } /** @@ -203,22 +90,27 @@ interface WithParentResource { * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. */ - WithCreate withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + WithProperties withExistingScalingPlan(String resourceGroupName, String scalingPlanName); + } + + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for ScalingPlanPooledSchedule. + * + * @param properties Detailed properties for ScalingPlanPooledSchedule. + * @return the next definition stage. + */ + WithCreate withProperties(ScalingPlanPooledScheduleProperties properties); } /** * 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 { + interface WithCreate { /** * Executes the create request. * @@ -234,231 +126,6 @@ interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.W */ ScalingPlanPooledSchedule create(Context context); } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify daysOfWeek. - */ - interface WithDaysOfWeek { - /** - * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * - * @param daysOfWeek Set of days of the week on which this schedule is active. - * @return the next definition stage. - */ - WithCreate withDaysOfWeek(List daysOfWeek); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpStartTime. - */ - interface WithRampUpStartTime { - /** - * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * - * @param rampUpStartTime Starting time for ramp up period. - * @return the next definition stage. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpCapacityThresholdPct. - */ - interface WithRampUpCapacityThresholdPct { - /** - * Specifies the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.. - * - * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. - * @return the next definition stage. - */ - WithCreate withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakStartTime. - */ - interface WithPeakStartTime { - /** - * Specifies the peakStartTime property: Starting time for peak period.. - * - * @param peakStartTime Starting time for peak period. - * @return the next definition stage. - */ - WithCreate withPeakStartTime(Time peakStartTime); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakLoadBalancingAlgorithm. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStartTime. - */ - interface WithRampDownStartTime { - /** - * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * - * @param rampDownStartTime Starting time for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownStartTime(Time rampDownStartTime); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownLoadBalancingAlgorithm. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownCapacityThresholdPct. - */ - interface WithRampDownCapacityThresholdPct { - /** - * Specifies the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.. - * - * @param rampDownCapacityThresholdPct Capacity threshold for ramp down period. - * @return the next definition stage. - */ - WithCreate withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownForceLogoffUsers. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakStartTime. - */ - interface WithOffPeakStartTime { - /** - * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * - * @param offPeakStartTime Starting time for off-peak period. - * @return the next definition stage. - */ - WithCreate withOffPeakStartTime(Time offPeakStartTime); - } - - /** - * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. - */ - interface WithOffPeakLoadBalancingAlgorithm { - /** - * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. - * - * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. - * @return the next definition stage. - */ - WithCreate - withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); - } } /** @@ -471,15 +138,7 @@ interface WithOffPeakLoadBalancingAlgorithm { /** * The template for ScalingPlanPooledSchedule update. */ - interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpStartTime, - UpdateStages.WithRampUpLoadBalancingAlgorithm, UpdateStages.WithRampUpMinimumHostsPct, - UpdateStages.WithRampUpCapacityThresholdPct, UpdateStages.WithPeakStartTime, - UpdateStages.WithPeakLoadBalancingAlgorithm, UpdateStages.WithRampDownStartTime, - UpdateStages.WithRampDownLoadBalancingAlgorithm, UpdateStages.WithRampDownMinimumHostsPct, - UpdateStages.WithRampDownCapacityThresholdPct, UpdateStages.WithRampDownForceLogoffUsers, - UpdateStages.WithRampDownStopHostsWhen, UpdateStages.WithRampDownWaitTimeMinutes, - UpdateStages.WithRampDownNotificationMessage, UpdateStages.WithOffPeakStartTime, - UpdateStages.WithOffPeakLoadBalancingAlgorithm { + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. * @@ -501,226 +160,16 @@ interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpSta */ 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.. - * - * @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 ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule update 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. - */ - Update withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - 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); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); - } - - /** - * The stage of the ScalingPlanPooledSchedule update 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. - */ - Update withRampDownNotificationMessage(String rampDownNotificationMessage); - } - - /** - * The stage of the ScalingPlanPooledSchedule 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 ScalingPlanPooledSchedule update allowing to specify offPeakLoadBalancingAlgorithm. + * The stage of the ScalingPlanPooledSchedule update allowing to specify properties. */ - interface WithOffPeakLoadBalancingAlgorithm { + 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/ScalingPlanPooledSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java index 6bdc14b780b1..8269c11c0a64 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,419 +107,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +141,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..bcd6da20dd39 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatchProperties.java @@ -0,0 +1,639 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethodType scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; + + /* + * Starting time for ramp up period. + */ + private Time rampUpStartTime; + + /* + * Load balancing algorithm for ramp up period. + */ + private SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm; + + /* + * Minimum host percentage for ramp up period. + */ + private Integer rampUpMinimumHostsPct; + + /* + * Capacity threshold for ramp up period. + */ + private Integer rampUpCapacityThresholdPct; + + /* + * Starting time for peak period. + */ + private Time peakStartTime; + + /* + * Load balancing algorithm for peak period. + */ + private SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm; + + /* + * Starting time for ramp down period. + */ + private Time rampDownStartTime; + + /* + * Load balancing algorithm for ramp down period. + */ + private SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm; + + /* + * Minimum host percentage for ramp down period. + */ + private Integer rampDownMinimumHostsPct; + + /* + * Capacity threshold for ramp down period. + */ + private Integer rampDownCapacityThresholdPct; + + /* + * Should users be logged off forcefully from hosts. + */ + private Boolean rampDownForceLogoffUsers; + + /* + * Specifies when to stop hosts during ramp down period. + */ + private StopHostsWhen rampDownStopHostsWhen; + + /* + * Number of minutes to wait to stop hosts during ramp down period. + */ + private Integer rampDownWaitTimeMinutes; + + /* + * Notification message for users during ramp down period. + */ + private String rampDownNotificationMessage; + + /* + * Starting time for off-peak period. + */ + private Time offPeakStartTime; + + /* + * Load balancing algorithm for off-peak period. + */ + private SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm; + + /** + * Creates an instance of ScalingPlanPooledSchedulePatchProperties class. + */ + public ScalingPlanPooledSchedulePatchProperties() { + } + + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @return the daysOfWeek value. + */ + public List daysOfWeek() { + return this.daysOfWeek; + } + + /** + * Set the daysOfWeek property: Set of days of the week on which this schedule is active. + * + * @param daysOfWeek the daysOfWeek value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withDaysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + return this; + } + + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethodType scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withScalingMethod(ScalingMethodType scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + + /** + * Get the rampUpStartTime property: Starting time for ramp up period. + * + * @return the rampUpStartTime value. + */ + public Time rampUpStartTime() { + return this.rampUpStartTime; + } + + /** + * Set the rampUpStartTime property: Starting time for ramp up period. + * + * @param rampUpStartTime the rampUpStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpStartTime(Time rampUpStartTime) { + this.rampUpStartTime = rampUpStartTime; + return this; + } + + /** + * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. + * + * @return the rampUpLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { + return this.rampUpLoadBalancingAlgorithm; + } + + /** + * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. + * + * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + this.rampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. + * + * @return the rampUpMinimumHostsPct value. + */ + public Integer rampUpMinimumHostsPct() { + return this.rampUpMinimumHostsPct; + } + + /** + * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. + * + * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) { + this.rampUpMinimumHostsPct = rampUpMinimumHostsPct; + return this; + } + + /** + * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. + * + * @return the rampUpCapacityThresholdPct value. + */ + public Integer rampUpCapacityThresholdPct() { + return this.rampUpCapacityThresholdPct; + } + + /** + * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. + * + * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) { + this.rampUpCapacityThresholdPct = rampUpCapacityThresholdPct; + return this; + } + + /** + * Get the peakStartTime property: Starting time for peak period. + * + * @return the peakStartTime value. + */ + public Time peakStartTime() { + return this.peakStartTime; + } + + /** + * Set the peakStartTime property: Starting time for peak period. + * + * @param peakStartTime the peakStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withPeakStartTime(Time peakStartTime) { + this.peakStartTime = peakStartTime; + return this; + } + + /** + * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. + * + * @return the peakLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { + return this.peakLoadBalancingAlgorithm; + } + + /** + * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. + * + * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + this.peakLoadBalancingAlgorithm = peakLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampDownStartTime property: Starting time for ramp down period. + * + * @return the rampDownStartTime value. + */ + public Time rampDownStartTime() { + return this.rampDownStartTime; + } + + /** + * Set the rampDownStartTime property: Starting time for ramp down period. + * + * @param rampDownStartTime the rampDownStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownStartTime(Time rampDownStartTime) { + this.rampDownStartTime = rampDownStartTime; + return this; + } + + /** + * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. + * + * @return the rampDownLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { + return this.rampDownLoadBalancingAlgorithm; + } + + /** + * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. + * + * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + this.rampDownLoadBalancingAlgorithm = rampDownLoadBalancingAlgorithm; + return this; + } + + /** + * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. + * + * @return the rampDownMinimumHostsPct value. + */ + public Integer rampDownMinimumHostsPct() { + return this.rampDownMinimumHostsPct; + } + + /** + * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. + * + * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) { + this.rampDownMinimumHostsPct = rampDownMinimumHostsPct; + return this; + } + + /** + * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. + * + * @return the rampDownCapacityThresholdPct value. + */ + public Integer rampDownCapacityThresholdPct() { + return this.rampDownCapacityThresholdPct; + } + + /** + * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. + * + * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) { + this.rampDownCapacityThresholdPct = rampDownCapacityThresholdPct; + return this; + } + + /** + * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. + * + * @return the rampDownForceLogoffUsers value. + */ + public Boolean rampDownForceLogoffUsers() { + return this.rampDownForceLogoffUsers; + } + + /** + * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. + * + * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) { + this.rampDownForceLogoffUsers = rampDownForceLogoffUsers; + return this; + } + + /** + * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. + * + * @return the rampDownStopHostsWhen value. + */ + public StopHostsWhen rampDownStopHostsWhen() { + return this.rampDownStopHostsWhen; + } + + /** + * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. + * + * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) { + this.rampDownStopHostsWhen = rampDownStopHostsWhen; + return this; + } + + /** + * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. + * + * @return the rampDownWaitTimeMinutes value. + */ + public Integer rampDownWaitTimeMinutes() { + return this.rampDownWaitTimeMinutes; + } + + /** + * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. + * + * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) { + this.rampDownWaitTimeMinutes = rampDownWaitTimeMinutes; + return this; + } + + /** + * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. + * + * @return the rampDownNotificationMessage value. + */ + public String rampDownNotificationMessage() { + return this.rampDownNotificationMessage; + } + + /** + * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. + * + * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withRampDownNotificationMessage(String rampDownNotificationMessage) { + this.rampDownNotificationMessage = rampDownNotificationMessage; + return this; + } + + /** + * Get the offPeakStartTime property: Starting time for off-peak period. + * + * @return the offPeakStartTime value. + */ + public Time offPeakStartTime() { + return this.offPeakStartTime; + } + + /** + * Set the offPeakStartTime property: Starting time for off-peak period. + * + * @param offPeakStartTime the offPeakStartTime value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties withOffPeakStartTime(Time offPeakStartTime) { + this.offPeakStartTime = offPeakStartTime; + return this; + } + + /** + * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. + * + * @return the offPeakLoadBalancingAlgorithm value. + */ + public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { + return this.offPeakLoadBalancingAlgorithm; + } + + /** + * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. + * + * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. + * @return the ScalingPlanPooledSchedulePatchProperties object itself. + */ + public ScalingPlanPooledSchedulePatchProperties + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + this.offPeakLoadBalancingAlgorithm = offPeakLoadBalancingAlgorithm; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", + this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampUpMinimumHostsPct", this.rampUpMinimumHostsPct); + jsonWriter.writeNumberField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakLoadBalancingAlgorithm", + this.peakLoadBalancingAlgorithm == null ? null : this.peakLoadBalancingAlgorithm.toString()); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownLoadBalancingAlgorithm", + this.rampDownLoadBalancingAlgorithm == null ? null : this.rampDownLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampDownMinimumHostsPct", this.rampDownMinimumHostsPct); + jsonWriter.writeNumberField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); + jsonWriter.writeBooleanField("rampDownForceLogoffUsers", this.rampDownForceLogoffUsers); + jsonWriter.writeStringField("rampDownStopHostsWhen", + this.rampDownStopHostsWhen == null ? null : this.rampDownStopHostsWhen.toString()); + jsonWriter.writeNumberField("rampDownWaitTimeMinutes", this.rampDownWaitTimeMinutes); + jsonWriter.writeStringField("rampDownNotificationMessage", this.rampDownNotificationMessage); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakLoadBalancingAlgorithm", + this.offPeakLoadBalancingAlgorithm == null ? null : this.offPeakLoadBalancingAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledSchedulePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledSchedulePatchProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPooledSchedulePatchProperties. + */ + public static ScalingPlanPooledSchedulePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledSchedulePatchProperties deserializedScalingPlanPooledSchedulePatchProperties + = new ScalingPlanPooledSchedulePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.name = reader.getString(); + } else if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPooledSchedulePatchProperties.daysOfWeek = daysOfWeek; + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.scalingMethod + = ScalingMethodType.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.createDelete + = CreateDeleteProperties.fromJson(reader); + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampUpMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampUpCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.peakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownForceLogoffUsers".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownForceLogoffUsers + = reader.getNullable(JsonReader::getBoolean); + } else if ("rampDownStopHostsWhen".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownStopHostsWhen + = StopHostsWhen.fromString(reader.getString()); + } else if ("rampDownWaitTimeMinutes".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownWaitTimeMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownNotificationMessage".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.rampDownNotificationMessage + = reader.getString(); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatchProperties.offPeakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledSchedulePatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleProperties.java similarity index 88% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleProperties.java index 9c4a8262bcc5..7d441a77ef88 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/models/ScalingPlanPooledScheduleProperties.java @@ -1,18 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; -import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.io.IOException; import java.util.List; @@ -22,11 +18,26 @@ @Fluent public final class ScalingPlanPooledScheduleProperties implements JsonSerializable { + /* + * Name of the ScalingPlanPooledSchedule + */ + private String name; + /* * Set of days of the week on which this schedule is active. */ private List daysOfWeek; + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethodType scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; + /* * Starting time for ramp up period. */ @@ -113,6 +124,15 @@ public final class ScalingPlanPooledScheduleProperties public ScalingPlanPooledScheduleProperties() { } + /** + * Get the name property: Name of the ScalingPlanPooledSchedule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. * @@ -133,6 +153,50 @@ public ScalingPlanPooledScheduleProperties withDaysOfWeek(List daysOf return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethodType scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingPlanPooledScheduleProperties object itself. + */ + public ScalingPlanPooledScheduleProperties withScalingMethod(ScalingMethodType scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingPlanPooledScheduleProperties object itself. + */ + public ScalingPlanPooledScheduleProperties withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -457,26 +521,6 @@ public SessionHostLoadBalancingAlgorithm 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} */ @@ -485,6 +529,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); @@ -525,9 +571,17 @@ public static ScalingPlanPooledScheduleProperties fromJson(JsonReader jsonReader String fieldName = reader.getFieldName(); reader.nextToken(); - if ("daysOfWeek".equals(fieldName)) { + if ("name".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.name = reader.getString(); + } else if ("daysOfWeek".equals(fieldName)) { List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); deserializedScalingPlanPooledScheduleProperties.daysOfWeek = daysOfWeek; + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.scalingMethod + = ScalingMethodType.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.createDelete + = CreateDeleteProperties.fromJson(reader); } else if ("rampUpStartTime".equals(fieldName)) { deserializedScalingPlanPooledScheduleProperties.rampUpStartTime = Time.fromJson(reader); } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java index 47a01b94e020..01e8159304e7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -75,7 +75,7 @@ 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 scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String scalingPlanName); @@ -91,7 +91,7 @@ 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 scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. + * @return list of ScalingPlanPooledSchedule definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanProperties.java similarity index 89% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanProperties.java index f74bbdbdb6b1..30c8228d4f45 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanProperties.java @@ -1,18 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.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.ScalingHostPoolReference; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; import java.io.IOException; import java.util.List; @@ -216,26 +212,6 @@ public ScalingPlanProperties withHostPoolReferences(List e.validate()); - } - if (hostPoolReferences() != null) { - hostPoolReferences().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanProperties.class); - /** * {@inheritDoc} */ 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..eabfdabb390a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -69,7 +69,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,7 +84,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, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -94,7 +94,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer * * @throws com.azure.core.management.exception.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 list(); @@ -108,7 +108,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -120,7 +120,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 listByHostPool(String resourceGroupName, String hostPoolName); @@ -136,7 +136,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); 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..e6f026c6b8ed 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -25,7 +25,17 @@ public final class ScalingSchedule implements JsonSerializable /* * Set of days of the week on which this schedule is active. */ - private List daysOfWeek; + private List daysOfWeek; + + /* + * The desired scaling method to be used to scale the hosts in the assigned host pool. + */ + private ScalingMethodType scalingMethod; + + /* + * The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + */ + private CreateDeleteProperties createDelete; /* * Starting time for ramp up period. @@ -138,7 +148,7 @@ public ScalingSchedule withName(String name) { * * @return the daysOfWeek value. */ - public List daysOfWeek() { + public List daysOfWeek() { return this.daysOfWeek; } @@ -148,11 +158,55 @@ public List daysOfWeek() { * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withDaysOfWeek(List daysOfWeek) { + public ScalingSchedule withDaysOfWeek(List daysOfWeek) { this.daysOfWeek = daysOfWeek; return this; } + /** + * Get the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @return the scalingMethod value. + */ + public ScalingMethodType scalingMethod() { + return this.scalingMethod; + } + + /** + * Set the scalingMethod property: The desired scaling method to be used to scale the hosts in the assigned host + * pool. + * + * @param scalingMethod the scalingMethod value to set. + * @return the ScalingSchedule object itself. + */ + public ScalingSchedule withScalingMethod(ScalingMethodType scalingMethod) { + this.scalingMethod = scalingMethod; + return this; + } + + /** + * Get the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @return the createDelete value. + */ + public CreateDeleteProperties createDelete() { + return this.createDelete; + } + + /** + * Set the createDelete property: The properties that control how Scaling will manage the size of the hostpool by + * creating and deleting hosts. + * + * @param createDelete the createDelete value to set. + * @return the ScalingSchedule object itself. + */ + public ScalingSchedule withCreateDelete(CreateDeleteProperties createDelete) { + this.createDelete = createDelete; + return this; + } + /** * Get the rampUpStartTime property: Starting time for ramp up period. * @@ -477,26 +531,6 @@ public SessionHostLoadBalancingAlgorithm 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} */ @@ -506,6 +540,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("scalingMethod", this.scalingMethod == null ? null : this.scalingMethod.toString()); + jsonWriter.writeJsonField("createDelete", this.createDelete); jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); @@ -548,9 +584,12 @@ public static ScalingSchedule fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedScalingSchedule.name = reader.getString(); } else if ("daysOfWeek".equals(fieldName)) { - List daysOfWeek - = reader.readArray(reader1 -> ScalingScheduleDaysOfWeekItem.fromString(reader1.getString())); + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); deserializedScalingSchedule.daysOfWeek = daysOfWeek; + } else if ("scalingMethod".equals(fieldName)) { + deserializedScalingSchedule.scalingMethod = ScalingMethodType.fromString(reader.getString()); + } else if ("createDelete".equals(fieldName)) { + deserializedScalingSchedule.createDelete = CreateDeleteProperties.fromJson(reader); } else if ("rampUpStartTime".equals(fieldName)) { deserializedScalingSchedule.rampUpStartTime = Time.fromJson(reader); } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java deleted file mode 100644 index cd565b865f5b..000000000000 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.desktopvirtualization.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ScalingScheduleDaysOfWeekItem. - */ -public final class ScalingScheduleDaysOfWeekItem extends ExpandableStringEnum { - /** - * Static value Sunday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem SUNDAY = fromString("Sunday"); - - /** - * Static value Monday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem MONDAY = fromString("Monday"); - - /** - * Static value Tuesday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem TUESDAY = fromString("Tuesday"); - - /** - * Static value Wednesday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem WEDNESDAY = fromString("Wednesday"); - - /** - * Static value Thursday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem THURSDAY = fromString("Thursday"); - - /** - * Static value Friday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem FRIDAY = fromString("Friday"); - - /** - * Static value Saturday for ScalingScheduleDaysOfWeekItem. - */ - public static final ScalingScheduleDaysOfWeekItem SATURDAY = fromString("Saturday"); - - /** - * Creates a new instance of ScalingScheduleDaysOfWeekItem value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScalingScheduleDaysOfWeekItem() { - } - - /** - * Creates or finds a ScalingScheduleDaysOfWeekItem from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScalingScheduleDaysOfWeekItem. - */ - public static ScalingScheduleDaysOfWeekItem fromString(String name) { - return fromString(name, ScalingScheduleDaysOfWeekItem.class); - } - - /** - * Gets known ScalingScheduleDaysOfWeekItem values. - * - * @return known ScalingScheduleDaysOfWeekItem values. - */ - public static Collection values() { - return values(ScalingScheduleDaysOfWeekItem.class); - } -} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScopedRegistrationTokenProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScopedRegistrationTokenProperties.java new file mode 100644 index 000000000000..ec51cfebe35b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScopedRegistrationTokenProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Request body for listing scoped registration tokens for a session host. + */ +@Fluent +public final class ScopedRegistrationTokenProperties implements JsonSerializable { + /* + * Expiration time of the registration token in UTC. + */ + private OffsetDateTime expirationTimeInUtc; + + /** + * Creates an instance of ScopedRegistrationTokenProperties class. + */ + public ScopedRegistrationTokenProperties() { + } + + /** + * Get the expirationTimeInUtc property: Expiration time of the registration token in UTC. + * + * @return the expirationTimeInUtc value. + */ + public OffsetDateTime expirationTimeInUtc() { + return this.expirationTimeInUtc; + } + + /** + * Set the expirationTimeInUtc property: Expiration time of the registration token in UTC. + * + * @param expirationTimeInUtc the expirationTimeInUtc value to set. + * @return the ScopedRegistrationTokenProperties object itself. + */ + public ScopedRegistrationTokenProperties withExpirationTimeInUtc(OffsetDateTime expirationTimeInUtc) { + this.expirationTimeInUtc = expirationTimeInUtc; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expirationTimeInUtc", + this.expirationTimeInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTimeInUtc)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScopedRegistrationTokenProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScopedRegistrationTokenProperties 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 ScopedRegistrationTokenProperties. + */ + public static ScopedRegistrationTokenProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScopedRegistrationTokenProperties deserializedScopedRegistrationTokenProperties + = new ScopedRegistrationTokenProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirationTimeInUtc".equals(fieldName)) { + deserializedScopedRegistrationTokenProperties.expirationTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedScopedRegistrationTokenProperties; + }); + } +} 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..6b4e9e1f1697 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoPatchProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..11c9c6c0d3c9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/SendMessage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java index 0f7f4120dc1e..0b9090ea42f0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -72,14 +72,6 @@ public SendMessage withMessageBody(String messageBody) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java index 47d9c7b98be9..f332e8fa1857 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Service specification payload. */ -@Fluent +@Immutable public final class ServiceSpecification implements JsonSerializable { /* * Specifications of the Log for Azure Monitoring @@ -25,7 +25,7 @@ public final class ServiceSpecification implements JsonSerializable logSpecifications() { return this.logSpecifications; } - /** - * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. - * - * @param logSpecifications the logSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withLogSpecifications(List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java index 695c0931897e..fff9be9aaf1b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,17 @@ */ public final class SessionHandlingOperation extends ExpandableStringEnum { /** - * Static value None for SessionHandlingOperation. + * No action will be taken after disconnect. */ public static final SessionHandlingOperation NONE = fromString("None"); /** - * Static value Deallocate for SessionHandlingOperation. + * Session Host will be deallocated after disconnect. */ public static final SessionHandlingOperation DEALLOCATE = fromString("Deallocate"); /** - * Static value Hibernate for SessionHandlingOperation. + * Session Host will hibernate after disconnect. */ public static final SessionHandlingOperation HIBERNATE = fromString("Hibernate"); 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..e87a0d17e54a 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 @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; -import java.time.OffsetDateTime; -import java.util.List; /** * An immutable client-side representation of SessionHost. @@ -35,135 +36,213 @@ public interface SessionHost { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of SessionHost. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the lastHeartBeat property: Last heart beat from SessionHost. + * Gets the properties property: Detailed properties for SessionHost. * - * @return the lastHeartBeat value. + * @return the properties value. */ - OffsetDateTime lastHeartBeat(); + SessionHostProperties properties(); /** - * Gets the sessions property: Number of sessions on SessionHost. - * - * @return the sessions value. - */ - Integer sessions(); - - /** - * Gets the agentVersion property: Version of agent on SessionHost. - * - * @return the agentVersion value. - */ - String agentVersion(); - - /** - * Gets the allowNewSession property: Allow a new session. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the allowNewSession value. + * @return the systemData value. */ - Boolean allowNewSession(); + SystemData systemData(); /** - * Gets the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine. + * Gets the name of the resource group. * - * @return the virtualMachineId value. + * @return the name of the resource group. */ - String virtualMachineId(); + String resourceGroupName(); /** - * Gets the resourceId property: Resource Id of SessionHost's underlying virtual machine. + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner object. * - * @return the resourceId value. + * @return the inner object. */ - String resourceId(); + SessionHostInner innerModel(); /** - * Gets the assignedUser property: User assigned to SessionHost. - * - * @return the assignedUser value. - */ - String assignedUser(); + * The entirety of the SessionHost definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SessionHost definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SessionHost definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SessionHost definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, 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. + * @return the next definition stage. + */ + WithCreate withExistingHostPool(String resourceGroupName, String hostPoolName); + } + + /** + * The stage of the SessionHost 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SessionHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SessionHost create(Context context); + } + + /** + * The stage of the SessionHost definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for SessionHost. + * + * @param properties Detailed properties for SessionHost. + * @return the next definition stage. + */ + WithCreate withProperties(SessionHostProperties properties); + } + } /** - * Gets the friendlyName property: Friendly name of SessionHost. + * Begins update for the SessionHost resource. * - * @return the friendlyName value. + * @return the stage of resource update. */ - String friendlyName(); + SessionHost.Update update(); /** - * Gets the status property: Status for a SessionHost. - * - * @return the status value. + * The template for SessionHost update. */ - Status status(); + interface Update extends UpdateStages.WithProperties, UpdateStages.WithForce { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SessionHost apply(); - /** - * Gets the statusTimestamp property: The timestamp of the status. - * - * @return the statusTimestamp value. - */ - OffsetDateTime statusTimestamp(); + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SessionHost apply(Context context); + } /** - * Gets the osVersion property: The version of the OS on the session host. - * - * @return the osVersion value. + * The SessionHost update stages. */ - String osVersion(); + interface UpdateStages { + /** + * The stage of the SessionHost update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for SessionHost. + * + * @param properties Detailed properties for SessionHost. + * @return the next definition stage. + */ + Update withProperties(SessionHostPatchProperties properties); + } + + /** + * The stage of the SessionHost update allowing to specify force. + */ + interface WithForce { + /** + * Specifies the force property: Force flag to update assign, unassign or reassign personal desktop.. + * + * @param force Force flag to update assign, unassign or reassign personal desktop. + * @return the next definition stage. + */ + Update withForce(Boolean force); + } + } /** - * Gets the sxSStackVersion property: The version of the side by side stack on the session host. + * Refreshes the resource to sync with Azure. * - * @return the sxSStackVersion value. + * @return the refreshed resource. */ - String sxSStackVersion(); + SessionHost refresh(); /** - * Gets the updateState property: Update state of a SessionHost. + * Refreshes the resource to sync with Azure. * - * @return the updateState value. + * @param context The context to associate with this operation. + * @return the refreshed resource. */ - UpdateState updateState(); + SessionHost refresh(Context context); /** - * Gets the lastUpdateTime property: The timestamp of the last update. + * Retry provisioning on a SessionHost. * - * @return the lastUpdateTime value. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - OffsetDateTime lastUpdateTime(); + Response retryProvisioningWithResponse(Context context); /** - * Gets the updateErrorMessage property: The error message. + * Retry provisioning on a SessionHost. * - * @return the updateErrorMessage value. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - String updateErrorMessage(); + void retryProvisioning(); /** - * Gets the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. + * Operation to list the scoped RegistrationTokens associated with the SessionHost. * - * @return the sessionHostHealthCheckResults value. + * @param body 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ - List sessionHostHealthCheckResults(); + PagedIterable + listSingleSessionHostRegistrationTokens(ScopedRegistrationTokenProperties body); /** - * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner object. + * Operation to list the scoped RegistrationTokens associated with the SessionHost. * - * @return the inner object. + * @param body 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ - SessionHostInner innerModel(); + PagedIterable + listSingleSessionHostRegistrationTokens(ScopedRegistrationTokenProperties body, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java index 88562c131658..aafb9759dca5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class SessionHostComponentUpdateType extends ExpandableStringEnum { /** - * Static value Default for SessionHostComponentUpdateType. + * Agent and other agent side components are delivery schedule is controlled by WVD Infra. */ public static final SessionHostComponentUpdateType DEFAULT = fromString("Default"); /** - * Static value Scheduled for SessionHostComponentUpdateType. + * TenantAdmin have opted in for Scheduled Component Update feature. */ public static final SessionHostComponentUpdateType SCHEDULED = fromString("Scheduled"); 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..335127362942 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner; + +/** + * 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 properties property: Detailed properties for SessionHostConfiguration. + * + * @return the properties value. + */ + SessionHostConfigurationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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/SessionHostConfigurationPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java new file mode 100644 index 000000000000..8d9c55ff9a4c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..5622cf9cdfa6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatchProperties.java @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 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 DiskInfoProperties 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(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 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; + } + + /** + * {@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 = DiskInfoProperties.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/SessionHostConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationProperties.java new file mode 100644 index 000000000000..b5fc285d4f40 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationProperties.java @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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; + } + + /** + * {@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/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..da7ca6d0e185 --- /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) TypeSpec 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 { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java index 1e23bd693ee1..f467ecc23b07 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -37,7 +37,7 @@ public final class SessionHostHealthCheckFailureDetails /** * Creates an instance of SessionHostHealthCheckFailureDetails class. */ - public SessionHostHealthCheckFailureDetails() { + private SessionHostHealthCheckFailureDetails() { } /** @@ -67,14 +67,6 @@ public OffsetDateTime lastHealthCheckDateTime() { return this.lastHealthCheckDateTime; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java index c11b503d6b77..a44ee40050ab 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -34,7 +34,7 @@ public final class SessionHostHealthCheckReport implements JsonSerializable { /** - * Static value BreadthFirst for SessionHostLoadBalancingAlgorithm. + * Breadth First Algorithm for Load Balancing. */ public static final SessionHostLoadBalancingAlgorithm BREADTH_FIRST = fromString("BreadthFirst"); /** - * Static value DepthFirst for SessionHostLoadBalancingAlgorithm. + * Depth First Algorithm for Load Balancing. */ public static final SessionHostLoadBalancingAlgorithm DEPTH_FIRST = fromString("DepthFirst"); 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..c4f447b70c0e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagement.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 properties property: Detailed properties for SessionHostManagement. + * + * @return the properties value. + */ + SessionHostManagementProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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/SessionHostManagementOperationProgress.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java new file mode 100644 index 000000000000..fa69635d6f7f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * SessionHostManagement Operation Progress information. + */ +@Immutable +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. + */ + private SessionHostManagementOperationProgress() { + } + + /** + * Get the executionStartTime property: Time that the sessionHostManagement operation was created. + * + * @return the executionStartTime value. + */ + public OffsetDateTime executionStartTime() { + return this.executionStartTime; + } + + /** + * 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; + } + + /** + * Get the sessionHostsInProgress property: The number of sessionHosts in progress in the sessionHostManagement + * operation. + * + * @return the sessionHostsInProgress value. + */ + public Integer sessionHostsInProgress() { + return this.sessionHostsInProgress; + } + + /** + * Get the sessionHostsCompleted property: The number of sessionHosts completed in the sessionHostManagement + * operation. + * + * @return the sessionHostsCompleted value. + */ + public Integer sessionHostsCompleted() { + return this.sessionHostsCompleted; + } + + /** + * Get the sessionHostsRollbackFailed property: The number of sessionHosts rollback failed in the + * sessionHostManagement operation. + * + * @return the sessionHostsRollbackFailed value. + */ + public Integer sessionHostsRollbackFailed() { + return this.sessionHostsRollbackFailed; + } + + /** + * {@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..d3a607b1ade9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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..ca3bc68d15c3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatchProperties.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + + /* + * Parameters that apply when session hosts are provisioned. + */ + private SessionHostProvisioningConfigurationPatchProperties provisioning; + + /* + * The policy that should be applied when the Session Host provisioning operation fails. + */ + private FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy; + + /** + * 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; + } + + /** + * Get the provisioning property: Parameters that apply when session hosts are provisioned. + * + * @return the provisioning value. + */ + public SessionHostProvisioningConfigurationPatchProperties provisioning() { + return this.provisioning; + } + + /** + * Set the provisioning property: Parameters that apply when session hosts are provisioned. + * + * @param provisioning the provisioning value to set. + * @return the SessionHostManagementPatchProperties object itself. + */ + public SessionHostManagementPatchProperties + withProvisioning(SessionHostProvisioningConfigurationPatchProperties provisioning) { + this.provisioning = provisioning; + return this; + } + + /** + * Get the failedSessionHostCleanupPolicy property: The policy that should be applied when the Session Host + * provisioning operation fails. + * + * @return the failedSessionHostCleanupPolicy value. + */ + public FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy() { + return this.failedSessionHostCleanupPolicy; + } + + /** + * Set the failedSessionHostCleanupPolicy property: The policy that should be applied when the Session Host + * provisioning operation fails. + * + * @param failedSessionHostCleanupPolicy the failedSessionHostCleanupPolicy value to set. + * @return the SessionHostManagementPatchProperties object itself. + */ + public SessionHostManagementPatchProperties + withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy) { + this.failedSessionHostCleanupPolicy = failedSessionHostCleanupPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledDateTimeZone", this.scheduledDateTimeZone); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeJsonField("provisioning", this.provisioning); + jsonWriter.writeStringField("failedSessionHostCleanupPolicy", + this.failedSessionHostCleanupPolicy == null ? null : this.failedSessionHostCleanupPolicy.toString()); + 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 if ("provisioning".equals(fieldName)) { + deserializedSessionHostManagementPatchProperties.provisioning + = SessionHostProvisioningConfigurationPatchProperties.fromJson(reader); + } else if ("failedSessionHostCleanupPolicy".equals(fieldName)) { + deserializedSessionHostManagementPatchProperties.failedSessionHostCleanupPolicy + = FailedSessionHostCleanupPolicySHC.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProperties.java new file mode 100644 index 000000000000..4f53127b17f2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProperties.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * 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; + + /* + * Parameters that apply when session hosts are provisioned. + */ + private SessionHostProvisioningConfigurationProperties provisioning; + + /* + * The policy that should be applied when the Session Host provisioning operation fails. + */ + private FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy; + + /** + * 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; + } + + /** + * Get the provisioning property: Parameters that apply when session hosts are provisioned. + * + * @return the provisioning value. + */ + public SessionHostProvisioningConfigurationProperties provisioning() { + return this.provisioning; + } + + /** + * Set the provisioning property: Parameters that apply when session hosts are provisioned. + * + * @param provisioning the provisioning value to set. + * @return the SessionHostManagementProperties object itself. + */ + public SessionHostManagementProperties + withProvisioning(SessionHostProvisioningConfigurationProperties provisioning) { + this.provisioning = provisioning; + return this; + } + + /** + * Get the failedSessionHostCleanupPolicy property: The policy that should be applied when the Session Host + * provisioning operation fails. + * + * @return the failedSessionHostCleanupPolicy value. + */ + public FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy() { + return this.failedSessionHostCleanupPolicy; + } + + /** + * Set the failedSessionHostCleanupPolicy property: The policy that should be applied when the Session Host + * provisioning operation fails. + * + * @param failedSessionHostCleanupPolicy the failedSessionHostCleanupPolicy value to set. + * @return the SessionHostManagementProperties object itself. + */ + public SessionHostManagementProperties + withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC failedSessionHostCleanupPolicy) { + this.failedSessionHostCleanupPolicy = failedSessionHostCleanupPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledDateTimeZone", this.scheduledDateTimeZone); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeJsonField("provisioning", this.provisioning); + jsonWriter.writeStringField("failedSessionHostCleanupPolicy", + this.failedSessionHostCleanupPolicy == null ? null : this.failedSessionHostCleanupPolicy.toString()); + 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 if ("provisioning".equals(fieldName)) { + deserializedSessionHostManagementProperties.provisioning + = SessionHostProvisioningConfigurationProperties.fromJson(reader); + } else if ("failedSessionHostCleanupPolicy".equals(fieldName)) { + deserializedSessionHostManagementProperties.failedSessionHostCleanupPolicy + = FailedSessionHostCleanupPolicySHC.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationProgress.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationProgress.java new file mode 100644 index 000000000000..84af08170a7f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationProgress.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * SessionHostManagement Provisioning Operation Progress information. + */ +@Immutable +public final class SessionHostManagementProvisioningOperationProgress + implements JsonSerializable { + /* + * Time that the sessionHostManagement operation was created. + */ + private OffsetDateTime executionStartTime; + + /* + * The number of sessionHosts in progress in the sessionHostManagement provisioning operation + */ + private Integer sessionHostsInProgress; + + /* + * The number of sessionHosts completed in the sessionHostManagement provisioning operation. + */ + private Integer sessionHostsCompleted; + + /* + * The final instance count of the host pool for this provisioning operation. + */ + private Integer finalSessionHostsCount; + + /* + * The initial instance count of the host pool for this provisioning operation. + */ + private Integer initialSessionHostsCount; + + /** + * Creates an instance of SessionHostManagementProvisioningOperationProgress class. + */ + private SessionHostManagementProvisioningOperationProgress() { + } + + /** + * Get the executionStartTime property: Time that the sessionHostManagement operation was created. + * + * @return the executionStartTime value. + */ + public OffsetDateTime executionStartTime() { + return this.executionStartTime; + } + + /** + * Get the sessionHostsInProgress property: The number of sessionHosts in progress in the sessionHostManagement + * provisioning operation. + * + * @return the sessionHostsInProgress value. + */ + public Integer sessionHostsInProgress() { + return this.sessionHostsInProgress; + } + + /** + * Get the sessionHostsCompleted property: The number of sessionHosts completed in the sessionHostManagement + * provisioning operation. + * + * @return the sessionHostsCompleted value. + */ + public Integer sessionHostsCompleted() { + return this.sessionHostsCompleted; + } + + /** + * Get the finalSessionHostsCount property: The final instance count of the host pool for this provisioning + * operation. + * + * @return the finalSessionHostsCount value. + */ + public Integer finalSessionHostsCount() { + return this.finalSessionHostsCount; + } + + /** + * Get the initialSessionHostsCount property: The initial instance count of the host pool for this provisioning + * operation. + * + * @return the initialSessionHostsCount value. + */ + public Integer initialSessionHostsCount() { + return this.initialSessionHostsCount; + } + + /** + * {@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("sessionHostsInProgress", this.sessionHostsInProgress); + jsonWriter.writeNumberField("sessionHostsCompleted", this.sessionHostsCompleted); + jsonWriter.writeNumberField("finalSessionHostsCount", this.finalSessionHostsCount); + jsonWriter.writeNumberField("initialSessionHostsCount", this.initialSessionHostsCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostManagementProvisioningOperationProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostManagementProvisioningOperationProgress 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 SessionHostManagementProvisioningOperationProgress. + */ + public static SessionHostManagementProvisioningOperationProgress fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + SessionHostManagementProvisioningOperationProgress deserializedSessionHostManagementProvisioningOperationProgress + = new SessionHostManagementProvisioningOperationProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionStartTime".equals(fieldName)) { + deserializedSessionHostManagementProvisioningOperationProgress.executionStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sessionHostsInProgress".equals(fieldName)) { + deserializedSessionHostManagementProvisioningOperationProgress.sessionHostsInProgress + = reader.getNullable(JsonReader::getInt); + } else if ("sessionHostsCompleted".equals(fieldName)) { + deserializedSessionHostManagementProvisioningOperationProgress.sessionHostsCompleted + = reader.getNullable(JsonReader::getInt); + } else if ("finalSessionHostsCount".equals(fieldName)) { + deserializedSessionHostManagementProvisioningOperationProgress.finalSessionHostsCount + = reader.getNullable(JsonReader::getInt); + } else if ("initialSessionHostsCount".equals(fieldName)) { + deserializedSessionHostManagementProvisioningOperationProgress.initialSessionHostsCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostManagementProvisioningOperationProgress; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationStatus.java new file mode 100644 index 000000000000..5836080c434e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationStatus.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status for SessionHostManagementUpdate. + */ +public final class SessionHostManagementProvisioningOperationStatus + extends ExpandableStringEnum { + /** + * The operation is scheduled. + */ + public static final SessionHostManagementProvisioningOperationStatus SCHEDULED = fromString("Scheduled"); + + /** + * The operation is currently validating the provisioning. + */ + public static final SessionHostManagementProvisioningOperationStatus VALIDATING_SESSION_HOST_PROVISIONING + = fromString("ValidatingSessionHostProvisioning"); + + /** + * Canceling the operation. + */ + public static final SessionHostManagementProvisioningOperationStatus CANCELLING = fromString("Cancelling"); + + /** + * The operation is currently provisioning session hosts. + */ + public static final SessionHostManagementProvisioningOperationStatus PROVISIONING_SESSION_HOSTS + = fromString("ProvisioningSessionHosts"); + + /** + * The operation succeeded. + */ + public static final SessionHostManagementProvisioningOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * The operation failed. + */ + public static final SessionHostManagementProvisioningOperationStatus FAILED = fromString("Failed"); + + /** + * The operation is canceled. + */ + public static final SessionHostManagementProvisioningOperationStatus CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of SessionHostManagementProvisioningOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionHostManagementProvisioningOperationStatus() { + } + + /** + * Creates or finds a SessionHostManagementProvisioningOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionHostManagementProvisioningOperationStatus. + */ + public static SessionHostManagementProvisioningOperationStatus fromString(String name) { + return fromString(name, SessionHostManagementProvisioningOperationStatus.class); + } + + /** + * Gets known SessionHostManagementProvisioningOperationStatus values. + * + * @return known SessionHostManagementProvisioningOperationStatus values. + */ + public static Collection values() { + return values(SessionHostManagementProvisioningOperationStatus.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatus.java new file mode 100644 index 000000000000..1de2573af25b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatus.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SessionHostManagementProvisioningStatus. + */ +public interface SessionHostManagementProvisioningStatus { + /** + * 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. + * + * @return the status value. + */ + SessionHostManagementProvisioningOperationStatus status(); + + /** + * Gets the properties property: The custom properties of the SessionHost Provisioning Status. + * + * @return the properties value. + */ + SessionHostManagementProvisioningStatusProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner + * object. + * + * @return the inner object. + */ + SessionHostManagementProvisioningStatusInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatusProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatusProperties.java new file mode 100644 index 000000000000..31c5e4fc7160 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatusProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusPropertiesInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SessionHostManagementProvisioningStatusProperties. + */ +public interface SessionHostManagementProvisioningStatusProperties { + /** + * Gets the correlationId property: The correlation Id for Log Analytics. + * + * @return the correlationId value. + */ + String correlationId(); + + /** + * Gets the progress property: Progress information on the sessionHostManagement operation. + * + * @return the progress value. + */ + SessionHostManagementProvisioningOperationProgress 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.SessionHostManagementProvisioningStatusPropertiesInner + * object. + * + * @return the inner object. + */ + SessionHostManagementProvisioningStatusPropertiesInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatuses.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatuses.java new file mode 100644 index 000000000000..c432b1449cd7 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatuses.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 SessionHostManagementProvisioningStatuses. + */ +public interface SessionHostManagementProvisioningStatuses { + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Get the session host provisioning status for a given hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session host provisioning status for a given hostpool. + */ + SessionHostManagementProvisioningStatus get(String resourceGroupName, String hostPoolName); +} 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..5d35628096c8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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. + */ + UpdateStatus status(); + + /** + * Gets the properties property: Properties bag 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..dcdf5846e6ad --- /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) TypeSpec 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 correlation Id for 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/SessionHostManagementUpdateStatuses.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatuses.java new file mode 100644 index 000000000000..a2bb3c44200a --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatuses.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 SessionHostManagementUpdateStatuses. + */ +public interface SessionHostManagementUpdateStatuses { + /** + * 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/SessionHostManagements.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagements.java new file mode 100644 index 000000000000..aac7f0bec599 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; + +/** + * Resource collection API of SessionHostManagements. + */ +public interface SessionHostManagements { + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hostPoolName, Context context); + + /** + * Get a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SessionHostManagement. + */ + SessionHostManagement get(String resourceGroupName, String hostPoolName); + + /** + * Create or update a SessionHostManagement. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostManagement 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); + + /** + * 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); +} 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..bbe2c545142e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,93 +107,13 @@ 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(); - } - } - /** * {@inheritDoc} */ @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 +140,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 93% 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..c37965276cd2 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 @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -97,14 +97,6 @@ public SessionHostPatchProperties withFriendlyName(String friendlyName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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/models/SessionHostProperties.java similarity index 74% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProperties.java index fae62d39ef12..de78e36c3eda 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/models/SessionHostProperties.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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,12 +10,8 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport; -import com.azure.resourcemanager.desktopvirtualization.models.Status; -import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; import java.io.IOException; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -23,6 +19,21 @@ */ @Fluent public final class SessionHostProperties implements JsonSerializable { + /* + * Number of active sessions on SessionHost. + */ + private Integer activeSessions; + + /* + * Number of disconnected sessions on SessionHost. + */ + private Integer disconnectedSessions; + + /* + * Number of pending sessions on SessionHost. + */ + private Integer pendingSessions; + /* * ObjectId of SessionHost. (internal use) */ @@ -103,6 +114,17 @@ public final class SessionHostProperties implements JsonSerializable sessionHostHealthCheckResults() { - return this.sessionHostHealthCheckResults; + public String sessionHostConfiguration() { + return this.sessionHostConfiguration; } /** - * Validates the instance. + * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the sessionHostHealthCheckResults value. */ - public void validate() { - if (sessionHostHealthCheckResults() != null) { - sessionHostHealthCheckResults().forEach(e -> e.validate()); - } + public List sessionHostHealthCheckResults() { + return this.sessionHostHealthCheckResults; } /** @@ -405,18 +374,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lastHeartBeat", - this.lastHeartBeat == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastHeartBeat)); - jsonWriter.writeNumberField("sessions", this.sessions); - jsonWriter.writeStringField("agentVersion", this.agentVersion); jsonWriter.writeBooleanField("allowNewSession", this.allowNewSession); jsonWriter.writeStringField("assignedUser", this.assignedUser); jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("osVersion", this.osVersion); - jsonWriter.writeStringField("sxSStackVersion", this.sxSStackVersion); - jsonWriter.writeStringField("updateState", this.updateState == null ? null : this.updateState.toString()); - jsonWriter.writeStringField("updateErrorMessage", this.updateErrorMessage); return jsonWriter.writeEndObject(); } @@ -435,7 +395,13 @@ public static SessionHostProperties fromJson(JsonReader jsonReader) throws IOExc String fieldName = reader.getFieldName(); reader.nextToken(); - if ("objectId".equals(fieldName)) { + if ("activeSessions".equals(fieldName)) { + deserializedSessionHostProperties.activeSessions = reader.getNullable(JsonReader::getInt); + } else if ("disconnectedSessions".equals(fieldName)) { + deserializedSessionHostProperties.disconnectedSessions = reader.getNullable(JsonReader::getInt); + } else if ("pendingSessions".equals(fieldName)) { + deserializedSessionHostProperties.pendingSessions = reader.getNullable(JsonReader::getInt); + } else if ("objectId".equals(fieldName)) { deserializedSessionHostProperties.objectId = reader.getString(); } else if ("lastHeartBeat".equals(fieldName)) { deserializedSessionHostProperties.lastHeartBeat = reader @@ -470,6 +436,11 @@ public static SessionHostProperties fromJson(JsonReader jsonReader) throws IOExc .getNullable(nonNullReader -> 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/models/SessionHostProvisioningConfigurationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationPatchProperties.java new file mode 100644 index 000000000000..db899ab425cb --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationPatchProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 configuration for session host provisioning operations. + */ +@Fluent +public final class SessionHostProvisioningConfigurationPatchProperties + implements JsonSerializable { + /* + * Whether the session host should be set in drain mode following provisioning. + */ + private Boolean setDrainMode; + + /* + * The number of session hosts to exist in the Host Pool. + */ + private Integer instanceCount; + + /* + * Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session + * host provisioning operation. + */ + private CanaryPolicy canaryPolicy; + + /** + * Creates an instance of SessionHostProvisioningConfigurationPatchProperties class. + */ + public SessionHostProvisioningConfigurationPatchProperties() { + } + + /** + * Get the setDrainMode property: Whether the session host should be set in drain mode following provisioning. + * + * @return the setDrainMode value. + */ + public Boolean setDrainMode() { + return this.setDrainMode; + } + + /** + * Set the setDrainMode property: Whether the session host should be set in drain mode following provisioning. + * + * @param setDrainMode the setDrainMode value to set. + * @return the SessionHostProvisioningConfigurationPatchProperties object itself. + */ + public SessionHostProvisioningConfigurationPatchProperties withSetDrainMode(Boolean setDrainMode) { + this.setDrainMode = setDrainMode; + return this; + } + + /** + * Get the instanceCount property: The number of session hosts to exist in the Host Pool. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of session hosts to exist in the Host Pool. + * + * @param instanceCount the instanceCount value to set. + * @return the SessionHostProvisioningConfigurationPatchProperties object itself. + */ + public SessionHostProvisioningConfigurationPatchProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the canaryPolicy property: Policy on whether a Canary VM(a single VM to validate the configuration) should be + * provisioned during a session host provisioning operation. + * + * @return the canaryPolicy value. + */ + public CanaryPolicy canaryPolicy() { + return this.canaryPolicy; + } + + /** + * Set the canaryPolicy property: Policy on whether a Canary VM(a single VM to validate the configuration) should be + * provisioned during a session host provisioning operation. + * + * @param canaryPolicy the canaryPolicy value to set. + * @return the SessionHostProvisioningConfigurationPatchProperties object itself. + */ + public SessionHostProvisioningConfigurationPatchProperties withCanaryPolicy(CanaryPolicy canaryPolicy) { + this.canaryPolicy = canaryPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("setDrainMode", this.setDrainMode); + jsonWriter.writeNumberField("instanceCount", this.instanceCount); + jsonWriter.writeStringField("canaryPolicy", this.canaryPolicy == null ? null : this.canaryPolicy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostProvisioningConfigurationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostProvisioningConfigurationPatchProperties 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 SessionHostProvisioningConfigurationPatchProperties. + */ + public static SessionHostProvisioningConfigurationPatchProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + SessionHostProvisioningConfigurationPatchProperties deserializedSessionHostProvisioningConfigurationPatchProperties + = new SessionHostProvisioningConfigurationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("setDrainMode".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationPatchProperties.setDrainMode + = reader.getNullable(JsonReader::getBoolean); + } else if ("instanceCount".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationPatchProperties.instanceCount + = reader.getNullable(JsonReader::getInt); + } else if ("canaryPolicy".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationPatchProperties.canaryPolicy + = CanaryPolicy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostProvisioningConfigurationPatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationProperties.java new file mode 100644 index 000000000000..93a31c24ca08 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationProperties.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 configuration for session host provisioning operations. + */ +@Fluent +public final class SessionHostProvisioningConfigurationProperties + implements JsonSerializable { + /* + * Whether the session host should be set in drain mode following provisioning. + */ + private Boolean setDrainMode; + + /* + * The number of session hosts to exist in the Host Pool. + */ + private Integer instanceCount; + + /* + * Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session + * host provisioning operation. + */ + private CanaryPolicy canaryPolicy; + + /** + * Creates an instance of SessionHostProvisioningConfigurationProperties class. + */ + public SessionHostProvisioningConfigurationProperties() { + } + + /** + * Get the setDrainMode property: Whether the session host should be set in drain mode following provisioning. + * + * @return the setDrainMode value. + */ + public Boolean setDrainMode() { + return this.setDrainMode; + } + + /** + * Set the setDrainMode property: Whether the session host should be set in drain mode following provisioning. + * + * @param setDrainMode the setDrainMode value to set. + * @return the SessionHostProvisioningConfigurationProperties object itself. + */ + public SessionHostProvisioningConfigurationProperties withSetDrainMode(Boolean setDrainMode) { + this.setDrainMode = setDrainMode; + return this; + } + + /** + * Get the instanceCount property: The number of session hosts to exist in the Host Pool. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of session hosts to exist in the Host Pool. + * + * @param instanceCount the instanceCount value to set. + * @return the SessionHostProvisioningConfigurationProperties object itself. + */ + public SessionHostProvisioningConfigurationProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the canaryPolicy property: Policy on whether a Canary VM(a single VM to validate the configuration) should be + * provisioned during a session host provisioning operation. + * + * @return the canaryPolicy value. + */ + public CanaryPolicy canaryPolicy() { + return this.canaryPolicy; + } + + /** + * Set the canaryPolicy property: Policy on whether a Canary VM(a single VM to validate the configuration) should be + * provisioned during a session host provisioning operation. + * + * @param canaryPolicy the canaryPolicy value to set. + * @return the SessionHostProvisioningConfigurationProperties object itself. + */ + public SessionHostProvisioningConfigurationProperties withCanaryPolicy(CanaryPolicy canaryPolicy) { + this.canaryPolicy = canaryPolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("setDrainMode", this.setDrainMode); + jsonWriter.writeNumberField("instanceCount", this.instanceCount); + jsonWriter.writeStringField("canaryPolicy", this.canaryPolicy == null ? null : this.canaryPolicy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostProvisioningConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostProvisioningConfigurationProperties 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 SessionHostProvisioningConfigurationProperties. + */ + public static SessionHostProvisioningConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostProvisioningConfigurationProperties deserializedSessionHostProvisioningConfigurationProperties + = new SessionHostProvisioningConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("setDrainMode".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationProperties.setDrainMode + = reader.getNullable(JsonReader::getBoolean); + } else if ("instanceCount".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationProperties.instanceCount + = reader.getNullable(JsonReader::getInt); + } else if ("canaryPolicy".equals(fieldName)) { + deserializedSessionHostProvisioningConfigurationProperties.canaryPolicy + = CanaryPolicy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostProvisioningConfigurationProperties; + }); + } +} 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..a5bedf849c30 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -17,14 +17,14 @@ public interface 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 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 a session host along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Context context); /** @@ -32,20 +32,20 @@ Response getWithResponse(String resourceGroupName, String hostPoolN * * @param resourceGroupName The 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 sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a session host. */ - SessionHost get(String resourceGroupName, String hostPoolName, String sessionHostname); + SessionHost get(String resourceGroupName, String hostPoolName, String sessionHostName); /** * 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 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. @@ -53,7 +53,7 @@ Response getWithResponse(String resourceGroupName, String hostPoolN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, Boolean force, Context context); /** @@ -61,69 +61,152 @@ 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 sessionHostname The name of the session host within the specified host pool. + * @param sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String hostPoolName, String sessionHostname); + void delete(String resourceGroupName, String hostPoolName, String sessionHostName); /** - * Update 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 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 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 represents a SessionHost definition along with {@link Response}. + * @return list of SessionHost definitions as paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - Boolean force, SessionHostPatch sessionHost, Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, String vmPath, Context context); /** - * Update a session host. + * Retry provisioning on a SessionHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. - * @param sessionHostname The name of the session host within the specified host pool. + * @param 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 represents a SessionHost definition. + * @return the {@link Response}. */ - SessionHost update(String resourceGroupName, String hostPoolName, String sessionHostname); + Response retryProvisioningWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + Context context); /** - * List sessionHosts. + * Retry provisioning on a SessionHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. + * @param sessionHostName The name of the session host within the specified host pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sessionHostList as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName); + void retryProvisioning(String resourceGroupName, String hostPoolName, String sessionHostName); /** - * List sessionHosts. + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 list of RegistrationToken definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body); + + /** + * Operation to list the scoped RegistrationTokens associated with the 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 body 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 sessionHostList as paginated response with {@link PagedIterable}. + * @return list of RegistrationToken definitions as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, - Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listSingleSessionHostRegistrationTokens(String resourceGroupName, + String hostPoolName, String sessionHostName, ScopedRegistrationTokenProperties body, Context context); + + /** + * Get a session host. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a session host along with {@link Response}. + */ + SessionHost getById(String id); + + /** + * Get a session host. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove a SessionHost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove a SessionHost. + * + * @param id the resource ID. + * @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 the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Boolean force, Context context); + + /** + * Begins definition for a new SessionHost resource. + * + * @param name resource name. + * @return the first stage of the new SessionHost definition. + */ + SessionHost.DefinitionStages.Blank define(String name); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java index f36167f9ec4d..258e70a44652 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,32 +12,32 @@ */ public final class SessionState extends ExpandableStringEnum { /** - * Static value Unknown for SessionState. + * SessionState is unknown. */ public static final SessionState UNKNOWN = fromString("Unknown"); /** - * Static value Active for SessionState. + * Session is active. */ public static final SessionState ACTIVE = fromString("Active"); /** - * Static value Disconnected for SessionState. + * Session is disconnected. */ public static final SessionState DISCONNECTED = fromString("Disconnected"); /** - * Static value Pending for SessionState. + * Session is pending connection. */ public static final SessionState PENDING = fromString("Pending"); /** - * Static value LogOff for SessionState. + * Session is logging off. */ public static final SessionState LOG_OFF = fromString("LogOff"); /** - * Static value UserProfileDiskMounted for SessionState. + * Session has mounted user profile disk. */ public static final SessionState USER_PROFILE_DISK_MOUNTED = fromString("UserProfileDiskMounted"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java index 5244dc3b2519..fc0e487b301d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,12 +13,12 @@ */ public final class SetStartVMOnConnect extends ExpandableStringEnum { /** - * Static value Enable for SetStartVMOnConnect. + * Start VM on Connect is enabled. */ public static final SetStartVMOnConnect ENABLE = fromString("Enable"); /** - * Static value Disable for SetStartVMOnConnect. + * Start VM on Connect is disabled, must use rampUpAutoStartHosts or turn on manually. */ public static final SetStartVMOnConnect DISABLE = fromString("Disable"); 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..f177f9a97729 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -16,9 +15,9 @@ * 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 + * The name of the SKU. Ex - P3. It is typically a letter+number code */ private String name; @@ -52,7 +51,7 @@ public Sku() { } /** - * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. * * @return the name value. */ @@ -61,7 +60,7 @@ public String name() { } /** - * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. * * @param name the name value to set. * @return the Sku object itself. @@ -159,19 +158,6 @@ public Sku withCapacity(Integer capacity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java index 0e5bbade00b4..80af71cde664 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -10,22 +10,22 @@ */ public enum SkuTier { /** - * Enum value Free. + * The Free service tier. */ FREE("Free"), /** - * Enum value Basic. + * The Basic service tier. */ BASIC("Basic"), /** - * Enum value Standard. + * The Standard service tier. */ STANDARD("Standard"), /** - * Enum value Premium. + * The Premium service tier. */ PREMIUM("Premium"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java index 46749d1f1900..84a9a705ba7b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,22 +12,22 @@ */ public final class SsoSecretType extends ExpandableStringEnum { /** - * Static value SharedKey for SsoSecretType. + * The SSO Secret is a Shared Key. */ public static final SsoSecretType SHARED_KEY = fromString("SharedKey"); /** - * Static value Certificate for SsoSecretType. + * The SSO Secret is a Certificate. */ public static final SsoSecretType CERTIFICATE = fromString("Certificate"); /** - * Static value SharedKeyInKeyVault for SsoSecretType. + * The SSO Secret is a SharedKey that is stored in KeyVault. */ public static final SsoSecretType SHARED_KEY_IN_KEY_VAULT = fromString("SharedKeyInKeyVault"); /** - * Static value CertificateInKeyVault for SsoSecretType. + * The SSO Secret is a Certificate that is stored in KeyVault. */ public static final SsoSecretType CERTIFICATE_IN_KEY_VAULT = fromString("CertificateInKeyVault"); 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..828ddf8f1d79 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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/fluent/models/StartMenuItemProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemProperties.java similarity index 66% 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..5cb18da53d7e 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Schema for StartMenuItem properties. */ -@Fluent +@Immutable public final class StartMenuItemProperties implements JsonSerializable { /* * Alias of StartMenuItem. @@ -44,7 +44,7 @@ public final class StartMenuItemProperties implements JsonSerializable 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/StartupBehavior.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java index fc1290bb8cbc..dc44bfe27547 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,17 +12,18 @@ */ public final class StartupBehavior extends ExpandableStringEnum { /** - * Static value None for StartupBehavior. + * Session hosts will not be started by the service. This setting depends on Start VM on Connect to be enabled to + * start the session hosts. */ public static final StartupBehavior NONE = fromString("None"); /** - * Static value WithAssignedUser for StartupBehavior. + * Session hosts with an assigned user will be started during Ramp Up. */ public static final StartupBehavior WITH_ASSIGNED_USER = fromString("WithAssignedUser"); /** - * Static value All for StartupBehavior. + * All personal session hosts in the hostpool will be started during ramp up. */ public static final StartupBehavior ALL = fromString("All"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java index 8445394a6070..d54f49d0d44a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,62 +12,65 @@ */ public final class Status extends ExpandableStringEnum { /** - * Static value Available for Status. + * Session Host has passed all the health checks and is available to handle connections. */ public static final Status AVAILABLE = fromString("Available"); /** - * Static value Unavailable for Status. + * Session Host is either turned off or has failed critical health checks which is causing service not to be able to + * route connections to this session host. Note this replaces previous 'NoHeartBeat' status. */ public static final Status UNAVAILABLE = fromString("Unavailable"); /** - * Static value Shutdown for Status. + * Session Host is shutdown - RD Agent reported session host to be stopped or deallocated. */ public static final Status SHUTDOWN = fromString("Shutdown"); /** - * Static value Disconnected for Status. + * The Session Host is unavailable because it is currently disconnected. */ public static final Status DISCONNECTED = fromString("Disconnected"); /** - * Static value Upgrading for Status. + * Session Host is unavailable because currently an upgrade of RDAgent/side-by-side stack is in progress. Note: this + * state will be removed once the upgrade completes and the host is able to accept connections. */ public static final Status UPGRADING = fromString("Upgrading"); /** - * Static value UpgradeFailed for Status. + * Session Host is unavailable because the critical component upgrade (agent, side-by-side stack, etc.) failed. */ public static final Status UPGRADE_FAILED = fromString("UpgradeFailed"); /** - * Static value NoHeartbeat for Status. + * The Session Host is not heart beating. */ public static final Status NO_HEARTBEAT = fromString("NoHeartbeat"); /** - * Static value NotJoinedToDomain for Status. + * SessionHost is not joined to domain. */ public static final Status NOT_JOINED_TO_DOMAIN = fromString("NotJoinedToDomain"); /** - * Static value DomainTrustRelationshipLost for Status. + * SessionHost's domain trust relationship lost. */ public static final Status DOMAIN_TRUST_RELATIONSHIP_LOST = fromString("DomainTrustRelationshipLost"); /** - * Static value SxSStackListenerNotReady for Status. + * SxS stack installed on the SessionHost is not ready to receive connections. */ public static final Status SX_SSTACK_LISTENER_NOT_READY = fromString("SxSStackListenerNotReady"); /** - * Static value FSLogixNotHealthy for Status. + * FSLogix is in an unhealthy state on the session host. */ public static final Status FSLOGIX_NOT_HEALTHY = fromString("FSLogixNotHealthy"); /** - * Static value NeedsAssistance for Status. + * New status to inform admins that the health on their endpoint needs to be fixed. The connections might not fail, + * as these issues are not fatal. */ public static final Status NEEDS_ASSISTANCE = fromString("NeedsAssistance"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java index 8ae21b0b2d4c..ce50f59623e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,12 +12,12 @@ */ public final class StopHostsWhen extends ExpandableStringEnum { /** - * Static value ZeroSessions for StopHostsWhen. + * Zero Total Sessions. */ public static final StopHostsWhen ZERO_SESSIONS = fromString("ZeroSessions"); /** - * Static value ZeroActiveSessions for StopHostsWhen. + * Zero Active Sessions. */ public static final StopHostsWhen ZERO_ACTIVE_SESSIONS = fromString("ZeroActiveSessions"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java index 3dc11fc674e2..935b14023f70 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -72,14 +72,6 @@ public Time withMinute(int minute) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..575f33b7c3d8 --- /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) TypeSpec 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 { + /** + * Using default marketplace images offered by Azure Marketplace. + */ + public static final Type MARKETPLACE = fromString("Marketplace"); + + /** + * Using a custom image. + */ + 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..5a7feb7f4de4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateSessionHostsRequestBody.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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/UpdateState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateState.java index 5536e71c9bb3..293396dad371 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -12,27 +12,27 @@ */ public final class UpdateState extends ExpandableStringEnum { /** - * Static value Initial for UpdateState. + * Update is initializing. */ public static final UpdateState INITIAL = fromString("Initial"); /** - * Static value Pending for UpdateState. + * Update is pending. */ public static final UpdateState PENDING = fromString("Pending"); /** - * Static value Started for UpdateState. + * Update has started. */ public static final UpdateState STARTED = fromString("Started"); /** - * Static value Succeeded for UpdateState. + * Update has succeeded. */ public static final UpdateState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for UpdateState. + * Update has failed. */ public static final UpdateState FAILED = fromString("Failed"); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateStatus.java new file mode 100644 index 000000000000..fbc80ae0c042 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateStatus.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status for SessionHostManagementUpdate. + */ +public final class UpdateStatus extends ExpandableStringEnum { + /** + * The operation has an error. + */ + public static final UpdateStatus ERROR = fromString("Error"); + + /** + * The operation is scheduled. + */ + public static final UpdateStatus SCHEDULED = fromString("Scheduled"); + + /** + * The operation is currently updating Session Hosts. + */ + public static final UpdateStatus UPDATING_SESSION_HOSTS = fromString("UpdatingSessionHosts"); + + /** + * The operation is validating the update. + */ + public static final UpdateStatus VALIDATING_SESSION_HOST_UPDATE = fromString("ValidatingSessionHostUpdate"); + + /** + * The operation is paused. + */ + public static final UpdateStatus PAUSED = fromString("Paused"); + + /** + * The operation is pausing. + */ + public static final UpdateStatus PAUSING = fromString("Pausing"); + + /** + * Canceling the operation. + */ + public static final UpdateStatus CANCELLING = fromString("Cancelling"); + + /** + * The operation succeeded. + */ + public static final UpdateStatus SUCCEEDED = fromString("Succeeded"); + + /** + * The operation failed. + */ + public static final UpdateStatus FAILED = fromString("Failed"); + + /** + * The operation is canceled. + */ + public static final UpdateStatus CANCELLED = fromString("Cancelled"); + + /** + * Creates a new instance of UpdateStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateStatus() { + } + + /** + * Creates or finds a UpdateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateStatus. + */ + public static UpdateStatus fromString(String name) { + return fromString(name, UpdateStatus.class); + } + + /** + * Gets known UpdateStatus values. + * + * @return known UpdateStatus values. + */ + public static Collection values() { + return values(UpdateStatus.class); + } +} 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..c173192530f1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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; + } + + /** + * {@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/UserSession.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSession.java index 29a03ac0dc10..5a3e3ab6c8b6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSession.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSession.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner; -import java.time.OffsetDateTime; /** * An immutable client-side representation of UserSession. @@ -34,53 +33,18 @@ public interface UserSession { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of user session. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the userPrincipalName property: The user principal name. - * - * @return the userPrincipalName value. - */ - String userPrincipalName(); - - /** - * Gets the applicationType property: Application type of application. + * Gets the properties property: Detailed properties for UserSession. * - * @return the applicationType value. + * @return the properties value. */ - ApplicationType applicationType(); + UserSessionProperties properties(); /** - * Gets the sessionState property: State of user session. - * - * @return the sessionState value. - */ - SessionState sessionState(); - - /** - * Gets the activeDirectoryUsername property: The active directory user name. - * - * @return the activeDirectoryUsername value. - */ - String activeDirectoryUsername(); - - /** - * Gets the createTime property: The timestamp of the user session create. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the createTime value. + * @return the systemData value. */ - OffsetDateTime createTime(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner object. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionProperties.java similarity index 64% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionProperties.java index 836ffc197615..cb7b440fdaee 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionProperties.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; -import com.azure.resourcemanager.desktopvirtualization.models.SessionState; import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; @@ -19,7 +17,7 @@ /** * Schema for UserSession properties. */ -@Fluent +@Immutable public final class UserSessionProperties implements JsonSerializable { /* * ObjectId of user session. (internal use) @@ -44,7 +42,7 @@ public final class UserSessionProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); 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..24d60a5f401c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -13,114 +13,114 @@ */ public interface UserSessions { /** - * List userSessions. + * Get 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 a userSession along with {@link Response}. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Context context); /** - * List userSessions. + * Get 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 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. + * @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 PagedIterable}. + * @return a userSession. */ - PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + UserSession get(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** - * Get a userSession. + * Remove 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 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 force Force flag to login off userSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a userSession along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, + String userSessionId, Boolean force, Context context); /** - * Get a userSession. + * Remove 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 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 userSession. */ - UserSession get(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void delete(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. - * @param force Force flag to login off userSession. - * @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 the {@link Response}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, - String userSessionId, Boolean force, Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName); /** - * Remove a userSession. + * 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 userSessionId The name of the user session within the specified session host. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 delete(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** - * List userSessions. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list(String resourceGroupName, String hostPoolName, String sessionHostname); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName); /** - * List userSessions. + * 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 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. @@ -128,9 +128,9 @@ 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 userSessionList as paginated response with {@link PagedIterable}. + * @return list of UserSession definitions as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** @@ -138,7 +138,7 @@ PagedIterable list(String resourceGroupName, String hostPoolName, 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 sessionHostname The name of the session host within the specified host pool. + * @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. @@ -146,7 +146,7 @@ PagedIterable list(String resourceGroupName, String hostPoolName, S * @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, + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Context context); /** @@ -154,29 +154,29 @@ Response disconnectWithResponse(String resourceGroupName, String hostPoolN * * @param resourceGroupName The 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 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. */ - void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void disconnect(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); /** * 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 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 sendMessage Represents message sent to a UserSession. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage, Context context); /** @@ -184,11 +184,11 @@ Response sendMessageWithResponse(String resourceGroupName, String 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 sessionHostname The name of the session host within the specified host pool. + * @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. */ - void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); } 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..95f536216faf --- /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) TypeSpec 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 { + /** + * Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. + */ + public static final VirtualMachineDiskType STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Premium SSD locally redundant storage. Best for production and performance sensitive workloads. + */ + public static final VirtualMachineDiskType PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test. + */ + 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..6c6f02680903 --- /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) TypeSpec 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 { + /** + * Standard security protocol. No additional parameters. + */ + public static final VirtualMachineSecurityType STANDARD = fromString("Standard"); + + /** + * TrustedLaunch allows for secure boot and vTpm. + */ + public static final VirtualMachineSecurityType TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * Confidential Virtual Machine security protocol. + */ + 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..10323006501b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -8,7 +8,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner; -import java.util.List; import java.util.Map; /** @@ -51,111 +50,67 @@ 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 properties property: Detailed properties for Workspace. * - * @return the managedBy value. + * @return the properties value. */ - String managedBy(); + WorkspaceProperties properties(); /** - * 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 - * validate and persist this value. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the kind value. + * @return the identity value. */ - String kind(); + ManagedServiceIdentity identity(); /** - * 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 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 identity property: The identity property. + * 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 + * validate and persist this value. * - * @return the identity value. + * @return the kind value. */ - ResourceModelWithAllowedPropertySetIdentity identity(); + String kind(); /** - * Gets the sku property: The sku property. + * 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 sku value. + * @return the managedBy value. */ - ResourceModelWithAllowedPropertySetSku sku(); + String managedBy(); /** - * Gets the plan property: The plan property. + * Gets the plan property: Details of the resource plan. * * @return the plan value. */ - ResourceModelWithAllowedPropertySetPlan plan(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the objectId property: ObjectId of Workspace. (internal use). - * - * @return the objectId value. - */ - String objectId(); - - /** - * Gets the description property: Description of Workspace. - * - * @return the description value. - */ - String description(); + Plan plan(); /** - * Gets the friendlyName property: Friendly name of Workspace. + * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource. * - * @return the friendlyName value. - */ - String friendlyName(); - - /** - * Gets the applicationGroupReferences property: List of applicationGroup resource Ids. - * - * @return the applicationGroupReferences value. - */ - List applicationGroupReferences(); - - /** - * Gets the cloudPcResource property: Is cloud pc resource. - * - * @return the cloudPcResource value. - */ - Boolean cloudPcResource(); - - /** - * Gets the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. - * - * @return the publicNetworkAccess value. + * @return the sku value. */ - PublicNetworkAccess publicNetworkAccess(); + Sku sku(); /** - * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified - * resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the privateEndpointConnections value. + * @return the systemData value. */ - List privateEndpointConnections(); + SystemData systemData(); /** * Gets the region of the resource. @@ -240,10 +195,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, - DefinitionStages.WithApplicationGroupReferences, DefinitionStages.WithPublicNetworkAccess { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties, + DefinitionStages.WithIdentity, DefinitionStages.WithKind, DefinitionStages.WithManagedBy, + DefinitionStages.WithPlan, DefinitionStages.WithSku { /** * Executes the create request. * @@ -274,38 +228,16 @@ interface WithTags { } /** - * The stage of the Workspace definition allowing to specify managedBy. - */ - interface WithManagedBy { - /** - * 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 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 withManagedBy(String managedBy); - } - - /** - * The stage of the Workspace definition allowing to specify kind. + * The stage of the Workspace definition allowing to specify properties. */ - interface WithKind { + interface WithProperties { /** - * 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 - * resource provider must validate and persist this value.. + * Specifies the properties property: Detailed properties for Workspace. * - * @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 - * validate and persist this value. + * @param properties Detailed properties for Workspace. * @return the next definition stage. */ - WithCreate withKind(String kind); + WithCreate withProperties(WorkspaceProperties properties); } /** @@ -313,92 +245,73 @@ interface WithKind { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. - * - * @param identity The identity property. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); - } - - /** - * The stage of the Workspace definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The sku property.. - * - * @param sku The sku property. - * @return the next definition stage. - */ - WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); - } - - /** - * The stage of the Workspace definition allowing to specify plan. - */ - interface WithPlan { - /** - * Specifies the plan property: The plan property.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param plan The plan property. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); + WithCreate withIdentity(ManagedServiceIdentity identity); } /** - * The stage of the Workspace definition allowing to specify description. + * The stage of the Workspace definition allowing to specify kind. */ - interface WithDescription { + interface WithKind { /** - * Specifies the description property: Description of Workspace.. + * 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 + * resource provider must validate and persist this value.. * - * @param description Description of Workspace. + * @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 + * validate and persist this value. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withKind(String kind); } /** - * The stage of the Workspace definition allowing to specify friendlyName. + * The stage of the Workspace definition allowing to specify managedBy. */ - interface WithFriendlyName { + interface WithManagedBy { /** - * Specifies the friendlyName property: Friendly name of Workspace.. + * 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 friendlyName Friendly name of Workspace. + * @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 withFriendlyName(String friendlyName); + WithCreate withManagedBy(String managedBy); } /** - * The stage of the Workspace definition allowing to specify applicationGroupReferences. + * The stage of the Workspace definition allowing to specify plan. */ - interface WithApplicationGroupReferences { + interface WithPlan { /** - * Specifies the applicationGroupReferences property: List of applicationGroup resource Ids.. + * Specifies the plan property: Details of the resource plan.. * - * @param applicationGroupReferences List of applicationGroup resource Ids. + * @param plan Details of the resource plan. * @return the next definition stage. */ - WithCreate withApplicationGroupReferences(List applicationGroupReferences); + WithCreate withPlan(Plan plan); } /** - * The stage of the Workspace definition allowing to specify publicNetworkAccess. + * The stage of the Workspace definition allowing to specify sku. */ - interface WithPublicNetworkAccess { + interface WithSku { /** - * Specifies the publicNetworkAccess property: Enabled allows this resource to be accessed from both public - * and private networks, Disabled allows this resource to only be accessed via private endpoints. + * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource.. * - * @param publicNetworkAccess Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * @param sku The SKU (Stock Keeping Unit) assigned to this resource. * @return the next definition stage. */ - WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + WithCreate withSku(Sku sku); } } @@ -412,8 +325,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 +360,16 @@ interface WithTags { } /** - * The stage of the Workspace update allowing to specify description. - */ - 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. + * The stage of the Workspace update allowing to specify properties. */ - 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/WorkspacePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java index f7e3f2dbdadd..de30bcb882f1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -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,117 +54,25 @@ 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. - * @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. + * @param properties the properties 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); + public WorkspacePatch withProperties(WorkspacePatchProperties properties) { + this.properties = properties; 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); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -174,7 +80,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 +103,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 94% 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..0efe3398a453 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 @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -124,14 +123,6 @@ public WorkspacePatchProperties withPublicNetworkAccess(PublicNetworkAccess publ return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceProperties.java similarity index 79% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceProperties.java index 1c68552c6239..a54a8e275c23 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; import java.io.IOException; import java.util.List; @@ -55,6 +53,16 @@ public final class WorkspaceProperties implements JsonSerializable privateEndpointConnections; + /* + * Tenant that the resource is being requested on behalf of. + */ + private String oboTenantId; + + /* + * DeploymentScope type for Workspace. + */ + private DeploymentScope deploymentScope; + /** * Creates an instance of WorkspaceProperties class. */ @@ -172,14 +180,43 @@ public List privateEndpointConnections() { } /** - * Validates the instance. + * Get the oboTenantId property: Tenant that the resource is being requested on behalf of. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the oboTenantId value. */ - public void validate() { - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } + public String oboTenantId() { + return this.oboTenantId; + } + + /** + * Set the oboTenantId property: Tenant that the resource is being requested on behalf of. + * + * @param oboTenantId the oboTenantId value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withOboTenantId(String oboTenantId) { + this.oboTenantId = oboTenantId; + return this; + } + + /** + * Get the deploymentScope property: DeploymentScope type for Workspace. + * + * @return the deploymentScope value. + */ + public DeploymentScope deploymentScope() { + return this.deploymentScope; + } + + /** + * Set the deploymentScope property: DeploymentScope type for Workspace. + * + * @param deploymentScope the deploymentScope value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withDeploymentScope(DeploymentScope deploymentScope) { + this.deploymentScope = deploymentScope; + return this; } /** @@ -194,6 +231,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeStringField("oboTenantId", this.oboTenantId); + jsonWriter.writeStringField("deploymentScope", + this.deploymentScope == null ? null : this.deploymentScope.toString()); return jsonWriter.writeEndObject(); } @@ -230,6 +270,10 @@ public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOExcep List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); deserializedWorkspaceProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("oboTenantId".equals(fieldName)) { + deserializedWorkspaceProperties.oboTenantId = reader.getString(); + } else if ("deploymentScope".equals(fieldName)) { + deserializedWorkspaceProperties.deploymentScope = DeploymentScope.fromString(reader.getString()); } else { reader.skipChildren(); } 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..5ffd60b5fc88 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.models; @@ -68,7 +68,7 @@ public interface Workspaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -83,7 +83,7 @@ public interface Workspaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); @@ -93,7 +93,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer p * * @throws com.azure.core.management.exception.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 list of Workspace definitions as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -104,7 +104,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer p * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of Workspace definitions 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/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java index ac9ee1c6643f..42ac19a601e3 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for DesktopVirtualizationApiClient. - * null. + * Package containing the data models for DesktopVirtualization. + * 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..4e8066212469 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for DesktopVirtualizationApiClient. - * null. + * Package containing the classes for DesktopVirtualization. + * This Typespec represents the Desktop Virtualization API interfaces. */ package com.azure.resourcemanager.desktopvirtualization; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java index 59dad6cee88a..67f0a4d5805b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.desktopvirtualization { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.desktopvirtualization.fluent.models to com.azure.core; opens com.azure.resourcemanager.desktopvirtualization.models to com.azure.core; + opens com.azure.resourcemanager.desktopvirtualization.implementation.models to com.azure.core; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/azure-resourcemanager-desktopvirtualization_metadata.json b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/azure-resourcemanager-desktopvirtualization_metadata.json new file mode 100644 index 000000000000..7b01209972a8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/azure-resourcemanager-desktopvirtualization_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.DesktopVirtualization":"2026-01-01-preview"},"crossLanguagePackageId":"Microsoft.DesktopVirtualization","crossLanguageVersion":"bbd4e3cc9f2d","crossLanguageDefinitions":{"com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.get":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.getAsync":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.getWithResponse":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.listByHostPool":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.ActiveSessionHostConfigurationsClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurations.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient":"Microsoft.DesktopVirtualization.AppAttachPackageInfo","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient.importMethod":"Microsoft.DesktopVirtualization.AppAttachPackageInfo.import","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient.importMethodAsync":"Microsoft.DesktopVirtualization.AppAttachPackageInfo.import","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient":"Microsoft.DesktopVirtualization.AppAttachPackages","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.createOrUpdate":"Microsoft.DesktopVirtualization.AppAttachPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.AppAttachPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.delete":"Microsoft.DesktopVirtualization.AppAttachPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.deleteAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.deleteWithResponse":"Microsoft.DesktopVirtualization.AppAttachPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.getByResourceGroup":"Microsoft.DesktopVirtualization.AppAttachPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.getByResourceGroupAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.getByResourceGroupWithResponse":"Microsoft.DesktopVirtualization.AppAttachPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.getByResourceGroupWithResponseAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.list":"Microsoft.DesktopVirtualization.AppAttachPackages.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.listAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.listByResourceGroup":"Microsoft.DesktopVirtualization.AppAttachPackages.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.listByResourceGroupAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.update":"Microsoft.DesktopVirtualization.AppAttachPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.updateAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.updateWithResponse":"Microsoft.DesktopVirtualization.AppAttachPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.AppAttachPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient":"Microsoft.DesktopVirtualization.ApplicationGroups","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.createOrUpdate":"Microsoft.DesktopVirtualization.ApplicationGroups.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.ApplicationGroups.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.delete":"Microsoft.DesktopVirtualization.ApplicationGroups.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.deleteAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.deleteWithResponse":"Microsoft.DesktopVirtualization.ApplicationGroups.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.getByResourceGroup":"Microsoft.DesktopVirtualization.ApplicationGroups.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.getByResourceGroupAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.getByResourceGroupWithResponse":"Microsoft.DesktopVirtualization.ApplicationGroups.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.getByResourceGroupWithResponseAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.list":"Microsoft.DesktopVirtualization.ApplicationGroups.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.listAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.listByResourceGroup":"Microsoft.DesktopVirtualization.ApplicationGroups.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.listByResourceGroupAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.update":"Microsoft.DesktopVirtualization.ApplicationGroups.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.updateAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.updateWithResponse":"Microsoft.DesktopVirtualization.ApplicationGroups.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.ApplicationGroups.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient":"Microsoft.DesktopVirtualization.Applications","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.createOrUpdate":"Microsoft.DesktopVirtualization.Applications.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.Applications.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.Applications.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.Applications.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.delete":"Microsoft.DesktopVirtualization.Applications.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.deleteAsync":"Microsoft.DesktopVirtualization.Applications.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.deleteWithResponse":"Microsoft.DesktopVirtualization.Applications.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.Applications.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.get":"Microsoft.DesktopVirtualization.Applications.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.getAsync":"Microsoft.DesktopVirtualization.Applications.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.getWithResponse":"Microsoft.DesktopVirtualization.Applications.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.Applications.get","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.list":"Microsoft.DesktopVirtualization.Applications.list","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.listAsync":"Microsoft.DesktopVirtualization.Applications.list","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.update":"Microsoft.DesktopVirtualization.Applications.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.updateAsync":"Microsoft.DesktopVirtualization.Applications.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.updateWithResponse":"Microsoft.DesktopVirtualization.Applications.update","com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.Applications.update","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient.beginPost":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient.beginPostAsync":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient.post":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient.postAsync":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostProvisioningsClient.postWithResponseAsync":"Microsoft.DesktopVirtualization.ControlSessionHostProvisioning.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient.beginPost":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient.beginPostAsync":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient.post":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient.postAsync":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.ControlSessionHostUpdatesClient.postWithResponseAsync":"Microsoft.DesktopVirtualization.ControlSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationManagementClient":"Microsoft.DesktopVirtualization","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient":"Microsoft.DesktopVirtualization.Desktops","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.get":"Microsoft.DesktopVirtualization.Desktops.get","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.getAsync":"Microsoft.DesktopVirtualization.Desktops.get","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.getWithResponse":"Microsoft.DesktopVirtualization.Desktops.get","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.Desktops.get","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.list":"Microsoft.DesktopVirtualization.Desktops.list","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.listAsync":"Microsoft.DesktopVirtualization.Desktops.list","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.update":"Microsoft.DesktopVirtualization.Desktops.update","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.updateAsync":"Microsoft.DesktopVirtualization.Desktops.update","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.updateWithResponse":"Microsoft.DesktopVirtualization.Desktops.update","com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.Desktops.update","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient":"Microsoft.DesktopVirtualization.HostPools","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.createOrUpdate":"Microsoft.DesktopVirtualization.HostPools.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.HostPools.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.HostPools.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.HostPools.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.delete":"Microsoft.DesktopVirtualization.HostPools.delete","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.deleteAsync":"Microsoft.DesktopVirtualization.HostPools.delete","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.deleteWithResponse":"Microsoft.DesktopVirtualization.HostPools.delete","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.HostPools.delete","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.getByResourceGroup":"Microsoft.DesktopVirtualization.HostPools.get","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.getByResourceGroupAsync":"Microsoft.DesktopVirtualization.HostPools.get","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.getByResourceGroupWithResponse":"Microsoft.DesktopVirtualization.HostPools.get","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.getByResourceGroupWithResponseAsync":"Microsoft.DesktopVirtualization.HostPools.get","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.list":"Microsoft.DesktopVirtualization.HostPools.list","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.listAsync":"Microsoft.DesktopVirtualization.HostPools.list","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.listByResourceGroup":"Microsoft.DesktopVirtualization.HostPools.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.listByResourceGroupAsync":"Microsoft.DesktopVirtualization.HostPools.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.listRegistrationTokens":"Microsoft.DesktopVirtualization.HostPools.listRegistrationTokens","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.listRegistrationTokensAsync":"Microsoft.DesktopVirtualization.HostPools.listRegistrationTokens","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.retrieveRegistrationToken":"Microsoft.DesktopVirtualization.HostPools.retrieveRegistrationToken","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.retrieveRegistrationTokenAsync":"Microsoft.DesktopVirtualization.HostPools.retrieveRegistrationToken","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.retrieveRegistrationTokenWithResponse":"Microsoft.DesktopVirtualization.HostPools.retrieveRegistrationToken","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.retrieveRegistrationTokenWithResponseAsync":"Microsoft.DesktopVirtualization.HostPools.retrieveRegistrationToken","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.update":"Microsoft.DesktopVirtualization.HostPools.update","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.updateAsync":"Microsoft.DesktopVirtualization.HostPools.update","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.updateWithResponse":"Microsoft.DesktopVirtualization.HostPools.update","com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.HostPools.update","com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient":"Microsoft.DesktopVirtualization.InitiateSessionHostUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient.post":"Microsoft.DesktopVirtualization.InitiateSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient.postAsync":"Microsoft.DesktopVirtualization.InitiateSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient.postWithResponse":"Microsoft.DesktopVirtualization.InitiateSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.InitiateSessionHostUpdatesClient.postWithResponseAsync":"Microsoft.DesktopVirtualization.InitiateSessionHostUpdate.post","com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient":"Microsoft.DesktopVirtualization.MSIXImages","com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient.expand":"Microsoft.DesktopVirtualization.MSIXImages.expand","com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient.expandAsync":"Microsoft.DesktopVirtualization.MSIXImages.expand","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient":"Microsoft.DesktopVirtualization.MSIXPackages","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.createOrUpdate":"Microsoft.DesktopVirtualization.MSIXPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.MSIXPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.MSIXPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.MSIXPackages.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.delete":"Microsoft.DesktopVirtualization.MSIXPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.deleteAsync":"Microsoft.DesktopVirtualization.MSIXPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.deleteWithResponse":"Microsoft.DesktopVirtualization.MSIXPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.MSIXPackages.delete","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.get":"Microsoft.DesktopVirtualization.MSIXPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.getAsync":"Microsoft.DesktopVirtualization.MSIXPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.getWithResponse":"Microsoft.DesktopVirtualization.MSIXPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.MSIXPackages.get","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.list":"Microsoft.DesktopVirtualization.MSIXPackages.list","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.listAsync":"Microsoft.DesktopVirtualization.MSIXPackages.list","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.update":"Microsoft.DesktopVirtualization.MSIXPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.updateAsync":"Microsoft.DesktopVirtualization.MSIXPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.updateWithResponse":"Microsoft.DesktopVirtualization.MSIXPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.MSIXPackages.update","com.azure.resourcemanager.desktopvirtualization.fluent.OperationsClient":"Microsoft.DesktopVirtualization.Operations","com.azure.resourcemanager.desktopvirtualization.fluent.OperationsClient.list":"Microsoft.DesktopVirtualization.Operations.list","com.azure.resourcemanager.desktopvirtualization.fluent.OperationsClient.listAsync":"Microsoft.DesktopVirtualization.Operations.list","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByHostPool":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByHostPoolAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByHostPoolWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByHostPoolWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByWorkspace":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByWorkspaceAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByWorkspaceWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.deleteByWorkspaceWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.deleteByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByHostPool":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByHostPoolAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByHostPoolWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByHostPoolWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByWorkspace":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByWorkspaceAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByWorkspaceWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.getByWorkspaceWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.getByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.listByHostPool":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.listByWorkspace":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.listByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.listByWorkspaceAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.listByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByHostPool":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByHostPoolAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByHostPoolWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByHostPoolWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByWorkspace":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByWorkspaceAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByWorkspaceWithResponse":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient.updateByWorkspaceWithResponseAsync":"Microsoft.DesktopVirtualization.CustomPrivateEndpointConnection.updateByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient":"Microsoft.DesktopVirtualization.PrivateLinkResources","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient.listByHostPool":"Microsoft.DesktopVirtualization.PrivateLinkResources.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.PrivateLinkResources.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient.listByWorkspace":"Microsoft.DesktopVirtualization.PrivateLinkResources.listByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient.listByWorkspaceAsync":"Microsoft.DesktopVirtualization.PrivateLinkResources.listByWorkspace","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.create":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.createAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.createWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.createWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.delete":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.deleteAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.deleteWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.get":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.getAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.getWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.list":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.list","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.listAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.list","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.update":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.updateAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.updateWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.create":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.createAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.createWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.createWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.delete":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.deleteAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.deleteWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.get":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.getAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.getWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.list":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.list","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.listAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.list","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.update":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.updateAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.updateWithResponse":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPooledSchedulesClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedules.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient":"Microsoft.DesktopVirtualization.ScalingPlans","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.create":"Microsoft.DesktopVirtualization.ScalingPlans.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.createAsync":"Microsoft.DesktopVirtualization.ScalingPlans.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.createWithResponse":"Microsoft.DesktopVirtualization.ScalingPlans.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.createWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlans.create","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.delete":"Microsoft.DesktopVirtualization.ScalingPlans.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.deleteAsync":"Microsoft.DesktopVirtualization.ScalingPlans.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.deleteWithResponse":"Microsoft.DesktopVirtualization.ScalingPlans.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlans.delete","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.getByResourceGroup":"Microsoft.DesktopVirtualization.ScalingPlans.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.getByResourceGroupAsync":"Microsoft.DesktopVirtualization.ScalingPlans.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.getByResourceGroupWithResponse":"Microsoft.DesktopVirtualization.ScalingPlans.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.getByResourceGroupWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlans.get","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.list":"Microsoft.DesktopVirtualization.ScalingPlans.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.listAsync":"Microsoft.DesktopVirtualization.ScalingPlans.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.listByHostPool":"Microsoft.DesktopVirtualization.ScalingPlans.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.ScalingPlans.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.listByResourceGroup":"Microsoft.DesktopVirtualization.ScalingPlans.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.listByResourceGroupAsync":"Microsoft.DesktopVirtualization.ScalingPlans.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.update":"Microsoft.DesktopVirtualization.ScalingPlans.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.updateAsync":"Microsoft.DesktopVirtualization.ScalingPlans.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.updateWithResponse":"Microsoft.DesktopVirtualization.ScalingPlans.update","com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlansClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.ScalingPlans.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient":"Microsoft.DesktopVirtualization.SessionHostConfigurations","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.beginCreateOrUpdate":"Microsoft.DesktopVirtualization.SessionHostConfigurations.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.beginCreateOrUpdateAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.beginUpdate":"Microsoft.DesktopVirtualization.SessionHostConfigurations.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.beginUpdateAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.createOrUpdate":"Microsoft.DesktopVirtualization.SessionHostConfigurations.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.get":"Microsoft.DesktopVirtualization.SessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.getAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.getWithResponse":"Microsoft.DesktopVirtualization.SessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.listByHostPool":"Microsoft.DesktopVirtualization.SessionHostConfigurations.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.update":"Microsoft.DesktopVirtualization.SessionHostConfigurations.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.updateAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostConfigurationsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostConfigurations.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatuses","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient.get":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient.getAsync":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient.getWithResponse":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementProvisioningStatusesClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatuses","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient.get":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient.getAsync":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient.getWithResponse":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementUpdateStatusesClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatuses.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient":"Microsoft.DesktopVirtualization.SessionHostManagements","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.createOrUpdate":"Microsoft.DesktopVirtualization.SessionHostManagements.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.SessionHostManagements.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.get":"Microsoft.DesktopVirtualization.SessionHostManagements.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.getAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.getWithResponse":"Microsoft.DesktopVirtualization.SessionHostManagements.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.listByHostPool":"Microsoft.DesktopVirtualization.SessionHostManagements.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.update":"Microsoft.DesktopVirtualization.SessionHostManagements.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.updateAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.updateWithResponse":"Microsoft.DesktopVirtualization.SessionHostManagements.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostManagementsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHostManagements.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient":"Microsoft.DesktopVirtualization.SessionHosts","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.create":"Microsoft.DesktopVirtualization.SessionHosts.create","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.createAsync":"Microsoft.DesktopVirtualization.SessionHosts.create","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.createWithResponse":"Microsoft.DesktopVirtualization.SessionHosts.create","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.createWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHosts.create","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.delete":"Microsoft.DesktopVirtualization.SessionHosts.delete","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.deleteAsync":"Microsoft.DesktopVirtualization.SessionHosts.delete","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.deleteWithResponse":"Microsoft.DesktopVirtualization.SessionHosts.delete","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHosts.delete","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.get":"Microsoft.DesktopVirtualization.SessionHosts.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.getAsync":"Microsoft.DesktopVirtualization.SessionHosts.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.getWithResponse":"Microsoft.DesktopVirtualization.SessionHosts.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHosts.get","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.list":"Microsoft.DesktopVirtualization.SessionHosts.list","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.listAsync":"Microsoft.DesktopVirtualization.SessionHosts.list","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.listSingleSessionHostRegistrationTokens":"Microsoft.DesktopVirtualization.SessionHosts.listSingleSessionHostRegistrationTokens","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.listSingleSessionHostRegistrationTokensAsync":"Microsoft.DesktopVirtualization.SessionHosts.listSingleSessionHostRegistrationTokens","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.retryProvisioning":"Microsoft.DesktopVirtualization.SessionHosts.retryProvisioning","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.retryProvisioningAsync":"Microsoft.DesktopVirtualization.SessionHosts.retryProvisioning","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.retryProvisioningWithResponse":"Microsoft.DesktopVirtualization.SessionHosts.retryProvisioning","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.retryProvisioningWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHosts.retryProvisioning","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.update":"Microsoft.DesktopVirtualization.SessionHosts.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.updateAsync":"Microsoft.DesktopVirtualization.SessionHosts.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.updateWithResponse":"Microsoft.DesktopVirtualization.SessionHosts.update","com.azure.resourcemanager.desktopvirtualization.fluent.SessionHostsClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.SessionHosts.update","com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient":"Microsoft.DesktopVirtualization.StartMenuItems","com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient.list":"Microsoft.DesktopVirtualization.StartMenuItems.list","com.azure.resourcemanager.desktopvirtualization.fluent.StartMenuItemsClient.listAsync":"Microsoft.DesktopVirtualization.StartMenuItems.list","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient":"Microsoft.DesktopVirtualization.UserSessions","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.delete":"Microsoft.DesktopVirtualization.UserSessions.delete","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.deleteAsync":"Microsoft.DesktopVirtualization.UserSessions.delete","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.deleteWithResponse":"Microsoft.DesktopVirtualization.UserSessions.delete","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.UserSessions.delete","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.disconnect":"Microsoft.DesktopVirtualization.UserSessions.disconnect","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.disconnectAsync":"Microsoft.DesktopVirtualization.UserSessions.disconnect","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.disconnectWithResponse":"Microsoft.DesktopVirtualization.UserSessions.disconnect","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.disconnectWithResponseAsync":"Microsoft.DesktopVirtualization.UserSessions.disconnect","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.get":"Microsoft.DesktopVirtualization.UserSessions.get","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.getAsync":"Microsoft.DesktopVirtualization.UserSessions.get","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.getWithResponse":"Microsoft.DesktopVirtualization.UserSessions.get","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.getWithResponseAsync":"Microsoft.DesktopVirtualization.UserSessions.get","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.list":"Microsoft.DesktopVirtualization.UserSessions.list","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.listAsync":"Microsoft.DesktopVirtualization.UserSessions.list","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.listByHostPool":"Microsoft.DesktopVirtualization.UserSessions.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.listByHostPoolAsync":"Microsoft.DesktopVirtualization.UserSessions.listByHostPool","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.sendMessage":"Microsoft.DesktopVirtualization.UserSessions.sendMessage","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.sendMessageAsync":"Microsoft.DesktopVirtualization.UserSessions.sendMessage","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.sendMessageWithResponse":"Microsoft.DesktopVirtualization.UserSessions.sendMessage","com.azure.resourcemanager.desktopvirtualization.fluent.UserSessionsClient.sendMessageWithResponseAsync":"Microsoft.DesktopVirtualization.UserSessions.sendMessage","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient":"Microsoft.DesktopVirtualization.Workspaces","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.createOrUpdate":"Microsoft.DesktopVirtualization.Workspaces.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.createOrUpdateAsync":"Microsoft.DesktopVirtualization.Workspaces.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.createOrUpdateWithResponse":"Microsoft.DesktopVirtualization.Workspaces.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.createOrUpdateWithResponseAsync":"Microsoft.DesktopVirtualization.Workspaces.createOrUpdate","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.delete":"Microsoft.DesktopVirtualization.Workspaces.delete","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.deleteAsync":"Microsoft.DesktopVirtualization.Workspaces.delete","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.deleteWithResponse":"Microsoft.DesktopVirtualization.Workspaces.delete","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.deleteWithResponseAsync":"Microsoft.DesktopVirtualization.Workspaces.delete","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.getByResourceGroup":"Microsoft.DesktopVirtualization.Workspaces.get","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.getByResourceGroupAsync":"Microsoft.DesktopVirtualization.Workspaces.get","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.getByResourceGroupWithResponse":"Microsoft.DesktopVirtualization.Workspaces.get","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.getByResourceGroupWithResponseAsync":"Microsoft.DesktopVirtualization.Workspaces.get","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.list":"Microsoft.DesktopVirtualization.Workspaces.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.listAsync":"Microsoft.DesktopVirtualization.Workspaces.listBySubscription","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.listByResourceGroup":"Microsoft.DesktopVirtualization.Workspaces.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.listByResourceGroupAsync":"Microsoft.DesktopVirtualization.Workspaces.listByResourceGroup","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.update":"Microsoft.DesktopVirtualization.Workspaces.update","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.updateAsync":"Microsoft.DesktopVirtualization.Workspaces.update","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.updateWithResponse":"Microsoft.DesktopVirtualization.Workspaces.update","com.azure.resourcemanager.desktopvirtualization.fluent.WorkspacesClient.updateWithResponseAsync":"Microsoft.DesktopVirtualization.Workspaces.update","com.azure.resourcemanager.desktopvirtualization.fluent.models.ActiveSessionHostConfigurationInner":"Microsoft.DesktopVirtualization.ActiveSessionHostConfiguration","com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner":"Microsoft.DesktopVirtualization.AppAttachPackage","com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner":"Microsoft.DesktopVirtualization.ApplicationGroup","com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner":"Microsoft.DesktopVirtualization.Application","com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner":"Microsoft.DesktopVirtualization.Desktop","com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner":"Microsoft.DesktopVirtualization.ExpandMsixImage","com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner":"Microsoft.DesktopVirtualization.HostPool","com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner":"Microsoft.DesktopVirtualization.HostPoolProperties","com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner":"Microsoft.DesktopVirtualization.MSIXPackage","com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner":"Microsoft.DesktopVirtualization.PrivateEndpointConnectionWithSystemData","com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner":"Microsoft.DesktopVirtualization.PrivateLinkResource","com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner":"Microsoft.DesktopVirtualization.RegistrationInfo","com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner":"Microsoft.DesktopVirtualization.RegistrationTokenList","com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenMinimalInner":"Microsoft.DesktopVirtualization.RegistrationTokenMinimal","com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner":"Microsoft.DesktopVirtualization.ResourceProviderOperation","com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner":"Microsoft.DesktopVirtualization.ScalingPlan","com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedule","com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedule","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostConfigurationInner":"Microsoft.DesktopVirtualization.SessionHostConfiguration","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner":"Microsoft.DesktopVirtualization.SessionHost","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner":"Microsoft.DesktopVirtualization.SessionHostManagement","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusInner":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatus","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusPropertiesInner":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningStatusProperties","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusInner":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatus","com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner":"Microsoft.DesktopVirtualization.SessionHostManagementUpdateStatusProperties","com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner":"Microsoft.DesktopVirtualization.StartMenuItem","com.azure.resourcemanager.desktopvirtualization.fluent.models.UserSessionInner":"Microsoft.DesktopVirtualization.UserSession","com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner":"Microsoft.DesktopVirtualization.Workspace","com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationManagementClientBuilder":"Microsoft.DesktopVirtualization","com.azure.resourcemanager.desktopvirtualization.implementation.models.ActiveSessionHostConfigurationList":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurationList","com.azure.resourcemanager.desktopvirtualization.implementation.models.AppAttachPackageList":"Microsoft.DesktopVirtualization.AppAttachPackageList","com.azure.resourcemanager.desktopvirtualization.implementation.models.ApplicationGroupList":"Microsoft.DesktopVirtualization.ApplicationGroupList","com.azure.resourcemanager.desktopvirtualization.implementation.models.ApplicationList":"Microsoft.DesktopVirtualization.ApplicationList","com.azure.resourcemanager.desktopvirtualization.implementation.models.DesktopList":"Microsoft.DesktopVirtualization.DesktopList","com.azure.resourcemanager.desktopvirtualization.implementation.models.ExpandMsixImageList":"Microsoft.DesktopVirtualization.ExpandMsixImageList","com.azure.resourcemanager.desktopvirtualization.implementation.models.HostPoolList":"Microsoft.DesktopVirtualization.HostPoolList","com.azure.resourcemanager.desktopvirtualization.implementation.models.MSIXPackageList":"Microsoft.DesktopVirtualization.MSIXPackageList","com.azure.resourcemanager.desktopvirtualization.implementation.models.PrivateEndpointConnectionListResultWithSystemData":"Microsoft.DesktopVirtualization.PrivateEndpointConnectionListResultWithSystemData","com.azure.resourcemanager.desktopvirtualization.implementation.models.PrivateLinkResourceListResult":"Microsoft.DesktopVirtualization.PrivateLinkResourceListResult","com.azure.resourcemanager.desktopvirtualization.implementation.models.ResourceProviderOperationListResult":"Microsoft.DesktopVirtualization.ResourceProviderOperationListResult","com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanList":"Microsoft.DesktopVirtualization.ScalingPlanList","com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanPersonalScheduleList":"Microsoft.DesktopVirtualization.ScalingPlanPersonalScheduleList","com.azure.resourcemanager.desktopvirtualization.implementation.models.ScalingPlanPooledScheduleList":"Microsoft.DesktopVirtualization.ScalingPlanPooledScheduleList","com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostConfigurationList":"Microsoft.DesktopVirtualization.SessionHostConfigurationList","com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostList":"Microsoft.DesktopVirtualization.SessionHostList","com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostManagementList":"Microsoft.DesktopVirtualization.SessionHostManagementList","com.azure.resourcemanager.desktopvirtualization.implementation.models.StartMenuItemList":"Microsoft.DesktopVirtualization.StartMenuItemList","com.azure.resourcemanager.desktopvirtualization.implementation.models.UserSessionList":"Microsoft.DesktopVirtualization.UserSessionList","com.azure.resourcemanager.desktopvirtualization.implementation.models.WorkspaceList":"Microsoft.DesktopVirtualization.WorkspaceList","com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoPatchProperties":"Microsoft.DesktopVirtualization.ActiveDirectoryInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ActiveDirectoryInfoProperties":"Microsoft.DesktopVirtualization.ActiveDirectoryInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.ActiveSessionHostConfigurationProperties":"Microsoft.DesktopVirtualization.ActiveSessionHostConfigurationProperties","com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties":"Microsoft.DesktopVirtualization.AgentUpdatePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties":"Microsoft.DesktopVirtualization.AgentUpdateProperties","com.azure.resourcemanager.desktopvirtualization.models.AllowRDPShortPathWithPrivateLink":"Microsoft.DesktopVirtualization.AllowRDPShortPathWithPrivateLink","com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures":"Microsoft.DesktopVirtualization.AppAttachPackageArchitectures","com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties":"Microsoft.DesktopVirtualization.AppAttachPackageInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch":"Microsoft.DesktopVirtualization.AppAttachPackagePatch","com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties":"Microsoft.DesktopVirtualization.AppAttachPackagePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties":"Microsoft.DesktopVirtualization.AppAttachPackageProperties","com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch":"Microsoft.DesktopVirtualization.ApplicationGroupPatch","com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatchProperties":"Microsoft.DesktopVirtualization.ApplicationGroupPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupProperties":"Microsoft.DesktopVirtualization.ApplicationGroupProperties","com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType":"Microsoft.DesktopVirtualization.ApplicationGroupType","com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch":"Microsoft.DesktopVirtualization.ApplicationPatch","com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatchProperties":"Microsoft.DesktopVirtualization.ApplicationPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ApplicationProperties":"Microsoft.DesktopVirtualization.ApplicationProperties","com.azure.resourcemanager.desktopvirtualization.models.ApplicationType":"Microsoft.DesktopVirtualization.ApplicationType","com.azure.resourcemanager.desktopvirtualization.models.AzureActiveDirectoryInfoProperties":"Microsoft.DesktopVirtualization.AzureActiveDirectoryInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties":"Microsoft.DesktopVirtualization.BootDiagnosticsInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties":"Microsoft.DesktopVirtualization.BootDiagnosticsInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy":"Microsoft.DesktopVirtualization.CanaryPolicy","com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting":"Microsoft.DesktopVirtualization.CommandLineSetting","com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties":"Microsoft.DesktopVirtualization.CreateDeleteProperties","com.azure.resourcemanager.desktopvirtualization.models.CustomInfoPatchProperties":"Microsoft.DesktopVirtualization.CustomInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.CustomInfoProperties":"Microsoft.DesktopVirtualization.CustomInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek":"Microsoft.DesktopVirtualization.DayOfWeek","com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope":"Microsoft.DesktopVirtualization.DeploymentScope","com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch":"Microsoft.DesktopVirtualization.DesktopPatch","com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties":"Microsoft.DesktopVirtualization.DesktopPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.DesktopProperties":"Microsoft.DesktopVirtualization.DesktopProperties","com.azure.resourcemanager.desktopvirtualization.models.DiffDiskOption":"Microsoft.DesktopVirtualization.DiffDiskOption","com.azure.resourcemanager.desktopvirtualization.models.DiffDiskPlacement":"Microsoft.DesktopVirtualization.DiffDiskPlacement","com.azure.resourcemanager.desktopvirtualization.models.DiffDiskProperties":"Microsoft.DesktopVirtualization.DiffDiskProperties","com.azure.resourcemanager.desktopvirtualization.models.DirectUDP":"Microsoft.DesktopVirtualization.DirectUDP","com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties":"Microsoft.DesktopVirtualization.DiskInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.DomainInfoPatchProperties":"Microsoft.DesktopVirtualization.DomainInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.DomainInfoProperties":"Microsoft.DesktopVirtualization.DomainInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.DomainJoinType":"Microsoft.DesktopVirtualization.DomainJoinType","com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageProperties":"Microsoft.DesktopVirtualization.ExpandMsixImageProperties","com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure":"Microsoft.DesktopVirtualization.failHealthCheckOnStagingFailure","com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC":"Microsoft.DesktopVirtualization.FailedSessionHostCleanupPolicySHC","com.azure.resourcemanager.desktopvirtualization.models.HealthCheckName":"Microsoft.DesktopVirtualization.HealthCheckName","com.azure.resourcemanager.desktopvirtualization.models.HealthCheckResult":"Microsoft.DesktopVirtualization.HealthCheckResult","com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch":"Microsoft.DesktopVirtualization.HostPoolPatch","com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatchProperties":"Microsoft.DesktopVirtualization.HostPoolPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningAction":"Microsoft.DesktopVirtualization.HostPoolProvisioningAction","com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter":"Microsoft.DesktopVirtualization.HostPoolProvisioningControlParameter","com.azure.resourcemanager.desktopvirtualization.models.HostPoolType":"Microsoft.DesktopVirtualization.HostPoolType","com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateAction":"Microsoft.DesktopVirtualization.HostPoolUpdateAction","com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties":"Microsoft.DesktopVirtualization.HostPoolUpdateConfigurationPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties":"Microsoft.DesktopVirtualization.HostPoolUpdateConfigurationProperties","com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter":"Microsoft.DesktopVirtualization.HostPoolUpdateControlParameter","com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess":"Microsoft.DesktopVirtualization.HostpoolPublicNetworkAccess","com.azure.resourcemanager.desktopvirtualization.models.ImageInfoPatchProperties":"Microsoft.DesktopVirtualization.ImageInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties":"Microsoft.DesktopVirtualization.ImageInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest":"Microsoft.DesktopVirtualization.ImportPackageInfoRequest","com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsPatchProperties":"Microsoft.DesktopVirtualization.KeyVaultCredentialsPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.KeyVaultCredentialsProperties":"Microsoft.DesktopVirtualization.KeyVaultCredentialsProperties","com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType":"Microsoft.DesktopVirtualization.LoadBalancerType","com.azure.resourcemanager.desktopvirtualization.models.LogSpecification":"Microsoft.DesktopVirtualization.LogSpecification","com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties":"Microsoft.DesktopVirtualization.MaintenanceWindowPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowProperties":"Microsoft.DesktopVirtualization.MaintenanceWindowProperties","com.azure.resourcemanager.desktopvirtualization.models.ManagedDiskProperties":"Microsoft.DesktopVirtualization.ManagedDiskProperties","com.azure.resourcemanager.desktopvirtualization.models.ManagedPrivateUDP":"Microsoft.DesktopVirtualization.ManagedPrivateUDP","com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.desktopvirtualization.models.ManagementType":"Microsoft.DesktopVirtualization.ManagementType","com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoPatchProperties":"Microsoft.DesktopVirtualization.MarketplaceInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoProperties":"Microsoft.DesktopVirtualization.MarketplaceInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri":"Microsoft.DesktopVirtualization.MSIXImageURI","com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications":"Microsoft.DesktopVirtualization.MsixPackageApplications","com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies":"Microsoft.DesktopVirtualization.MsixPackageDependencies","com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch":"Microsoft.DesktopVirtualization.MSIXPackagePatch","com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties":"Microsoft.DesktopVirtualization.MSIXPackagePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties":"Microsoft.DesktopVirtualization.MSIXPackageProperties","com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoPatchProperties":"Microsoft.DesktopVirtualization.NetworkInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties":"Microsoft.DesktopVirtualization.NetworkInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.OperationProperties":"Microsoft.DesktopVirtualization.OperationProperties","com.azure.resourcemanager.desktopvirtualization.models.PackageTimestamped":"Microsoft.DesktopVirtualization.packageTimestamped","com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType":"Microsoft.DesktopVirtualization.PersonalDesktopAssignmentType","com.azure.resourcemanager.desktopvirtualization.models.Plan":"Azure.ResourceManager.CommonTypes.Plan","com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType":"Microsoft.DesktopVirtualization.PreferredAppGroupType","com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint":"Microsoft.DesktopVirtualization.PrivateEndpoint","com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection":"Microsoft.DesktopVirtualization.PrivateEndpointConnection","com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProperties":"Microsoft.DesktopVirtualization.PrivateEndpointConnectionProperties","com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState":"Microsoft.DesktopVirtualization.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus":"Microsoft.DesktopVirtualization.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceProperties":"Microsoft.DesktopVirtualization.PrivateLinkResourceProperties","com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState":"Microsoft.DesktopVirtualization.PrivateLinkServiceConnectionState","com.azure.resourcemanager.desktopvirtualization.models.ProvisioningState":"Microsoft.DesktopVirtualization.ProvisioningState","com.azure.resourcemanager.desktopvirtualization.models.ProvisioningStateSHC":"Microsoft.DesktopVirtualization.ProvisioningStateSHC","com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess":"Microsoft.DesktopVirtualization.PublicNetworkAccess","com.azure.resourcemanager.desktopvirtualization.models.PublicUDP":"Microsoft.DesktopVirtualization.PublicUDP","com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch":"Microsoft.DesktopVirtualization.RegistrationInfoPatch","com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation":"Microsoft.DesktopVirtualization.RegistrationTokenOperation","com.azure.resourcemanager.desktopvirtualization.models.RelayUDP":"Microsoft.DesktopVirtualization.RelayUDP","com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType":"Microsoft.DesktopVirtualization.RemoteApplicationType","com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay":"Microsoft.DesktopVirtualization.ResourceProviderOperationDisplay","com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference":"Microsoft.DesktopVirtualization.ScalingHostPoolReference","com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType":"Microsoft.DesktopVirtualization.ScalingHostPoolType","com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType":"Microsoft.DesktopVirtualization.ScalingMethodType","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch":"Microsoft.DesktopVirtualization.ScalingPlanPatch","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatchProperties":"Microsoft.DesktopVirtualization.ScalingPlanPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedulePatch","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatchProperties":"Microsoft.DesktopVirtualization.ScalingPlanPersonalSchedulePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleProperties":"Microsoft.DesktopVirtualization.ScalingPlanPersonalScheduleProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedulePatch","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatchProperties":"Microsoft.DesktopVirtualization.ScalingPlanPooledSchedulePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties":"Microsoft.DesktopVirtualization.ScalingPlanPooledScheduleProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanProperties":"Microsoft.DesktopVirtualization.ScalingPlanProperties","com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule":"Microsoft.DesktopVirtualization.ScalingSchedule","com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties":"Microsoft.DesktopVirtualization.ScopedRegistrationTokenProperties","com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoPatchProperties":"Microsoft.DesktopVirtualization.SecurityInfoPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties":"Microsoft.DesktopVirtualization.SecurityInfoProperties","com.azure.resourcemanager.desktopvirtualization.models.SendMessage":"Microsoft.DesktopVirtualization.SendMessage","com.azure.resourcemanager.desktopvirtualization.models.ServiceSpecification":"Microsoft.DesktopVirtualization.ServiceSpecification","com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation":"Microsoft.DesktopVirtualization.SessionHandlingOperation","com.azure.resourcemanager.desktopvirtualization.models.SessionHostComponentUpdateType":"Microsoft.DesktopVirtualization.SessionHostComponentUpdateType","com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatch":"Microsoft.DesktopVirtualization.SessionHostConfigurationPatch","com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationPatchProperties":"Microsoft.DesktopVirtualization.SessionHostConfigurationPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostConfigurationProperties":"Microsoft.DesktopVirtualization.SessionHostConfigurationProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckFailureDetails":"Microsoft.DesktopVirtualization.SessionHostHealthCheckFailureDetails","com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport":"Microsoft.DesktopVirtualization.SessionHostHealthCheckReport","com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm":"Microsoft.DesktopVirtualization.SessionHostLoadBalancingAlgorithm","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress":"Microsoft.DesktopVirtualization.SessionHostManagementOperationProgress","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch":"Microsoft.DesktopVirtualization.SessionHostManagementPatch","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties":"Microsoft.DesktopVirtualization.SessionHostManagementPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties":"Microsoft.DesktopVirtualization.SessionHostManagementProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationProgress":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningOperationProgress","com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationStatus":"Microsoft.DesktopVirtualization.SessionHostManagementProvisioningOperationStatus","com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch":"Microsoft.DesktopVirtualization.SessionHostPatch","com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties":"Microsoft.DesktopVirtualization.SessionHostPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostProperties":"Microsoft.DesktopVirtualization.SessionHostProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationPatchProperties":"Microsoft.DesktopVirtualization.SessionHostProvisioningConfigurationPatchProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationProperties":"Microsoft.DesktopVirtualization.SessionHostProvisioningConfigurationProperties","com.azure.resourcemanager.desktopvirtualization.models.SessionState":"Microsoft.DesktopVirtualization.SessionState","com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect":"Microsoft.DesktopVirtualization.SetStartVMOnConnect","com.azure.resourcemanager.desktopvirtualization.models.Sku":"Azure.ResourceManager.CommonTypes.Sku","com.azure.resourcemanager.desktopvirtualization.models.SkuTier":"Azure.ResourceManager.CommonTypes.SkuTier","com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType":"Microsoft.DesktopVirtualization.SSOSecretType","com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemProperties":"Microsoft.DesktopVirtualization.StartMenuItemProperties","com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior":"Microsoft.DesktopVirtualization.StartupBehavior","com.azure.resourcemanager.desktopvirtualization.models.Status":"Microsoft.DesktopVirtualization.Status","com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen":"Microsoft.DesktopVirtualization.StopHostsWhen","com.azure.resourcemanager.desktopvirtualization.models.Time":"Microsoft.DesktopVirtualization.Time","com.azure.resourcemanager.desktopvirtualization.models.Type":"Microsoft.DesktopVirtualization.type","com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody":"Microsoft.DesktopVirtualization.UpdateSessionHostsRequestBody","com.azure.resourcemanager.desktopvirtualization.models.UpdateState":"Microsoft.DesktopVirtualization.UpdateState","com.azure.resourcemanager.desktopvirtualization.models.UpdateStatus":"Microsoft.DesktopVirtualization.updateStatus","com.azure.resourcemanager.desktopvirtualization.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.desktopvirtualization.models.UserSessionProperties":"Microsoft.DesktopVirtualization.UserSessionProperties","com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType":"Microsoft.DesktopVirtualization.VirtualMachineDiskType","com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType":"Microsoft.DesktopVirtualization.VirtualMachineSecurityType","com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch":"Microsoft.DesktopVirtualization.WorkspacePatch","com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties":"Microsoft.DesktopVirtualization.WorkspacePatchProperties","com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties":"Microsoft.DesktopVirtualization.WorkspaceProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ActiveSessionHostConfigurationsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostProvisioningsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ControlSessionHostUpdatesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationManagementClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/InitiateSessionHostUpdatesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostConfigurationsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementProvisioningStatusesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementUpdateStatusesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostManagementsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ActiveSessionHostConfigurationInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenMinimalInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostConfigurationInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementProvisioningStatusPropertiesInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostManagementUpdateStatusPropertiesInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ActiveSessionHostConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostProvisioningsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ControlSessionHostUpdatesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationManagementClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/InitiateSessionHostUpdatesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenMinimalImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusPropertiesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementProvisioningStatusesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusPropertiesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementUpdateStatusesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostManagementsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ActiveSessionHostConfigurationList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/AppAttachPackageList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationGroupList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ApplicationList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/DesktopList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ExpandMsixImageList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/HostPoolList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/MSIXPackageList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/PrivateEndpointConnectionListResultWithSystemData.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ResourceProviderOperationListResult.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPersonalScheduleList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/ScalingPlanPooledScheduleList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostConfigurationList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/SessionHostManagementList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/StartMenuItemList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/UserSessionList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/models/WorkspaceList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveDirectoryInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfiguration.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ActiveSessionHostConfigurations.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AllowRDPShortPathWithPrivateLink.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AzureActiveDirectoryInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/BootDiagnosticsInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CanaryPolicy.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostProvisionings.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ControlSessionHostUpdates.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CreateDeleteProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CustomInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DeploymentScope.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskOption.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskPlacement.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiffDiskProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DirectUDP.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DiskInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DomainJoinType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailedSessionHostCleanupPolicySHC.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningAction.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProvisioningControlParameter.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateAction.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateConfigurationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolUpdateControlParameter.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImageInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/InitiateSessionHostUpdates.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/KeyVaultCredentialsProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedDiskProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedPrivateUDP.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ManagementType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MarketplaceInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/NetworkInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningStateSHC.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicUDP.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RelayUDP.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingMethodType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScopedRegistrationTokenProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SecurityInfoProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfiguration.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostConfigurations.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostLoadBalancingAlgorithm.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagement.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementOperationProgress.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationProgress.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningOperationStatus.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatus.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatusProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementProvisioningStatuses.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatus.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatusProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagementUpdateStatuses.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostManagements.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationPatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostProvisioningConfigurationProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Type.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateSessionHostsRequestBody.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateState.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UpdateStatus.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSession.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessionProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineDiskType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/VirtualMachineSecurityType.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatchProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceProperties.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java","src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file 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..f1b2bf187ea9 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.ControlSessionHostProvisioningsClientImpl$ControlSessionHostProvisioningsService"],["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.SessionHostManagementProvisioningStatusesClientImpl$SessionHostManagementProvisioningStatusesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementUpdateStatusesClientImpl$SessionHostManagementUpdateStatusesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostManagementsClientImpl$SessionHostManagementsService"],["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..1b9aa74bf92b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for ActiveSessionHostConfigurations Get. + */ +public final class ActiveSessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..819d325c5c00 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ActiveSessionHostConfigurationsListByHostPoolSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for ActiveSessionHostConfigurations ListByHostPool. + */ +public final class ActiveSessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..66d4506d2f49 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.DeploymentScope; import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; @@ -17,9 +18,7 @@ */ public final class AppAttachPackageCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Create.json + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_CreateOrUpdate.json */ /** * Sample code: AppAttachPackage_Create. @@ -50,7 +49,7 @@ public final class AppAttachPackageCreateOrUpdateSamples { .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") .withDescription("PackageApplicationDescription") - .withAppUserModelId("AppUserModelId") + .withAppUserModelID("AppUserModelId") .withFriendlyName("FriendlyName") .withIconImageName("Iconimagename") .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) @@ -59,7 +58,8 @@ public final class AppAttachPackageCreateOrUpdateSamples { .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) .withHostPoolReferences(Arrays.asList()) .withKeyVaultUrl("fakeTokenPlaceholder") - .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE) + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL)) .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..29996899c036 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class AppAttachPackageDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Delete.json + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_Delete.json */ /** * Sample code: AppAttachPackage_Delete. @@ -21,6 +19,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..ff3b147940b6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class AppAttachPackageGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Get.json + * x-ms-original-file: 2026-01-01-preview/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..e8d9d8a759b1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,9 +12,7 @@ */ public final class AppAttachPackageInfoImportMethodSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackageInfo_Import_Post.json + * x-ms-original-file: 2026-01-01-preview/AppAttachPackageInfo_Import.json */ /** * Sample code: AppAttachPackageInfo_Import. @@ -24,7 +22,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..7982e3403d66 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class AppAttachPackageListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListByResourceGroup.json + * x-ms-original-file: 2026-01-01-preview/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..28c37dd26e02 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class AppAttachPackageListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_ListBySubscription.json + * x-ms-original-file: 2026-01-01-preview/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..b46407cf64e6 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 @@ -1,19 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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. */ public final class AppAttachPackageUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * AppAttachPackage_Update.json + * x-ms-original-file: 2026-01-01-preview/AppAttachPackage_Update.json */ /** * Sample code: AppAttachPackage_Update. @@ -25,6 +30,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..21b1dc0645e5 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupProperties; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; import java.util.HashMap; import java.util.Map; @@ -13,9 +14,7 @@ */ public final class ApplicationGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Create.json + * x-ms-original-file: 2026-01-01-preview/ApplicationGroups_CreateOrUpdate.json */ /** * Sample code: ApplicationGroup_Create. @@ -28,13 +27,14 @@ public final class ApplicationGroupsCreateOrUpdateSamples { .define("applicationGroup1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") - .withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) + .withProperties(new ApplicationGroupProperties().withDescription("des1") + .withFriendlyName("friendly") + .withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) + .withShowInFeed(true) + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") - .withShowInFeed(true) .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..bf634fc97f53 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class ApplicationGroupsDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..9aec513daaff 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationGroupsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Get.json + * x-ms-original-file: 2026-01-01-preview/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..412ae0e49522 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationGroupsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListByResourceGroup.json + * x-ms-original-file: 2026-01-01-preview/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..e6949390f1b0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationGroupsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_ListBySubscription.json + * x-ms-original-file: 2026-01-01-preview/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..1e6dc86f0c82 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -13,25 +14,23 @@ */ public final class ApplicationGroupsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ApplicationGroup_Update.json + * x-ms-original-file: 2026-01-01-preview/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..4dc612a4addd 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; /** @@ -11,28 +12,26 @@ */ public final class ApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Create.json + * x-ms-original-file: 2026-01-01-preview/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") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withDescription("des1") - .withFriendlyName("friendly") - .withFilePath("path") - .withCommandLineArguments("arguments") - .withShowInPortal(true) - .withIconPath("icon") - .withIconIndex(1) + .withProperties(new ApplicationProperties().withDescription("des1") + .withFriendlyName("friendly") + .withFilePath("path") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("arguments") + .withShowInPortal(true) + .withIconPath("icon") + .withIconIndex(1)) .create(); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java index e7e9d7fd56db..036013382d0a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class ApplicationsDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..d10c70c49ba8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class ApplicationsGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Get.json + * x-ms-original-file: 2026-01-01-preview/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..6587967ee489 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ApplicationsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_List.json + * x-ms-original-file: 2026-01-01-preview/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..338749528dd2 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -13,30 +14,28 @@ */ public final class ApplicationsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Application_Update.json + * x-ms-original-file: 2026-01-01-preview/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/ControlSessionHostProvisioningPostSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostProvisioningPostSamples.java new file mode 100644 index 000000000000..c375a77b1c72 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostProvisioningPostSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter; + +/** + * Samples for ControlSessionHostProvisioning Post. + */ +public final class ControlSessionHostProvisioningPostSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagements_ControlSessionHostProvisioning_Post.json + */ + /** + * Sample code: SessionHostManagements_ControlSessionHostProvisioning_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsControlSessionHostProvisioningPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.controlSessionHostProvisionings() + .post("resourceGroup1", "hostPool1", + new HostPoolProvisioningControlParameter().withAction(HostPoolProvisioningAction.CANCEL) + .withCancelMessage("Cancel host pool provisioning"), + com.azure.core.util.Context.NONE); + } +} 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..993c85084537 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ControlSessionHostUpdatePostSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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: 2026-01-01-preview/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..2ec1432a1221 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class DesktopsGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Get.json + * x-ms-original-file: 2026-01-01-preview/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..6ec7a4f47ef5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class DesktopsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_List.json + * x-ms-original-file: 2026-01-01-preview/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..14ee0ff3516b 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 @@ -1,30 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; +import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; /** * Samples for Desktops Update. */ public final class DesktopsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Desktop_Update.json + * x-ms-original-file: 2026-01-01-preview/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..b24269a210d0 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 @@ -1,18 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; +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.AllowRDPShortPathWithPrivateLink; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +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; @@ -25,44 +33,52 @@ */ public final class HostPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Create.json + * x-ms-original-file: 2026-01-01-preview/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") .withExistingResourceGroup("resourceGroup1") - .withHostPoolType(HostPoolType.POOLED) - .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) - .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + .withProperties( + new HostPoolPropertiesInner().withFriendlyName("friendly") + .withDescription("des1") + .withHostPoolType(HostPoolType.POOLED) + .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) + .withMaxSessionLimit(999999) + .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) + .withRegistrationInfo(new RegistrationInfoInner() + .withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) + .withVmTemplate("{json:json}") + .withSsoadfsAuthority("https://adfs") + .withSsoClientId("client") + .withSsoClientSecretKeyVaultPath("fakeTokenPlaceholder") + .withSsoSecretType(SsoSecretType.SHARED_KEY) + .withPreferredAppGroupType(PreferredAppGroupType.DESKTOP) + .withStartVMOnConnect(false) + .withAgentUpdate( + new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withManagedPrivateUDP(ManagedPrivateUDP.ENABLED) + .withDirectUDP(DirectUDP.ENABLED) + .withPublicUDP(PublicUDP.ENABLED) + .withRelayUDP(RelayUDP.ENABLED) + .withManagementType(ManagementType.AUTOMATED) + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL) + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995") + .withAllowRDPShortPathWithPrivateLink(AllowRDPShortPathWithPrivateLink.ENABLED)) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withFriendlyName("friendly") - .withDescription("des1") - .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) - .withMaxSessionLimit(999999) - .withRegistrationInfo( - new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) - .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) - .withVmTemplate("{json:json}") - .withSsoadfsAuthority("https://adfs") - .withSsoClientId("client") - .withSsoClientSecretKeyVaultPath("https://keyvault/secret") - .withSsoSecretType(SsoSecretType.SHARED_KEY) - .withStartVMOnConnect(false) - .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .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..8ed50cfbc70c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class HostPoolsDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..a762c81be6c8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class HostPoolsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Get.json + * x-ms-original-file: 2026-01-01-preview/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..c69bcf77cc8e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class HostPoolsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_ListByResourceGroup.json + * x-ms-original-file: 2026-01-01-preview/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..4c2577033101 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,18 +9,15 @@ */ public final class HostPoolsListRegistrationTokensSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_ListRegistrationToken_Post.json + * x-ms-original-file: 2026-01-01-preview/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); + manager.hostPools().listRegistrationTokens("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..9259782a3868 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class HostPoolsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_List.json + * x-ms-original-file: 2026-01-01-preview/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..0e91d6c1b4c9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class HostPoolsRetrieveRegistrationTokenSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPools_RetrieveRegistrationToken_Post.json + * x-ms-original-file: 2026-01-01-preview/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..b13bae701b6e 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 @@ -1,17 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AllowRDPShortPathWithPrivateLink; 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; @@ -24,43 +30,46 @@ */ public final class HostPoolsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * HostPool_Update.json + * x-ms-original-file: 2026-01-01-preview/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) + .withAllowRDPShortPathWithPrivateLink(AllowRDPShortPathWithPrivateLink.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..aaca612187e2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatePostSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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: 2026-01-01-preview/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..766f58731b6e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,19 +11,17 @@ */ public final class MsixImagesExpandSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixImage_Expand_Post.json + * x-ms-original-file: 2026-01-01-preview/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..48b360d7f8ed 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; import java.time.OffsetDateTime; import java.util.Arrays; @@ -14,40 +15,38 @@ */ public final class MsixPackagesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Create.json + * x-ms-original-file: 2026-01-01-preview/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") - .withImagePath("imagepath") - .withPackageName("MsixPackage_name") - .withPackageFamilyName("MsixPackage_FamilyName") - .withDisplayName("displayname") - .withPackageRelativePath("packagerelativepath") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") - .withPublisher("PublishedName") - .withMinVersion("version"))) - .withVersion("version") - .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") - .withDescription("application-desc") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("friendlyname") - .withIconImageName("Apptile") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withProperties(new MsixPackageProperties().withImagePath("imagepath") + .withPackageName("MsixPackage_name") + .withPackageFamilyName("MsixPackage_FamilyName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") + .withPublisher("PublishedName") + .withMinVersion("version"))) + .withVersion("version") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") + .withDescription("application-desc") + .withAppUserModelID("AppUserModelId") + .withFriendlyName("friendlyname") + .withIconImageName("Apptile") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes())))) .create(); } } 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..7a89642036b5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class MsixPackagesDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..9802adbb1830 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class MsixPackagesGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Get.json + * x-ms-original-file: 2026-01-01-preview/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..d05f0d05aa61 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class MsixPackagesListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_List.json + * x-ms-original-file: 2026-01-01-preview/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..4d5c2591e5a7 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 @@ -1,19 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; /** * Samples for MsixPackages Update. */ public final class MsixPackagesUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * MsixPackage_Update.json + * x-ms-original-file: 2026-01-01-preview/MSIXPackages_Update.json */ /** * Sample code: MSIXPackage_Update. @@ -25,6 +24,10 @@ public final class MsixPackagesUpdateSamples { 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..77fff4fc38da 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * OperationDescription_List.json + * x-ms-original-file: 2026-01-01-preview/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..4c27bc06e580 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..d13fc648f3f6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_DeleteByWorkspace.json + * x-ms-original-file: 2026-01-01-preview/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..c8f54433dd0c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsGetByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..f01dee385754 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_GetByWorkspace.json + * x-ms-original-file: 2026-01-01-preview/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..74a295eda7f1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsListByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..21c0b5e41f5c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class PrivateEndpointConnectionsListByWorkspaceSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_ListByWorkspace.json + * x-ms-original-file: 2026-01-01-preview/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..0382ccf1624f 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -13,24 +14,24 @@ */ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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 PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None"))), com.azure.core.util.Context.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..a27facbba819 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -13,24 +14,24 @@ */ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateEndpointConnection_UpdateByWorkspace.json + * x-ms-original-file: 2026-01-01-preview/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 PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None"))), com.azure.core.util.Context.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..8dab5ce3f320 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class PrivateLinkResourcesListByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..6c12477dc31e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class PrivateLinkResourcesListByWorkspaceSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * PrivateLinkResources_ListByWorkspace.json + * x-ms-original-file: 2026-01-01-preview/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..53985b0ada7c 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -16,9 +17,7 @@ */ public final class ScalingPlanPersonalSchedulesCreateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Create.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. @@ -30,33 +29,34 @@ public static void scalingPlanPersonalSchedulesCreate( manager.scalingPlanPersonalSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(10) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(10) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(10) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(10) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(10) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(10) - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(10) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(10) + .withProperties(new ScalingPlanPersonalScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(10) + .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnLogoff(10) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(10) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(10) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(10) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(10) + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(10) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(10)) .create(); } } 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..da3ac5651edb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPersonalSchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..d50d62867763 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPersonalSchedulesGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Get.json + * x-ms-original-file: 2026-01-01-preview/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..680e7d5599f2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPersonalSchedulesListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_List.json + * x-ms-original-file: 2026-01-01-preview/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..d55ca8eaae17 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -14,9 +15,7 @@ */ public final class ScalingPlanPersonalSchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPersonalSchedule_Update.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPersonalSchedules_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. @@ -30,22 +29,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..44c158252068 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 @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; @@ -14,9 +17,7 @@ */ public final class ScalingPlanPooledSchedulesCreateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Create.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. @@ -28,23 +29,61 @@ public static void scalingPlanPooledSchedulesCreate( manager.scalingPlanPooledSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, - DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withProperties(new ScalingPlanPooledScheduleProperties() + .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)) + .create(); + } + + /* + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_CreateUsingCreateDelete.json + */ + /** + * Sample code: ScalingPlanPooledSchedules_CreateUsingCreateDelete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void scalingPlanPooledSchedulesCreateUsingCreateDelete( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlanPooledSchedules() + .define("scalingPlanScheduleWeekdays1") + .withExistingScalingPlan("resourceGroup1", "scalingPlan1") + .withProperties(new ScalingPlanPooledScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(10) + .withRampUpMinimumHostPoolSize(5) + .withRampDownMaximumHostPoolSize(7) + .withRampDownMinimumHostPoolSize(2)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .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..74aacbbe8b88 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPooledSchedulesDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..27fa33f88305 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPooledSchedulesGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Get.json + * x-ms-original-file: 2026-01-01-preview/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..e2489c7e5f42 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlanPooledSchedulesListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_List.json + * x-ms-original-file: 2026-01-01-preview/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..5f5f14502923 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; 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; @@ -15,9 +16,7 @@ */ public final class ScalingPlanPooledSchedulesUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlanPooledSchedule_Update.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlanPooledSchedules_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. @@ -31,14 +30,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..ef8adf903143 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 @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.ScalingPlanProperties; 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; @@ -19,9 +20,7 @@ */ public final class ScalingPlansCreateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Create.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Create.json */ /** * Sample code: ScalingPlans_Create. @@ -34,34 +33,33 @@ public final class ScalingPlansCreateSamples { .define("scalingPlan1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") - .withTimeZone("Central Standard Time") + .withProperties(new ScalingPlanProperties().withDescription("Description of Scaling Plan") + .withFriendlyName("Scaling Plan 1") + .withTimeZone("Central Standard Time") + .withHostPoolType(ScalingHostPoolType.POOLED) + .withExclusionTag("value") + .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, + DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withScalingPlanEnabled(true)))) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("Description of Scaling Plan") - .withFriendlyName("Scaling Plan 1") - .withHostPoolType(ScalingHostPoolType.POOLED) - .withExclusionTag("value") - .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withScalingPlanEnabled(true))) .create(); } 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..c6a6432401d7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlansDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..2f29c33f0bf9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlansGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Get.json + * x-ms-original-file: 2026-01-01-preview/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..c127fd3e7b8b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class ScalingPlansListByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..80cf361199d0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlansListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListByResourceGroup.json + * x-ms-original-file: 2026-01-01-preview/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..f55392ba61c8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class ScalingPlansListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_ListBySubscription.json + * x-ms-original-file: 2026-01-01-preview/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..80cf96ff982b 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 @@ -1,19 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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. */ public final class ScalingPlansUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * ScalingPlan_Update.json + * x-ms-original-file: 2026-01-01-preview/ScalingPlans_Update.json */ /** * Sample code: ScalingPlans_Update. @@ -25,6 +32,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..8b9700fb47a1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ManagedDiskProperties; +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.SessionHostConfigurationProperties; +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: 2026-01-01-preview/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().withProperties(new SessionHostConfigurationProperties() + .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() + .withManagedDisk(new ManagedDiskProperties().withType(VirtualMachineDiskType.STANDARD_LRS))) + .withCustomConfigurationScriptUrl( + "https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo(new DomainInfoProperties().withJoinType(DomainJoinType.ACTIVE_DIRECTORY) + .withActiveDirectoryInfo(new ActiveDirectoryInfoProperties() + .withDomainCredentials(new KeyVaultCredentialsProperties() + .withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withOuPath("OU=testOU,DC=domain,DC=Domain,DC=com") + .withDomainName("wvdarmtest1.net")) + .withAzureActiveDirectoryInfo(new AzureActiveDirectoryInfoProperties() + .withMdmProviderGuid("bdefabc0-95b4-48b3-b645-8a753a63c4fa"))) + .withSecurityInfo(new SecurityInfoProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java new file mode 100644 index 000000000000..546df4cd6934 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostConfigurations Get. + */ +public final class SessionHostConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..16d86db566f1 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsListByHostPoolSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostConfigurations ListByHostPool. + */ +public final class SessionHostConfigurationsListByHostPoolSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..a2631f2f75d3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostConfigurationsUpdateSamples.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.DiffDiskOption; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskPlacement; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +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.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: 2026-01-01-preview/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 DiskInfoProperties() + .withDiffDiskSettings(new DiffDiskProperties().withOption(DiffDiskOption.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK))) + .withCustomConfigurationScriptUrl( + "https://storageaccountname.blob.core.windows.net/blobcontainer/file") + .withImageInfo(new ImageInfoPatchProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoPatchProperties().withOffer("Windows-10") + .withPublisher("MicrosoftWindowsDesktop") + .withSku("19h2-ent") + .withExactVersion("2019.0.20190115")) + .withCustomInfo(new CustomInfoPatchProperties().withResourceId( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"))) + .withDomainInfo( + new DomainInfoPatchProperties().withActiveDirectoryInfo(new ActiveDirectoryInfoPatchProperties() + .withDomainCredentials(new KeyVaultCredentialsPatchProperties() + .withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")))) + .withSecurityInfo( + new SecurityInfoPatchProperties().withType(VirtualMachineSecurityType.TRUSTED_LAUNCH) + .withSecureBootEnabled(true) + .withVTpmEnabled(true)) + .withVmAdminCredentials( + new KeyVaultCredentialsPatchProperties().withUsernameKeyVaultSecretUri("fakeTokenPlaceholder") + .withPasswordKeyVaultSecretUri("fakeTokenPlaceholder")) + .withBootDiagnosticsInfo(new BootDiagnosticsInfoPatchProperties().withEnabled(true) + .withStorageUri("https://myStorageAccountName.blob.core.windows.net"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusesGetSamples.java new file mode 100644 index 000000000000..af10e3cf6305 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagementProvisioningStatuses Get. + */ +public final class SessionHostManagementProvisioningStatusesGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagements_SessionHostProvisioningStatuses_Get.json + */ + /** + * Sample code: SessionHostManagements_SessionHostProvisioningStatuses_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsSessionHostProvisioningStatusesGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementProvisioningStatuses() + .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/SessionHostManagementUpdateStatusesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementUpdateStatusesGetSamples.java new file mode 100644 index 000000000000..229eee0592cb --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementUpdateStatusesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagementUpdateStatuses Get. + */ +public final class SessionHostManagementUpdateStatusesGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHostManagementsUpdateStatus_Get.json + */ + /** + * Sample code: SessionHostManagementsUpdateStatus_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostManagementsUpdateStatusGet( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHostManagementUpdateStatuses() + .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/SessionHostManagementsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..18592418b67e --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; + +/** + * Samples for SessionHostManagements CreateOrUpdate. + */ +public final class SessionHostManagementsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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().withProperties( + new SessionHostManagementProperties().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..d0e5692b5fd3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagements Get. + */ +public final class SessionHostManagementsGetSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..03400bbb982e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHostManagements ListByHostPool. + */ +public final class SessionHostManagementsListByHostPoolSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..54115321a4c0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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: 2026-01-01-preview/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/SessionHostsCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsCreateSamples.java new file mode 100644 index 000000000000..29c314ec9ee3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHosts Create. + */ +public final class SessionHostsCreateSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Create.json + */ + /** + * Sample code: SessionHost_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + sessionHostCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .define("sessionHost1.microsoft.com") + .withExistingHostPool("resourceGroup1", "hostPool1") + .create(); + } +} 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..fc266846c5fc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class SessionHostsDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..fa272d6ec75f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class SessionHostsGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Get.json + * x-ms-original-file: 2026-01-01-preview/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..f0382d06dd68 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class SessionHostsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_List.json + * x-ms-original-file: 2026-01-01-preview/SessionHosts_List.json */ /** * Sample code: SessionHost_List. @@ -20,6 +18,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/SessionHostsListSingleSessionHostRegistrationTokensSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSingleSessionHostRegistrationTokensSamples.java new file mode 100644 index 000000000000..d3def18516c8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSingleSessionHostRegistrationTokensSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SessionHosts ListSingleSessionHostRegistrationTokens. + */ +public final class SessionHostsListSingleSessionHostRegistrationTokensSamples { + /* + * x-ms-original-file: 2026-01-01-preview/SessionHost_ListSingleSessionHostRegistrationTokens_Post.json + */ + /** + * Sample code: SessionHosts_ListSingleSessionHostRegistrationTokens_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void sessionHostsListSingleSessionHostRegistrationTokensPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .listSingleSessionHostRegistrationTokens( + "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", new ScopedRegistrationTokenProperties() + .withExpirationTimeInUtc(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")), + 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..b7154058af9e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for SessionHosts RetryProvisioning. + */ +public final class SessionHostsRetryProvisioningSamples { + /* + * x-ms-original-file: 2026-01-01-preview/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..30b375a50723 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 @@ -1,19 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; -import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHost; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; /** * Samples for SessionHosts Update. */ public final class SessionHostsUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * SessionHost_Update.json + * x-ms-original-file: 2026-01-01-preview/SessionHosts_Update.json */ /** * Sample code: SessionHost_Update. @@ -22,11 +21,15 @@ public final class SessionHostsUpdateSamples { */ public static void sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager.sessionHosts() - .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, - new SessionHostPatch().withAllowNewSession(true) - .withAssignedUser("user1@microsoft.com") - .withFriendlyName("friendly"), - com.azure.core.util.Context.NONE); + SessionHost resource = manager.sessionHosts() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SessionHostPatchProperties().withAllowNewSession(true) + .withAssignedUser("user1@microsoft.com") + .withFriendlyName("friendly")) + .withForce(true) + .apply(); } } 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..8bf757157c59 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class StartMenuItemsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * StartMenuItem_List.json + * x-ms-original-file: 2026-01-01-preview/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..db7b5f0073f6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class UserSessionsDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..14d506b54d90 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class UserSessionsDisconnectSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Disconnect_Post.json + * x-ms-original-file: 2026-01-01-preview/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..b2a6699f9cd7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,17 +9,15 @@ */ public final class UserSessionsGetSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_Get.json + * x-ms-original-file: 2026-01-01-preview/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..913b7b8bb319 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class UserSessionsListByHostPoolSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_ListByHostPool.json + * x-ms-original-file: 2026-01-01-preview/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..7af499dc0c6d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class UserSessionsListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_List.json + * x-ms-original-file: 2026-01-01-preview/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..e20786367c0b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,9 +11,7 @@ */ public final class UserSessionsSendMessageSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * UserSession_SendMessage_Post.json + * x-ms-original-file: 2026-01-01-preview/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..6ceb855bde57 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 @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; +import com.azure.resourcemanager.desktopvirtualization.models.DeploymentScope; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties; import java.util.HashMap; import java.util.Map; @@ -12,9 +14,7 @@ */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Create.json + * x-ms-original-file: 2026-01-01-preview/Workspaces_CreateOrUpdate.json */ /** * Sample code: Workspace_Create. @@ -28,8 +28,10 @@ public final class WorkspacesCreateOrUpdateSamples { .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDescription("des1") - .withFriendlyName("friendly") + .withProperties(new WorkspaceProperties().withDescription("des1") + .withFriendlyName("friendly") + .withOboTenantId("CD48BF6F-60D9-44CD-AB66-039D89C2E995") + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL)) .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..8b274c97430a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Delete.json + * x-ms-original-file: 2026-01-01-preview/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..a6d45857ae25 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Get.json + * x-ms-original-file: 2026-01-01-preview/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..ea7c284d77fe 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,9 +9,7 @@ */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListByResourceGroup.json + * x-ms-original-file: 2026-01-01-preview/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..b23a9472a80e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -9,16 +9,14 @@ */ public final class WorkspacesListSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_ListBySubscription.json + * x-ms-original-file: 2026-01-01-preview/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..36b7cbbc081c 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -13,9 +14,7 @@ */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: - * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ - * Workspace_Update.json + * x-ms-original-file: 2026-01-01-preview/Workspaces_Update.json */ /** * Sample code: Workspace_Update. @@ -29,8 +28,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 index fae970a1035e..3ba3ef037562 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -16,13 +16,13 @@ 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\"}]}") + "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":true,\"maintenanceWindowTimeZone\":\"aoqzpiyylhaln\",\"maintenanceWindows\":[{\"hour\":2121485033,\"dayOfWeek\":\"Monday\"}]}") .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()); + Assertions.assertTrue(model.useSessionHostLocalTime()); + Assertions.assertEquals("aoqzpiyylhaln", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(2121485033, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.MONDAY, model.maintenanceWindows().get(0).dayOfWeek()); } @org.junit.jupiter.api.Test @@ -30,17 +30,14 @@ public void testSerialize() throws Exception { AgentUpdatePatchProperties model = new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) .withUseSessionHostLocalTime(true) - .withMaintenanceWindowTimeZone("zi") + .withMaintenanceWindowTimeZone("aoqzpiyylhaln") .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))); + new MaintenanceWindowPatchProperties().withHour(2121485033).withDayOfWeek(DayOfWeek.MONDAY))); 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()); + Assertions.assertTrue(model.useSessionHostLocalTime()); + Assertions.assertEquals("aoqzpiyylhaln", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(2121485033, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.MONDAY, 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 index 69493a20dbfd..8af5fa917617 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -16,30 +16,29 @@ 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\"}]}") + "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":true,\"maintenanceWindowTimeZone\":\"qdpfuvglsbjjca\",\"maintenanceWindows\":[{\"hour\":1075232734,\"dayOfWeek\":\"Thursday\"},{\"hour\":596883756,\"dayOfWeek\":\"Friday\"}]}") .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()); + Assertions.assertTrue(model.useSessionHostLocalTime()); + Assertions.assertEquals("qdpfuvglsbjjca", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(1075232734, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.THURSDAY, 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") + .withUseSessionHostLocalTime(true) + .withMaintenanceWindowTimeZone("qdpfuvglsbjjca") .withMaintenanceWindows(Arrays.asList( - new MaintenanceWindowProperties().withHour(823307226).withDayOfWeek(DayOfWeek.WEDNESDAY), - new MaintenanceWindowProperties().withHour(1925543989).withDayOfWeek(DayOfWeek.THURSDAY), - new MaintenanceWindowProperties().withHour(1032415559).withDayOfWeek(DayOfWeek.MONDAY))); + new MaintenanceWindowProperties().withHour(1075232734).withDayOfWeek(DayOfWeek.THURSDAY), + new MaintenanceWindowProperties().withHour(596883756).withDayOfWeek(DayOfWeek.FRIDAY))); 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()); + Assertions.assertTrue(model.useSessionHostLocalTime()); + Assertions.assertEquals("qdpfuvglsbjjca", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(1075232734, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.THURSDAY, 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 index 31f3d875931f..d5fc9f960000 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -17,101 +17,88 @@ 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\"}") + "{\"packageAlias\":\"npvswjdkirso\",\"imagePath\":\"qxhcrmn\",\"packageName\":\"jtckwhdso\",\"packageFamilyName\":\"iy\",\"packageFullName\":\"jxsqwpgrjbz\",\"displayName\":\"rcjxvsnbyxqabn\",\"packageRelativePath\":\"cpc\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"bl\",\"publisher\":\"gpbtoqcjmklj\",\"minVersion\":\"bqidtqaj\"},{\"dependencyName\":\"ulpkudjkrl\",\"publisher\":\"bzhfepgzgqexz\",\"minVersion\":\"c\"},{\"dependencyName\":\"c\",\"publisher\":\"ierhhbcsglummaj\",\"minVersion\":\"aodxo\"},{\"dependencyName\":\"bdxkqpxokaj\",\"publisher\":\"npime\",\"minVersion\":\"stxgc\"}],\"version\":\"dg\",\"lastUpdated\":\"2021-02-14T15:50:10Z\",\"packageApplications\":[{\"appId\":\"vdjwzrlovm\",\"description\":\"whijcoejctbza\",\"appUserModelID\":\"qsycbkbfkgu\",\"friendlyName\":\"kexxppof\",\"iconImageName\":\"axcfjpgddtocjjx\"}],\"certificateName\":\"o\",\"certificateExpiry\":\"2021-11-28T20:33:32Z\",\"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("npvswjdkirso", model.packageAlias()); + Assertions.assertEquals("qxhcrmn", model.imagePath()); + Assertions.assertEquals("jtckwhdso", model.packageName()); + Assertions.assertEquals("iy", model.packageFamilyName()); + Assertions.assertEquals("jxsqwpgrjbz", model.packageFullName()); + Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); + Assertions.assertEquals("cpc", model.packageRelativePath()); + Assertions.assertTrue(model.isRegularRegistration()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("bl", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("gpbtoqcjmklj", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("bqidtqaj", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("dg", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T15:50:10Z"), model.lastUpdated()); + Assertions.assertEquals("vdjwzrlovm", model.packageApplications().get(0).appId()); + Assertions.assertEquals("whijcoejctbza", model.packageApplications().get(0).description()); + Assertions.assertEquals("qsycbkbfkgu", model.packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("kexxppof", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("axcfjpgddtocjjx", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("o", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T20:33:32Z"), 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") + AppAttachPackageInfoProperties model = new AppAttachPackageInfoProperties().withPackageAlias("npvswjdkirso") + .withImagePath("qxhcrmn") + .withPackageName("jtckwhdso") + .withPackageFamilyName("iy") + .withPackageFullName("jxsqwpgrjbz") + .withDisplayName("rcjxvsnbyxqabn") + .withPackageRelativePath("cpc") .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")) + new MsixPackageDependencies().withDependencyName("bl") + .withPublisher("gpbtoqcjmklj") + .withMinVersion("bqidtqaj"), + new MsixPackageDependencies().withDependencyName("ulpkudjkrl") + .withPublisher("bzhfepgzgqexz") + .withMinVersion("c"), + new MsixPackageDependencies().withDependencyName("c") + .withPublisher("ierhhbcsglummaj") + .withMinVersion("aodxo"), + new MsixPackageDependencies().withDependencyName("bdxkqpxokaj") + .withPublisher("npime") + .withMinVersion("stxgc"))) + .withVersion("dg") + .withLastUpdated(OffsetDateTime.parse("2021-02-14T15:50:10Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("vdjwzrlovm") + .withDescription("whijcoejctbza") + .withAppUserModelID("qsycbkbfkgu") + .withFriendlyName("kexxppof") + .withIconImageName("axcfjpgddtocjjx"))) + .withCertificateName("o") + .withCertificateExpiry(OffsetDateTime.parse("2021-11-28T20:33:32Z")) .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("npvswjdkirso", model.packageAlias()); + Assertions.assertEquals("qxhcrmn", model.imagePath()); + Assertions.assertEquals("jtckwhdso", model.packageName()); + Assertions.assertEquals("iy", model.packageFamilyName()); + Assertions.assertEquals("jxsqwpgrjbz", model.packageFullName()); + Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); + Assertions.assertEquals("cpc", model.packageRelativePath()); + Assertions.assertTrue(model.isRegularRegistration()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("bl", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("gpbtoqcjmklj", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("bqidtqaj", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("dg", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T15:50:10Z"), model.lastUpdated()); + Assertions.assertEquals("vdjwzrlovm", model.packageApplications().get(0).appId()); + Assertions.assertEquals("whijcoejctbza", model.packageApplications().get(0).description()); + Assertions.assertEquals("qsycbkbfkgu", model.packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("kexxppof", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("axcfjpgddtocjjx", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("o", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T20:33:32Z"), 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/AppAttachPackagesDeleteWithResponseMockTests.java similarity index 74% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteWithResponseMockTests.java index e1bcc47af3be..cc18b45424c5 100644 --- 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/AppAttachPackagesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -15,7 +15,7 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class AppAttachPackagesDeleteByResourceGroupWithResponseMockTests { +public final class AppAttachPackagesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { String responseStr = "{}"; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.appAttachPackages().deleteByResourceGroupWithResponse("z", "yckzex", com.azure.core.util.Context.NONE); + manager.appAttachPackages().deleteWithResponse("kltytmhdroz", "nhd", false, 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 index fac02616382b..0fe345739bf5 100644 --- 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 @@ -1,32 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.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}") + = BinaryData.fromString("{\"description\":\"glaocq\",\"friendlyName\":\"ccm\",\"showInFeed\":true}") .toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("pvhelxprg", model.description()); - Assertions.assertEquals("atddc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); + Assertions.assertEquals("glaocq", model.description()); + Assertions.assertEquals("ccm", model.friendlyName()); + Assertions.assertTrue(model.showInFeed()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationGroupPatchProperties model = new ApplicationGroupPatchProperties().withDescription("pvhelxprg") - .withFriendlyName("atddc") + ApplicationGroupPatchProperties model = new ApplicationGroupPatchProperties().withDescription("glaocq") + .withFriendlyName("ccm") .withShowInFeed(true); model = BinaryData.fromObject(model).toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("pvhelxprg", model.description()); - Assertions.assertEquals("atddc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); + Assertions.assertEquals("glaocq", model.description()); + Assertions.assertEquals("ccm", model.friendlyName()); + Assertions.assertTrue(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 index 3d5dcd4a643e..17c8d0a8b058 100644 --- 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; +import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatchProperties; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -14,26 +15,25 @@ 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\"}") + "{\"tags\":{\"kphywpnvjto\":\"cnjbkcnxdhbt\"},\"properties\":{\"description\":\"rmclfplphoxu\",\"friendlyName\":\"rpabg\",\"showInFeed\":false},\"id\":\"bjtazqugxywpmu\",\"name\":\"ef\",\"type\":\"zwfqkqujidsuyon\"}") .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()); + Assertions.assertEquals("cnjbkcnxdhbt", model.tags().get("kphywpnvjto")); + Assertions.assertEquals("rmclfplphoxu", model.properties().description()); + Assertions.assertEquals("rpabg", model.properties().friendlyName()); + Assertions.assertFalse(model.properties().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); + ApplicationGroupPatch model = new ApplicationGroupPatch().withTags(mapOf("kphywpnvjto", "cnjbkcnxdhbt")) + .withProperties(new ApplicationGroupPatchProperties().withDescription("rmclfplphoxu") + .withFriendlyName("rpabg") + .withShowInFeed(false)); 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()); + Assertions.assertEquals("cnjbkcnxdhbt", model.tags().get("kphywpnvjto")); + Assertions.assertEquals("rmclfplphoxu", model.properties().description()); + Assertions.assertEquals("rpabg", model.properties().friendlyName()); + Assertions.assertFalse(model.properties().showInFeed()); } // Use "Map.of" if available 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 index 7bdf0ec31758..98f22cfdcda7 100644 --- 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 @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ApplicationGroupProperties; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; import org.junit.jupiter.api.Assertions; @@ -13,27 +13,30 @@ 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}") + "{\"objectId\":\"haaxdbabphl\",\"description\":\"qlfktsths\",\"friendlyName\":\"ocmnyyazttbtwwrq\",\"hostPoolArmPath\":\"uedck\",\"workspaceArmPath\":\"wbiexzfey\",\"applicationGroupType\":\"RemoteApp\",\"cloudPcResource\":true,\"showInFeed\":false,\"oboTenantId\":\"ujwb\",\"deploymentScope\":\"Geographical\"}") .toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("bobzdopcjwvnhd", model.description()); - Assertions.assertEquals("wmgxcxrsl", model.friendlyName()); - Assertions.assertEquals("mutwuoe", model.hostPoolArmPath()); + Assertions.assertEquals("qlfktsths", model.description()); + Assertions.assertEquals("ocmnyyazttbtwwrq", model.friendlyName()); + Assertions.assertEquals("uedck", model.hostPoolArmPath()); Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); - Assertions.assertEquals(false, model.showInFeed()); + Assertions.assertFalse(model.showInFeed()); + Assertions.assertEquals("ujwb", model.oboTenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationGroupProperties model = new ApplicationGroupProperties().withDescription("bobzdopcjwvnhd") - .withFriendlyName("wmgxcxrsl") - .withHostPoolArmPath("mutwuoe") + ApplicationGroupProperties model = new ApplicationGroupProperties().withDescription("qlfktsths") + .withFriendlyName("ocmnyyazttbtwwrq") + .withHostPoolArmPath("uedck") .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) - .withShowInFeed(false); + .withShowInFeed(false) + .withOboTenantId("ujwb"); model = BinaryData.fromObject(model).toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("bobzdopcjwvnhd", model.description()); - Assertions.assertEquals("wmgxcxrsl", model.friendlyName()); - Assertions.assertEquals("mutwuoe", model.hostPoolArmPath()); + Assertions.assertEquals("qlfktsths", model.description()); + Assertions.assertEquals("ocmnyyazttbtwwrq", model.friendlyName()); + Assertions.assertEquals("uedck", model.hostPoolArmPath()); Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); - Assertions.assertEquals(false, model.showInFeed()); + Assertions.assertFalse(model.showInFeed()); + Assertions.assertEquals("ujwb", model.oboTenantId()); } } 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 index 9ab5a3dcc9fa..1172b929fbe3 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.applicationGroups().deleteByResourceGroupWithResponse("bjpi", "k", com.azure.core.util.Context.NONE); + manager.applicationGroups() + .deleteByResourceGroupWithResponse("juhpsprkzyau", "ia", 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 index f8c454bb1220..8a87660280a4 100644 --- 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ApplicationProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import org.junit.jupiter.api.Assertions; @@ -14,45 +15,46 @@ 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\"}") + "{\"properties\":{\"objectId\":\"xtgzukxitmmqtgqq\",\"description\":\"hrnxrxc\",\"friendlyName\":\"uisavokq\",\"filePath\":\"fvazivjlfrqttba\",\"msixPackageFamilyName\":\"katnwxyi\",\"msixPackageApplicationId\":\"id\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"uvscxkdmligov\",\"showInPortal\":true,\"iconPath\":\"kpmloa\",\"iconIndex\":1825240652,\"iconHash\":\"ocbgoorbteoyb\"},\"id\":\"xakvvjgslor\",\"name\":\"il\",\"type\":\"yw\"}") .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()); + Assertions.assertEquals("hrnxrxc", model.properties().description()); + Assertions.assertEquals("uisavokq", model.properties().friendlyName()); + Assertions.assertEquals("fvazivjlfrqttba", model.properties().filePath()); + Assertions.assertEquals("katnwxyi", model.properties().msixPackageFamilyName()); + Assertions.assertEquals("id", model.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.properties().commandLineSetting()); + Assertions.assertEquals("uvscxkdmligov", model.properties().commandLineArguments()); + Assertions.assertTrue(model.properties().showInPortal()); + Assertions.assertEquals("kpmloa", model.properties().iconPath()); + Assertions.assertEquals(1825240652, model.properties().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); + ApplicationInner model + = new ApplicationInner().withProperties(new ApplicationProperties().withDescription("hrnxrxc") + .withFriendlyName("uisavokq") + .withFilePath("fvazivjlfrqttba") + .withMsixPackageFamilyName("katnwxyi") + .withMsixPackageApplicationId("id") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) + .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) + .withCommandLineArguments("uvscxkdmligov") + .withShowInPortal(true) + .withIconPath("kpmloa") + .withIconIndex(1825240652)); 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()); + Assertions.assertEquals("hrnxrxc", model.properties().description()); + Assertions.assertEquals("uisavokq", model.properties().friendlyName()); + Assertions.assertEquals("fvazivjlfrqttba", model.properties().filePath()); + Assertions.assertEquals("katnwxyi", model.properties().msixPackageFamilyName()); + Assertions.assertEquals("id", model.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.properties().commandLineSetting()); + Assertions.assertEquals("uvscxkdmligov", model.properties().commandLineArguments()); + Assertions.assertTrue(model.properties().showInPortal()); + Assertions.assertEquals("kpmloa", model.properties().iconPath()); + Assertions.assertEquals(1825240652, model.properties().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 index e6d3bb395fd8..f74430d3a8a6 100644 --- 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 @@ -1,83 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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\"}") + "{\"value\":[{\"properties\":{\"objectId\":\"siykzkdncjdxonbz\",\"description\":\"gculap\",\"friendlyName\":\"y\",\"filePath\":\"gogtqxepnylbf\",\"msixPackageFamilyName\":\"jlyjtlvofq\",\"msixPackageApplicationId\":\"vfcibyfmowux\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"dwxf\",\"showInPortal\":true,\"iconPath\":\"vwzjbhyz\",\"iconIndex\":1858009162,\"iconHash\":\"kambtrnegvmnvuqe\"},\"id\":\"dspastjbkkdmfl\",\"name\":\"est\",\"type\":\"jlxr\"},{\"properties\":{\"objectId\":\"lozapeewchpxlk\",\"description\":\"kuziycsle\",\"friendlyName\":\"f\",\"filePath\":\"tcktyhjtqedcgzu\",\"msixPackageFamilyName\":\"mmrqz\",\"msixPackageApplicationId\":\"rjvpglydzgkrvqee\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"r\",\"showInPortal\":false,\"iconPath\":\"wytpzdmovz\",\"iconIndex\":408345247,\"iconHash\":\"awzqadfl\"},\"id\":\"riglaec\",\"name\":\"ndtic\",\"type\":\"kpvzmlq\"}],\"nextLink\":\"ld\"}") .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()); + Assertions.assertEquals("gculap", model.value().get(0).properties().description()); + Assertions.assertEquals("y", model.value().get(0).properties().friendlyName()); + Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).properties().filePath()); + Assertions.assertEquals("jlyjtlvofq", model.value().get(0).properties().msixPackageFamilyName()); + Assertions.assertEquals("vfcibyfmowux", model.value().get(0).properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.value().get(0).properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.value().get(0).properties().commandLineSetting()); + Assertions.assertEquals("dwxf", model.value().get(0).properties().commandLineArguments()); + Assertions.assertTrue(model.value().get(0).properties().showInPortal()); + Assertions.assertEquals("vwzjbhyz", model.value().get(0).properties().iconPath()); + Assertions.assertEquals(1858009162, model.value().get(0).properties().iconIndex()); + Assertions.assertEquals("ld", model.nextLink()); } } 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 index af2d601b5a21..cd880342bf97 100644 --- 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 @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ApplicationPatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import org.junit.jupiter.api.Assertions; @@ -14,45 +14,45 @@ 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\"}") + "{\"description\":\"er\",\"friendlyName\":\"pqbmfpjbab\",\"filePath\":\"dfc\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"uunnoxyhkxgqdd\",\"showInPortal\":false,\"iconPath\":\"fhoqca\",\"iconIndex\":2104625260,\"msixPackageFamilyName\":\"aomdjvlpjxx\",\"msixPackageApplicationId\":\"brm\",\"applicationType\":\"MsixApplication\"}") .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()); + Assertions.assertEquals("er", model.description()); + Assertions.assertEquals("pqbmfpjbab", model.friendlyName()); + Assertions.assertEquals("dfc", model.filePath()); + Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); + Assertions.assertEquals("uunnoxyhkxgqdd", model.commandLineArguments()); + Assertions.assertFalse(model.showInPortal()); + Assertions.assertEquals("fhoqca", model.iconPath()); + Assertions.assertEquals(2104625260, model.iconIndex()); + Assertions.assertEquals("aomdjvlpjxx", model.msixPackageFamilyName()); + Assertions.assertEquals("brm", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, 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); + ApplicationPatchProperties model = new ApplicationPatchProperties().withDescription("er") + .withFriendlyName("pqbmfpjbab") + .withFilePath("dfc") + .withCommandLineSetting(CommandLineSetting.REQUIRE) + .withCommandLineArguments("uunnoxyhkxgqdd") + .withShowInPortal(false) + .withIconPath("fhoqca") + .withIconIndex(2104625260) + .withMsixPackageFamilyName("aomdjvlpjxx") + .withMsixPackageApplicationId("brm") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION); 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()); + Assertions.assertEquals("er", model.description()); + Assertions.assertEquals("pqbmfpjbab", model.friendlyName()); + Assertions.assertEquals("dfc", model.filePath()); + Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); + Assertions.assertEquals("uunnoxyhkxgqdd", model.commandLineArguments()); + Assertions.assertFalse(model.showInPortal()); + Assertions.assertEquals("fhoqca", model.iconPath()); + Assertions.assertEquals(2104625260, model.iconIndex()); + Assertions.assertEquals("aomdjvlpjxx", model.msixPackageFamilyName()); + Assertions.assertEquals("brm", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, 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 index 90a7483601c5..0a4b50319f39 100644 --- 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 @@ -1,75 +1,60 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ApplicationPatchProperties; 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\"}}") + "{\"properties\":{\"description\":\"aiy\",\"friendlyName\":\"d\",\"filePath\":\"acegfnmntf\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"emfnczdwvvbal\",\"showInPortal\":false,\"iconPath\":\"chp\",\"iconIndex\":1628077523,\"msixPackageFamilyName\":\"evwrdnhfuk\",\"msixPackageApplicationId\":\"sjcswsmystuluqyp\",\"applicationType\":\"MsixApplication\"}}") .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()); + Assertions.assertEquals("aiy", model.properties().description()); + Assertions.assertEquals("d", model.properties().friendlyName()); + Assertions.assertEquals("acegfnmntf", model.properties().filePath()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.properties().commandLineSetting()); + Assertions.assertEquals("emfnczdwvvbal", model.properties().commandLineArguments()); + Assertions.assertFalse(model.properties().showInPortal()); + Assertions.assertEquals("chp", model.properties().iconPath()); + Assertions.assertEquals(1628077523, model.properties().iconIndex()); + Assertions.assertEquals("evwrdnhfuk", model.properties().msixPackageFamilyName()); + Assertions.assertEquals("sjcswsmystuluqyp", model.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.properties().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); + ApplicationPatch model + = new ApplicationPatch().withProperties(new ApplicationPatchProperties().withDescription("aiy") + .withFriendlyName("d") + .withFilePath("acegfnmntf") + .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) + .withCommandLineArguments("emfnczdwvvbal") + .withShowInPortal(false) + .withIconPath("chp") + .withIconIndex(1628077523) + .withMsixPackageFamilyName("evwrdnhfuk") + .withMsixPackageApplicationId("sjcswsmystuluqyp") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION)); 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; + Assertions.assertEquals("aiy", model.properties().description()); + Assertions.assertEquals("d", model.properties().friendlyName()); + Assertions.assertEquals("acegfnmntf", model.properties().filePath()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.properties().commandLineSetting()); + Assertions.assertEquals("emfnczdwvvbal", model.properties().commandLineArguments()); + Assertions.assertFalse(model.properties().showInPortal()); + Assertions.assertEquals("chp", model.properties().iconPath()); + Assertions.assertEquals(1628077523, model.properties().iconIndex()); + Assertions.assertEquals("evwrdnhfuk", model.properties().msixPackageFamilyName()); + Assertions.assertEquals("sjcswsmystuluqyp", model.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.properties().applicationType()); } } 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 index 8ec0dbd358e7..9f4d794c7289 100644 --- 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 @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ApplicationProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import org.junit.jupiter.api.Assertions; @@ -14,45 +14,45 @@ 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\"}") + "{\"objectId\":\"kgkxn\",\"description\":\"dabg\",\"friendlyName\":\"udtjuewbc\",\"filePath\":\"xuuwhcj\",\"msixPackageFamilyName\":\"ccybvp\",\"msixPackageApplicationId\":\"akkud\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"jplmagstcy\",\"showInPortal\":true,\"iconPath\":\"kyrk\",\"iconIndex\":293927715,\"iconHash\":\"iogsjkmnwq\"}") .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()); + Assertions.assertEquals("dabg", model.description()); + Assertions.assertEquals("udtjuewbc", model.friendlyName()); + Assertions.assertEquals("xuuwhcj", model.filePath()); + Assertions.assertEquals("ccybvp", model.msixPackageFamilyName()); + Assertions.assertEquals("akkud", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("jplmagstcy", model.commandLineArguments()); + Assertions.assertTrue(model.showInPortal()); + Assertions.assertEquals("kyrk", model.iconPath()); + Assertions.assertEquals(293927715, 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); + ApplicationProperties model = new ApplicationProperties().withDescription("dabg") + .withFriendlyName("udtjuewbc") + .withFilePath("xuuwhcj") + .withMsixPackageFamilyName("ccybvp") + .withMsixPackageApplicationId("akkud") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("jplmagstcy") + .withShowInPortal(true) + .withIconPath("kyrk") + .withIconIndex(293927715); 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()); + Assertions.assertEquals("dabg", model.description()); + Assertions.assertEquals("udtjuewbc", model.friendlyName()); + Assertions.assertEquals("xuuwhcj", model.filePath()); + Assertions.assertEquals("ccybvp", model.msixPackageFamilyName()); + Assertions.assertEquals("akkud", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("jplmagstcy", model.commandLineArguments()); + Assertions.assertTrue(model.showInPortal()); + Assertions.assertEquals("kyrk", model.iconPath()); + Assertions.assertEquals(293927715, 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 index 83e9a9723bb3..eb1d8ecc7bb1 100644 --- 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 @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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.ApplicationProperties; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; import java.nio.charset.StandardCharsets; @@ -23,41 +24,41 @@ 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\"}"; + = "{\"properties\":{\"objectId\":\"szllrzlsmmdqgmi\",\"description\":\"pimcqrhn\",\"friendlyName\":\"minkl\",\"filePath\":\"xsvtzarhzvqnsqk\",\"msixPackageFamilyName\":\"mbjwzzoslpkyb\",\"msixPackageApplicationId\":\"lwkzpgajsqjcem\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"vqar\",\"showInPortal\":false,\"iconPath\":\"qreblui\",\"iconIndex\":242401796,\"iconHash\":\"xsfgtdmbvxekr\"},\"id\":\"qkbud\",\"name\":\"twaokb\",\"type\":\"vlyttaaknwfrke\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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) + .define("xv") + .withExistingApplicationGroup("l", "slskkz") + .withProperties(new ApplicationProperties().withDescription("ojhpcnabxzfsn") + .withFriendlyName("ytexvzilmhivzk") + .withFilePath("wncknr") + .withMsixPackageFamilyName("ajlskzptj") + .withMsixPackageApplicationId("lwe") + .withApplicationType(RemoteApplicationType.IN_BUILT) + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("hxqlehmcgcjeinue") + .withShowInPortal(false) + .withIconPath("mvfejvqnttmbqd") + .withIconIndex(2120944830)) .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()); + Assertions.assertEquals("pimcqrhn", response.properties().description()); + Assertions.assertEquals("minkl", response.properties().friendlyName()); + Assertions.assertEquals("xsvtzarhzvqnsqk", response.properties().filePath()); + Assertions.assertEquals("mbjwzzoslpkyb", response.properties().msixPackageFamilyName()); + Assertions.assertEquals("lwkzpgajsqjcem", response.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, response.properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, response.properties().commandLineSetting()); + Assertions.assertEquals("vqar", response.properties().commandLineArguments()); + Assertions.assertFalse(response.properties().showInPortal()); + Assertions.assertEquals("qreblui", response.properties().iconPath()); + Assertions.assertEquals(242401796, response.properties().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 index d3ff85127aed..cd0610697ec4 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.applications() - .deleteWithResponse("o", "mffjkutycyarn", "oohguabzoghkt", com.azure.core.util.Context.NONE); + .deleteWithResponse("bzbcyksiv", "fogdrtbfcm", "rftsjcwjjxs", 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 index 7172c71968f9..bfb8986a50c2 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Application; @@ -23,29 +23,29 @@ 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\"}"; + = "{\"properties\":{\"objectId\":\"egqphrgfnzhctm\",\"description\":\"sghpbcbcpzarpze\",\"friendlyName\":\"cdl\",\"filePath\":\"zmpypefcpczshnu\",\"msixPackageFamilyName\":\"daizupf\",\"msixPackageApplicationId\":\"uytuszxhmtvtv\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"ukvzwydwttha\",\"showInPortal\":true,\"iconPath\":\"skjivbsshajqfuk\",\"iconIndex\":879775037,\"iconHash\":\"pgeumilh\"},\"id\":\"trdexyionofnin\",\"name\":\"dbzsx\",\"type\":\"wqqrsmpcbbprtuga\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Application response = manager.applications() - .getWithResponse("blto", "rmkfqlwxldykals", "g", com.azure.core.util.Context.NONE) + .getWithResponse("uiylpc", "aewse", "vesk", 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()); + Assertions.assertEquals("sghpbcbcpzarpze", response.properties().description()); + Assertions.assertEquals("cdl", response.properties().friendlyName()); + Assertions.assertEquals("zmpypefcpczshnu", response.properties().filePath()); + Assertions.assertEquals("daizupf", response.properties().msixPackageFamilyName()); + Assertions.assertEquals("uytuszxhmtvtv", response.properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.IN_BUILT, response.properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, response.properties().commandLineSetting()); + Assertions.assertEquals("ukvzwydwttha", response.properties().commandLineArguments()); + Assertions.assertTrue(response.properties().showInPortal()); + Assertions.assertEquals("skjivbsshajqfuk", response.properties().iconPath()); + Assertions.assertEquals(879775037, response.properties().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 index 529774286c17..0aaa2f04d842 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Application; @@ -24,28 +24,29 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"objectId\":\"if\",\"description\":\"cjxwkloozrvtxvcm\",\"friendlyName\":\"unlcpxxv\",\"filePath\":\"yeyng\",\"msixPackageFamilyName\":\"vrquv\",\"msixPackageApplicationId\":\"gglpmcrdcuelj\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"m\",\"showInPortal\":true,\"iconPath\":\"arvsx\",\"iconIndex\":1967742981,\"iconHash\":\"lcjkayspthzodub\"},\"id\":\"jtgblios\",\"name\":\"kfmkmfdjxyxgbk\",\"type\":\"qvjcteoe\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.applications() - .list("pyc", "hcoeocnhzq", 490198626, true, 368546114, com.azure.core.util.Context.NONE); + PagedIterable response + = manager.applications().list("mb", "wvif", 500522238, true, 697621672, 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()); + Assertions.assertEquals("cjxwkloozrvtxvcm", response.iterator().next().properties().description()); + Assertions.assertEquals("unlcpxxv", response.iterator().next().properties().friendlyName()); + Assertions.assertEquals("yeyng", response.iterator().next().properties().filePath()); + Assertions.assertEquals("vrquv", response.iterator().next().properties().msixPackageFamilyName()); + Assertions.assertEquals("gglpmcrdcuelj", response.iterator().next().properties().msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.IN_BUILT, + response.iterator().next().properties().applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, response.iterator().next().properties().commandLineSetting()); + Assertions.assertEquals("m", response.iterator().next().properties().commandLineArguments()); + Assertions.assertTrue(response.iterator().next().properties().showInPortal()); + Assertions.assertEquals("arvsx", response.iterator().next().properties().iconPath()); + Assertions.assertEquals(1967742981, response.iterator().next().properties().iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AzureActiveDirectoryInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AzureActiveDirectoryInfoPropertiesTests.java new file mode 100644 index 000000000000..ca4b4695d5db --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AzureActiveDirectoryInfoPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.AzureActiveDirectoryInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class AzureActiveDirectoryInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureActiveDirectoryInfoProperties model = BinaryData.fromString("{\"mdmProviderGuid\":\"picrmnzhrgmqgjsx\"}") + .toObject(AzureActiveDirectoryInfoProperties.class); + Assertions.assertEquals("picrmnzhrgmqgjsx", model.mdmProviderGuid()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureActiveDirectoryInfoProperties model + = new AzureActiveDirectoryInfoProperties().withMdmProviderGuid("picrmnzhrgmqgjsx"); + model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryInfoProperties.class); + Assertions.assertEquals("picrmnzhrgmqgjsx", model.mdmProviderGuid()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..d52c91807683 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPatchPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class BootDiagnosticsInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BootDiagnosticsInfoPatchProperties model + = BinaryData.fromString("{\"enabled\":true,\"storageUri\":\"syzfhotlhikcyych\"}") + .toObject(BootDiagnosticsInfoPatchProperties.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("syzfhotlhikcyych", model.storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BootDiagnosticsInfoPatchProperties model + = new BootDiagnosticsInfoPatchProperties().withEnabled(true).withStorageUri("syzfhotlhikcyych"); + model = BinaryData.fromObject(model).toObject(BootDiagnosticsInfoPatchProperties.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("syzfhotlhikcyych", model.storageUri()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPropertiesTests.java new file mode 100644 index 000000000000..b4b6f2012f2e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/BootDiagnosticsInfoPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.BootDiagnosticsInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class BootDiagnosticsInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BootDiagnosticsInfoProperties model = BinaryData.fromString("{\"enabled\":true,\"storageUri\":\"dths\"}") + .toObject(BootDiagnosticsInfoProperties.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("dths", model.storageUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BootDiagnosticsInfoProperties model + = new BootDiagnosticsInfoProperties().withEnabled(true).withStorageUri("dths"); + model = BinaryData.fromObject(model).toObject(BootDiagnosticsInfoProperties.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("dths", model.storageUri()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CreateDeletePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CreateDeletePropertiesTests.java new file mode 100644 index 000000000000..75875e513810 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CreateDeletePropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import org.junit.jupiter.api.Assertions; + +public final class CreateDeletePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateDeleteProperties model = BinaryData.fromString( + "{\"rampUpMaximumHostPoolSize\":1174017685,\"rampUpMinimumHostPoolSize\":1680525224,\"rampDownMaximumHostPoolSize\":1947700175,\"rampDownMinimumHostPoolSize\":1694830705}") + .toObject(CreateDeleteProperties.class); + Assertions.assertEquals(1174017685, model.rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1680525224, model.rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1947700175, model.rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1694830705, model.rampDownMinimumHostPoolSize()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateDeleteProperties model = new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1174017685) + .withRampUpMinimumHostPoolSize(1680525224) + .withRampDownMaximumHostPoolSize(1947700175) + .withRampDownMinimumHostPoolSize(1694830705); + model = BinaryData.fromObject(model).toObject(CreateDeleteProperties.class); + Assertions.assertEquals(1174017685, model.rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1680525224, model.rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1947700175, model.rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1694830705, model.rampDownMinimumHostPoolSize()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..a44b55a59fc0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPatchPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class CustomInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomInfoPatchProperties model + = BinaryData.fromString("{\"resourceId\":\"esyds\"}").toObject(CustomInfoPatchProperties.class); + Assertions.assertEquals("esyds", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomInfoPatchProperties model = new CustomInfoPatchProperties().withResourceId("esyds"); + model = BinaryData.fromObject(model).toObject(CustomInfoPatchProperties.class); + Assertions.assertEquals("esyds", model.resourceId()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPropertiesTests.java new file mode 100644 index 000000000000..684cf15200cf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/CustomInfoPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class CustomInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomInfoProperties model + = BinaryData.fromString("{\"resourceId\":\"kmvkhl\"}").toObject(CustomInfoProperties.class); + Assertions.assertEquals("kmvkhl", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomInfoProperties model = new CustomInfoProperties().withResourceId("kmvkhl"); + model = BinaryData.fromObject(model).toObject(CustomInfoProperties.class); + Assertions.assertEquals("kmvkhl", model.resourceId()); + } +} 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 index 6d2d40f42aa4..cbd66d0cabcc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,17 +12,9 @@ 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\"}") + "{\"properties\":{\"objectId\":\"bf\",\"description\":\"clnpkci\",\"friendlyName\":\"zriykhy\",\"iconHash\":\"fvjlboxqvkjlmx\"},\"id\":\"dynhdwdigum\",\"name\":\"nraauzz\",\"type\":\"tj\"}") .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()); + Assertions.assertEquals("clnpkci", model.properties().description()); + Assertions.assertEquals("zriykhy", model.properties().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 index f5977d0fee54..cc713c00437f 100644 --- 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 @@ -1,33 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.DesktopList; 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\"}") + "{\"value\":[{\"properties\":{\"objectId\":\"u\",\"description\":\"tppn\",\"friendlyName\":\"xz\",\"iconHash\":\"ihfrbbcevqa\"},\"id\":\"tdhlfkqo\",\"name\":\"py\",\"type\":\"vgtrdcnifmzzs\"}],\"nextLink\":\"m\"}") .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()); + Assertions.assertEquals("tppn", model.value().get(0).properties().description()); + Assertions.assertEquals("xz", model.value().get(0).properties().friendlyName()); + Assertions.assertEquals("m", model.nextLink()); } } 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 index 5906a13d6317..795384a0552d 100644 --- 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 @@ -1,27 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.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()); + DesktopPatchProperties model + = BinaryData.fromString("{\"description\":\"njdgkynscliq\",\"friendlyName\":\"vhxnk\"}") + .toObject(DesktopPatchProperties.class); + Assertions.assertEquals("njdgkynscliq", model.description()); + Assertions.assertEquals("vhxnk", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopPatchProperties model = new DesktopPatchProperties().withDescription("z").withFriendlyName("mrv"); + DesktopPatchProperties model + = new DesktopPatchProperties().withDescription("njdgkynscliq").withFriendlyName("vhxnk"); model = BinaryData.fromObject(model).toObject(DesktopPatchProperties.class); - Assertions.assertEquals("z", model.description()); - Assertions.assertEquals("mrv", model.friendlyName()); + Assertions.assertEquals("njdgkynscliq", model.description()); + Assertions.assertEquals("vhxnk", 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 index c70c8aecdead..fcfb4092fb43 100644 --- 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 @@ -1,47 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; 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\"}}") + DesktopPatch model = BinaryData + .fromString("{\"properties\":{\"description\":\"csttijfybvpoekr\",\"friendlyName\":\"sgbdhuz\"}}") .toObject(DesktopPatch.class); - Assertions.assertEquals("zkoj", model.tags().get("dcpzfoqo")); - Assertions.assertEquals("khnzbonlw", model.description()); - Assertions.assertEquals("oegokdwbwh", model.friendlyName()); + Assertions.assertEquals("csttijfybvpoekr", model.properties().description()); + Assertions.assertEquals("sgbdhuz", model.properties().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"); + DesktopPatch model = new DesktopPatch().withProperties( + new DesktopPatchProperties().withDescription("csttijfybvpoekr").withFriendlyName("sgbdhuz")); 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; + Assertions.assertEquals("csttijfybvpoekr", model.properties().description()); + Assertions.assertEquals("sgbdhuz", model.properties().friendlyName()); } } 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 index e6a89e92b973..f61878b18b80 100644 --- 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 @@ -1,28 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopProperties; +import com.azure.resourcemanager.desktopvirtualization.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\"}") + "{\"objectId\":\"ysdzhez\",\"description\":\"vaiqyuvvf\",\"friendlyName\":\"kphhq\",\"iconHash\":\"kvylauyavl\"}") .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()); + Assertions.assertEquals("vaiqyuvvf", model.description()); + Assertions.assertEquals("kphhq", 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 index d2458c064c5a..35a708a6812f 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; @@ -21,20 +21,19 @@ 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\"}"; + = "{\"properties\":{\"objectId\":\"toleksc\",\"description\":\"tnanqimwb\",\"friendlyName\":\"pdcldpka\",\"iconHash\":\"snlaimoux\"},\"id\":\"qmudmfcoibic\",\"name\":\"iuswswj\",\"type\":\"kbqsjhbtqqvyfscy\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Desktop response = manager.desktops() - .getWithResponse("bzf", "ovwmbjlzqsczpgvd", "napfdqwowftpt", com.azure.core.util.Context.NONE) - .getValue(); + Desktop response + = manager.desktops().getWithResponse("sm", "p", "ujd", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("gcgqyhleseyqrhvy", response.description()); - Assertions.assertEquals("dotjvdk", response.friendlyName()); + Assertions.assertEquals("tnanqimwb", response.properties().description()); + Assertions.assertEquals("pdcldpka", response.properties().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 index e4695f20aacd..2f04ac02c041 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; @@ -22,19 +22,19 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"objectId\":\"mfcnrjajqmatxj\",\"description\":\"elnzqgxxgfbbmt\",\"friendlyName\":\"qagynoipr\",\"iconHash\":\"calincryqxz\"},\"id\":\"zi\",\"name\":\"mqimiymqru\",\"type\":\"guhfupe\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.desktops().list("blhtjq", "qyv", 269491033, false, 792358698, com.azure.core.util.Context.NONE); + PagedIterable response = manager.desktops() + .list("krdpqgfhyrfr", "kkld", 1415414821, false, 2090185817, com.azure.core.util.Context.NONE); - Assertions.assertEquals("vzrrryveimi", response.iterator().next().description()); - Assertions.assertEquals("kdyzatvfuzk", response.iterator().next().friendlyName()); + Assertions.assertEquals("elnzqgxxgfbbmt", response.iterator().next().properties().description()); + Assertions.assertEquals("qagynoipr", response.iterator().next().properties().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 index 2375dbde64b1..af14490b1ebd 100644 --- 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 @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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 com.azure.resourcemanager.desktopvirtualization.models.DesktopPatchProperties; 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; @@ -24,36 +23,23 @@ 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\"}"; + = "{\"properties\":{\"objectId\":\"iyjvz\",\"description\":\"osrnawnvzmlnkoy\",\"friendlyName\":\"xvjabjq\",\"iconHash\":\"xuyvymcn\"},\"id\":\"doabhj\",\"name\":\"wxqweuipmpvksmi\",\"type\":\"nsqxtltc\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Desktop response = manager.desktops() - .updateWithResponse("vtwknvgmmbugt", "watmqa", "kueatgroeshoy", - new DesktopPatch().withTags(mapOf("ehqpuvjmvqmt", "byfqxkfaoy", "ejnndljdju", "wckygr")) - .withDescription("rreqynkceysfaqe") - .withFriendlyName("lwryshwddkvbxgkq"), + .updateWithResponse("fwbivqvo", "fuy", "wvbhlimbyq", + new DesktopPatch().withProperties( + new DesktopPatchProperties().withDescription("ood").withFriendlyName("kcdrdaasaxxobsm")), 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; + Assertions.assertEquals("osrnawnvzmlnkoy", response.properties().description()); + Assertions.assertEquals("xvjabjq", response.properties().friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiffDiskPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiffDiskPropertiesTests.java new file mode 100644 index 000000000000..ca2dd1ff3df0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiffDiskPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskOption; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskPlacement; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskProperties; +import org.junit.jupiter.api.Assertions; + +public final class DiffDiskPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiffDiskProperties model = BinaryData.fromString("{\"option\":\"Local\",\"placement\":\"CacheDisk\"}") + .toObject(DiffDiskProperties.class); + Assertions.assertEquals(DiffDiskOption.LOCAL, model.option()); + Assertions.assertEquals(DiffDiskPlacement.CACHE_DISK, model.placement()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiffDiskProperties model + = new DiffDiskProperties().withOption(DiffDiskOption.LOCAL).withPlacement(DiffDiskPlacement.CACHE_DISK); + model = BinaryData.fromObject(model).toObject(DiffDiskProperties.class); + Assertions.assertEquals(DiffDiskOption.LOCAL, model.option()); + Assertions.assertEquals(DiffDiskPlacement.CACHE_DISK, model.placement()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiskInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiskInfoPropertiesTests.java new file mode 100644 index 000000000000..47a08aababa5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DiskInfoPropertiesTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskOption; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskPlacement; +import com.azure.resourcemanager.desktopvirtualization.models.DiffDiskProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DiskInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedDiskProperties; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import org.junit.jupiter.api.Assertions; + +public final class DiskInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiskInfoProperties model = BinaryData.fromString( + "{\"managedDisk\":{\"type\":\"StandardSSD_LRS\"},\"diffDiskSettings\":{\"option\":\"Local\",\"placement\":\"ResourceDisk\"}}") + .toObject(DiskInfoProperties.class); + Assertions.assertEquals(VirtualMachineDiskType.STANDARD_SSD_LRS, model.managedDisk().type()); + Assertions.assertEquals(DiffDiskOption.LOCAL, model.diffDiskSettings().option()); + Assertions.assertEquals(DiffDiskPlacement.RESOURCE_DISK, model.diffDiskSettings().placement()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiskInfoProperties model = new DiskInfoProperties() + .withManagedDisk(new ManagedDiskProperties().withType(VirtualMachineDiskType.STANDARD_SSD_LRS)) + .withDiffDiskSettings(new DiffDiskProperties().withOption(DiffDiskOption.LOCAL) + .withPlacement(DiffDiskPlacement.RESOURCE_DISK)); + model = BinaryData.fromObject(model).toObject(DiskInfoProperties.class); + Assertions.assertEquals(VirtualMachineDiskType.STANDARD_SSD_LRS, model.managedDisk().type()); + Assertions.assertEquals(DiffDiskOption.LOCAL, model.diffDiskSettings().option()); + Assertions.assertEquals(DiffDiskPlacement.RESOURCE_DISK, model.diffDiskSettings().placement()); + } +} 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 index 2cbe2c5ffdad..c4db6b2f98ba 100644 --- 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 @@ -1,94 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"properties\":{\"packageAlias\":\"bq\",\"imagePath\":\"vmkcx\",\"packageName\":\"apvhelxprgly\",\"packageFamilyName\":\"dd\",\"packageFullName\":\"cbcuejrjxgciqi\",\"displayName\":\"hos\",\"packageRelativePath\":\"dqrhzoymib\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"wfluszdt\",\"publisher\":\"rkwofyyvoqa\",\"minVersion\":\"iexpbtgiwbwo\"},{\"dependencyName\":\"washr\",\"publisher\":\"tkcnqxwb\",\"minVersion\":\"kulpiujwaasi\"},{\"dependencyName\":\"i\",\"publisher\":\"byuqerpqlp\",\"minVersion\":\"cciuqgbdbutau\"},{\"dependencyName\":\"btkuwhh\",\"publisher\":\"ykojoxafnndlpic\",\"minVersion\":\"o\"}],\"version\":\"kcdyhbpk\",\"lastUpdated\":\"2021-02-04T17:28:33Z\",\"packageApplications\":[{\"appId\":\"q\",\"description\":\"vvqfovljxyws\",\"appUserModelID\":\"syrsndsytgadgvra\",\"friendlyName\":\"en\",\"iconImageName\":\"nzar\"},{\"appId\":\"uu\",\"description\":\"fqka\",\"appUserModelID\":\"wiipfpub\",\"friendlyName\":\"bwwift\",\"iconImageName\":\"qkvpuvksgplsakn\"},{\"appId\":\"ynl\",\"description\":\"huopxodlqiynto\",\"appUserModelID\":\"ihleos\",\"friendlyName\":\"w\",\"iconImageName\":\"mslyzrpzbchckqqz\"}],\"certificateName\":\"iysui\",\"certificateExpiry\":\"2021-06-27T05:18:24Z\"},\"id\":\"edyatrwyhqmibzyh\",\"name\":\"itsmypyyn\",\"type\":\"cdpu\"}") .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()); + Assertions.assertEquals("bq", model.properties().packageAlias()); + Assertions.assertEquals("vmkcx", model.properties().imagePath()); + Assertions.assertEquals("apvhelxprgly", model.properties().packageName()); + Assertions.assertEquals("dd", model.properties().packageFamilyName()); + Assertions.assertEquals("cbcuejrjxgciqi", model.properties().packageFullName()); + Assertions.assertEquals("hos", model.properties().displayName()); + Assertions.assertEquals("dqrhzoymib", model.properties().packageRelativePath()); + Assertions.assertFalse(model.properties().isRegularRegistration()); + Assertions.assertTrue(model.properties().isActive()); + Assertions.assertEquals("wfluszdt", model.properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("rkwofyyvoqa", model.properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("iexpbtgiwbwo", model.properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("kcdyhbpk", model.properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T17:28:33Z"), model.properties().lastUpdated()); + Assertions.assertEquals("q", model.properties().packageApplications().get(0).appId()); + Assertions.assertEquals("vvqfovljxyws", model.properties().packageApplications().get(0).description()); + Assertions.assertEquals("syrsndsytgadgvra", model.properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("en", model.properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("nzar", model.properties().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("iysui", model.properties().certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T05:18:24Z"), model.properties().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 index fd84a168e2d1..fc9d81620be5 100644 --- 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 @@ -1,176 +1,50 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.ExpandMsixImageList; 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\"}") + "{\"value\":[{\"properties\":{\"packageAlias\":\"bkpyc\",\"imagePath\":\"lwn\",\"packageName\":\"hjdauwhvylwz\",\"packageFamilyName\":\"dhxujznbmpo\",\"packageFullName\":\"wpr\",\"displayName\":\"lve\",\"packageRelativePath\":\"lupj\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"cswsrtjri\",\"publisher\":\"rbpbewtghfgblcg\",\"minVersion\":\"zvlvqhjkbegib\"},{\"dependencyName\":\"mxiebw\",\"publisher\":\"loayqcgw\",\"minVersion\":\"zjuzgwyz\"},{\"dependencyName\":\"txon\",\"publisher\":\"ts\",\"minVersion\":\"jcbpwxqpsrknft\"}],\"version\":\"vriuhprwmdyvx\",\"lastUpdated\":\"2021-05-28T21:07:01Z\",\"packageApplications\":[{\"appId\":\"ww\",\"description\":\"yqbexrmcqibycno\",\"appUserModelID\":\"knme\",\"friendlyName\":\"sgzvahapjyzhpv\",\"iconImageName\":\"zcjrvxdjzlmwlx\"},{\"appId\":\"fhzovawjvzunluth\",\"description\":\"prnxipeil\",\"appUserModelID\":\"zuaejxd\",\"friendlyName\":\"tskzbbtdzumveek\",\"iconImageName\":\"wozuhkf\"}],\"certificateName\":\"yofd\",\"certificateExpiry\":\"2021-04-25T06:48:17Z\"},\"id\":\"sd\",\"name\":\"touwaboekqv\",\"type\":\"elnsmvbxw\"},{\"properties\":{\"packageAlias\":\"flhhcaal\",\"imagePath\":\"ixisxyawjoy\",\"packageName\":\"cslyjpk\",\"packageFamilyName\":\"dzyexznelixh\",\"packageFullName\":\"ztfolhbnxk\",\"displayName\":\"laulppg\",\"packageRelativePath\":\"tpnapnyiropuhpig\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"itxmedjvcslynqww\",\"publisher\":\"wzz\",\"minVersion\":\"gktrmgucnapkte\"},{\"dependencyName\":\"llwptfdy\",\"publisher\":\"fqbuaceopzf\",\"minVersion\":\"hhuao\"}],\"version\":\"pcqeqx\",\"lastUpdated\":\"2021-02-19T08:33:13Z\",\"packageApplications\":[{\"appId\":\"zxctobgb\",\"description\":\"moizpos\",\"appUserModelID\":\"grcfb\",\"friendlyName\":\"rmfqjhhkxbpvj\",\"iconImageName\":\"jhxxjyn\"},{\"appId\":\"vkr\",\"description\":\"wbxqzvszjfau\",\"appUserModelID\":\"fdxxivetvtcqaqtd\",\"friendlyName\":\"mcbxvwvxysl\",\"iconImageName\":\"hsfxoblytkb\"},{\"appId\":\"wwwfbkr\",\"description\":\"nsvs\",\"appUserModelID\":\"johxcrsb\",\"friendlyName\":\"vasrruvwb\",\"iconImageName\":\"qfsubcgjbirx\"}],\"certificateName\":\"srfbjfdtwss\",\"certificateExpiry\":\"2021-06-01T18:34:35Z\"},\"id\":\"pvjzbe\",\"name\":\"ilzznfqqnvwp\",\"type\":\"qtaruoujmkcjhwq\"},{\"properties\":{\"packageAlias\":\"r\",\"imagePath\":\"n\",\"packageName\":\"ewgdrjervn\",\"packageFamilyName\":\"nqpeh\",\"packageFullName\":\"doy\",\"displayName\":\"ifthnz\",\"packageRelativePath\":\"dslgnayqigynduh\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"umaq\",\"publisher\":\"bgycduiertgccym\",\"minVersion\":\"olpsslqlf\"},{\"dependencyName\":\"dnbbglzps\",\"publisher\":\"ydmcwyhzdxssa\",\"minVersion\":\"zmnvdfznudaod\"}],\"version\":\"zbn\",\"lastUpdated\":\"2021-04-02T19:32:11Z\",\"packageApplications\":[{\"appId\":\"stdbhhxsrzdzu\",\"description\":\"rsc\",\"appUserModelID\":\"t\",\"friendlyName\":\"vfiwjmygtdss\",\"iconImageName\":\"wtmwerio\"},{\"appId\":\"qsemwabne\",\"description\":\"hhszh\",\"appUserModelID\":\"plvwiwubmwmbes\",\"friendlyName\":\"nkww\",\"iconImageName\":\"pjflcxogao\"},{\"appId\":\"m\",\"description\":\"ikvmkqzeqqk\",\"appUserModelID\":\"tfz\",\"friendlyName\":\"hhvh\",\"iconImageName\":\"r\"},{\"appId\":\"wobdagxtibqdx\",\"description\":\"wakbogqxndl\",\"appUserModelID\":\"gxhuriplbp\",\"friendlyName\":\"xunkbebxmubyynt\",\"iconImageName\":\"rbqtkoie\"}],\"certificateName\":\"tgqr\",\"certificateExpiry\":\"2021-06-26T20:58:29Z\"},\"id\":\"u\",\"name\":\"lauwzizxbmpgcjef\",\"type\":\"zmuvpbttdumorppx\"},{\"properties\":{\"packageAlias\":\"nzbtbhj\",\"imagePath\":\"lkfg\",\"packageName\":\"dneu\",\"packageFamilyName\":\"fphsdyhtozfikdow\",\"packageFullName\":\"uuvxz\",\"displayName\":\"lvithhqzonosgg\",\"packageRelativePath\":\"c\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ka\",\"publisher\":\"utiiswacf\",\"minVersion\":\"dkzzewkfvhqcrail\"},{\"dependencyName\":\"n\",\"publisher\":\"fuflrwdmhdlx\",\"minVersion\":\"rxsagafcnihgwqa\"},{\"dependencyName\":\"edgfbcvkcvq\",\"publisher\":\"keqdcvdrhvoods\",\"minVersion\":\"bobzdopcjwvnhd\"},{\"dependencyName\":\"wmgxcxrsl\",\"publisher\":\"utwu\",\"minVersion\":\"grpkhjwniyqs\"}],\"version\":\"i\",\"lastUpdated\":\"2021-04-15T16:21:59Z\",\"packageApplications\":[{\"appId\":\"zzlvmbmpaxmodfv\",\"description\":\"fy\",\"appUserModelID\":\"bpfvm\",\"friendlyName\":\"hrfou\",\"iconImageName\":\"taakc\"}],\"certificateName\":\"zvqtmnubexkp\",\"certificateExpiry\":\"2021-05-08T13:31:38Z\"},\"id\":\"ondjmq\",\"name\":\"xvy\",\"type\":\"omgkopkwho\"}],\"nextLink\":\"pajqgxysm\"}") .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()); + Assertions.assertEquals("bkpyc", model.value().get(0).properties().packageAlias()); + Assertions.assertEquals("lwn", model.value().get(0).properties().imagePath()); + Assertions.assertEquals("hjdauwhvylwz", model.value().get(0).properties().packageName()); + Assertions.assertEquals("dhxujznbmpo", model.value().get(0).properties().packageFamilyName()); + Assertions.assertEquals("wpr", model.value().get(0).properties().packageFullName()); + Assertions.assertEquals("lve", model.value().get(0).properties().displayName()); + Assertions.assertEquals("lupj", model.value().get(0).properties().packageRelativePath()); + Assertions.assertTrue(model.value().get(0).properties().isRegularRegistration()); + Assertions.assertTrue(model.value().get(0).properties().isActive()); + Assertions.assertEquals("cswsrtjri", + model.value().get(0).properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("rbpbewtghfgblcg", + model.value().get(0).properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("zvlvqhjkbegib", + model.value().get(0).properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("vriuhprwmdyvx", model.value().get(0).properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T21:07:01Z"), + model.value().get(0).properties().lastUpdated()); + Assertions.assertEquals("ww", model.value().get(0).properties().packageApplications().get(0).appId()); + Assertions.assertEquals("yqbexrmcqibycno", + model.value().get(0).properties().packageApplications().get(0).description()); + Assertions.assertEquals("knme", + model.value().get(0).properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("sgzvahapjyzhpv", + model.value().get(0).properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("zcjrvxdjzlmwlx", + model.value().get(0).properties().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("yofd", model.value().get(0).properties().certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T06:48:17Z"), + model.value().get(0).properties().certificateExpiry()); + Assertions.assertEquals("pajqgxysm", model.nextLink()); } } 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 index 64c8ff7ea8a7..91b31bf4b43b 100644 --- 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 @@ -1,108 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImageProperties; 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\"}") + "{\"packageAlias\":\"zgmwznmabikns\",\"imagePath\":\"gj\",\"packageName\":\"bldtlww\",\"packageFamilyName\":\"kdmtncvokotll\",\"packageFullName\":\"yhgsy\",\"displayName\":\"ogjltdtbnnhad\",\"packageRelativePath\":\"crkvcikhnv\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"u\",\"publisher\":\"ik\",\"minVersion\":\"ggxkallatmelwuip\"}],\"version\":\"cjzkzivgvvcna\",\"lastUpdated\":\"2021-09-08T02:15:33Z\",\"packageApplications\":[{\"appId\":\"xxmueedn\",\"description\":\"dvstkw\",\"appUserModelID\":\"tchealmf\",\"friendlyName\":\"d\",\"iconImageName\":\"ygdvwv\"},{\"appId\":\"hgwxrtfudx\",\"description\":\"xg\",\"appUserModelID\":\"agvrvmnpkuk\",\"friendlyName\":\"i\",\"iconImageName\":\"blxgwimf\"},{\"appId\":\"j\",\"description\":\"mszkkfo\",\"appUserModelID\":\"eyfkzikfja\",\"friendlyName\":\"eaivxwczel\",\"iconImageName\":\"irels\"}],\"certificateName\":\"nwabfatkldd\",\"certificateExpiry\":\"2021-11-23T10:06:03Z\"}") .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()); + Assertions.assertEquals("zgmwznmabikns", model.packageAlias()); + Assertions.assertEquals("gj", model.imagePath()); + Assertions.assertEquals("bldtlww", model.packageName()); + Assertions.assertEquals("kdmtncvokotll", model.packageFamilyName()); + Assertions.assertEquals("yhgsy", model.packageFullName()); + Assertions.assertEquals("ogjltdtbnnhad", model.displayName()); + Assertions.assertEquals("crkvcikhnv", model.packageRelativePath()); + Assertions.assertFalse(model.isRegularRegistration()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("u", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ik", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("ggxkallatmelwuip", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("cjzkzivgvvcna", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-08T02:15:33Z"), model.lastUpdated()); + Assertions.assertEquals("xxmueedn", model.packageApplications().get(0).appId()); + Assertions.assertEquals("dvstkw", model.packageApplications().get(0).description()); + Assertions.assertEquals("tchealmf", model.packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("d", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("ygdvwv", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("nwabfatkldd", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T10:06:03Z"), model.certificateExpiry()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolProvisioningControlParameterTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolProvisioningControlParameterTests.java new file mode 100644 index 000000000000..da18c2d4b36f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolProvisioningControlParameterTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProvisioningControlParameter; +import org.junit.jupiter.api.Assertions; + +public final class HostPoolProvisioningControlParameterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostPoolProvisioningControlParameter model + = BinaryData.fromString("{\"action\":\"Cancel\",\"cancelMessage\":\"fhxwrsne\"}") + .toObject(HostPoolProvisioningControlParameter.class); + Assertions.assertEquals(HostPoolProvisioningAction.CANCEL, model.action()); + Assertions.assertEquals("fhxwrsne", model.cancelMessage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostPoolProvisioningControlParameter model + = new HostPoolProvisioningControlParameter().withAction(HostPoolProvisioningAction.CANCEL) + .withCancelMessage("fhxwrsne"); + model = BinaryData.fromObject(model).toObject(HostPoolProvisioningControlParameter.class); + Assertions.assertEquals(HostPoolProvisioningAction.CANCEL, model.action()); + Assertions.assertEquals("fhxwrsne", model.cancelMessage()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPatchPropertiesTests.java new file mode 100644 index 000000000000..6c1a6b8d9b11 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPatchPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class HostPoolUpdateConfigurationPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostPoolUpdateConfigurationPatchProperties model = BinaryData.fromString( + "{\"deleteOriginalVm\":false,\"maxVmsRemoved\":626252727,\"logOffDelayMinutes\":1186082602,\"logOffMessage\":\"ukyefchnmnahmnxh\"}") + .toObject(HostPoolUpdateConfigurationPatchProperties.class); + Assertions.assertFalse(model.deleteOriginalVm()); + Assertions.assertEquals(626252727, model.maxVmsRemoved()); + Assertions.assertEquals(1186082602, model.logOffDelayMinutes()); + Assertions.assertEquals("ukyefchnmnahmnxh", model.logOffMessage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostPoolUpdateConfigurationPatchProperties model + = new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(false) + .withMaxVmsRemoved(626252727) + .withLogOffDelayMinutes(1186082602) + .withLogOffMessage("ukyefchnmnahmnxh"); + model = BinaryData.fromObject(model).toObject(HostPoolUpdateConfigurationPatchProperties.class); + Assertions.assertFalse(model.deleteOriginalVm()); + Assertions.assertEquals(626252727, model.maxVmsRemoved()); + Assertions.assertEquals(1186082602, model.logOffDelayMinutes()); + Assertions.assertEquals("ukyefchnmnahmnxh", model.logOffMessage()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPropertiesTests.java new file mode 100644 index 000000000000..50e87b6177f8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateConfigurationPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import org.junit.jupiter.api.Assertions; + +public final class HostPoolUpdateConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostPoolUpdateConfigurationProperties model = BinaryData.fromString( + "{\"deleteOriginalVm\":true,\"maxVmsRemoved\":1759306380,\"logOffDelayMinutes\":738049564,\"logOffMessage\":\"zejywhslw\"}") + .toObject(HostPoolUpdateConfigurationProperties.class); + Assertions.assertTrue(model.deleteOriginalVm()); + Assertions.assertEquals(1759306380, model.maxVmsRemoved()); + Assertions.assertEquals(738049564, model.logOffDelayMinutes()); + Assertions.assertEquals("zejywhslw", model.logOffMessage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostPoolUpdateConfigurationProperties model + = new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(1759306380) + .withLogOffDelayMinutes(738049564) + .withLogOffMessage("zejywhslw"); + model = BinaryData.fromObject(model).toObject(HostPoolUpdateConfigurationProperties.class); + Assertions.assertTrue(model.deleteOriginalVm()); + Assertions.assertEquals(1759306380, model.maxVmsRemoved()); + Assertions.assertEquals(738049564, model.logOffDelayMinutes()); + Assertions.assertEquals("zejywhslw", model.logOffMessage()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateControlParameterTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateControlParameterTests.java new file mode 100644 index 000000000000..f32407647109 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolUpdateControlParameterTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateAction; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateControlParameter; +import org.junit.jupiter.api.Assertions; + +public final class HostPoolUpdateControlParameterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostPoolUpdateControlParameter model + = BinaryData.fromString("{\"action\":\"Retry\",\"cancelMessage\":\"qirwrweoox\"}") + .toObject(HostPoolUpdateControlParameter.class); + Assertions.assertEquals(HostPoolUpdateAction.RETRY, model.action()); + Assertions.assertEquals("qirwrweoox", model.cancelMessage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostPoolUpdateControlParameter model + = new HostPoolUpdateControlParameter().withAction(HostPoolUpdateAction.RETRY) + .withCancelMessage("qirwrweoox"); + model = BinaryData.fromObject(model).toObject(HostPoolUpdateControlParameter.class); + Assertions.assertEquals(HostPoolUpdateAction.RETRY, model.action()); + Assertions.assertEquals("qirwrweoox", model.cancelMessage()); + } +} 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 index 37def34fbd48..2af0377c3d5a 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.hostPools().deleteWithResponse("cpoq", "avnwqj", false, com.azure.core.util.Context.NONE); + manager.hostPools().deleteWithResponse("xhxknlc", "rmmkyupiju", 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/ImageInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImageInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..b2884e7c4bcf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImageInfoPatchPropertiesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import org.junit.jupiter.api.Assertions; + +public final class ImageInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImageInfoPatchProperties model = BinaryData.fromString( + "{\"type\":\"Marketplace\",\"marketplaceInfo\":{\"offer\":\"caab\",\"publisher\":\"lhbhl\",\"sku\":\"mxuq\",\"exactVersion\":\"s\"},\"customInfo\":{\"resourceId\":\"cudfbsfarfsiowl\"}}") + .toObject(ImageInfoPatchProperties.class); + Assertions.assertEquals(Type.MARKETPLACE, model.imageType()); + Assertions.assertEquals("caab", model.marketplaceInfo().offer()); + Assertions.assertEquals("lhbhl", model.marketplaceInfo().publisher()); + Assertions.assertEquals("mxuq", model.marketplaceInfo().sku()); + Assertions.assertEquals("s", model.marketplaceInfo().exactVersion()); + Assertions.assertEquals("cudfbsfarfsiowl", model.customInfo().resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImageInfoPatchProperties model = new ImageInfoPatchProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoPatchProperties().withOffer("caab") + .withPublisher("lhbhl") + .withSku("mxuq") + .withExactVersion("s")) + .withCustomInfo(new CustomInfoPatchProperties().withResourceId("cudfbsfarfsiowl")); + model = BinaryData.fromObject(model).toObject(ImageInfoPatchProperties.class); + Assertions.assertEquals(Type.MARKETPLACE, model.imageType()); + Assertions.assertEquals("caab", model.marketplaceInfo().offer()); + Assertions.assertEquals("lhbhl", model.marketplaceInfo().publisher()); + Assertions.assertEquals("mxuq", model.marketplaceInfo().sku()); + Assertions.assertEquals("s", model.marketplaceInfo().exactVersion()); + Assertions.assertEquals("cudfbsfarfsiowl", model.customInfo().resourceId()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImageInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImageInfoPropertiesTests.java new file mode 100644 index 000000000000..d16935146508 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImageInfoPropertiesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CustomInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.ImageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.Type; +import org.junit.jupiter.api.Assertions; + +public final class ImageInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImageInfoProperties model = BinaryData.fromString( + "{\"type\":\"Marketplace\",\"marketplaceInfo\":{\"offer\":\"xtiv\",\"publisher\":\"j\",\"sku\":\"nidibgqjxg\",\"exactVersion\":\"n\"},\"customInfo\":{\"resourceId\":\"govfgpikqmhhaow\"}}") + .toObject(ImageInfoProperties.class); + Assertions.assertEquals(Type.MARKETPLACE, model.imageType()); + Assertions.assertEquals("xtiv", model.marketplaceInfo().offer()); + Assertions.assertEquals("j", model.marketplaceInfo().publisher()); + Assertions.assertEquals("nidibgqjxg", model.marketplaceInfo().sku()); + Assertions.assertEquals("n", model.marketplaceInfo().exactVersion()); + Assertions.assertEquals("govfgpikqmhhaow", model.customInfo().resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImageInfoProperties model = new ImageInfoProperties().withImageType(Type.MARKETPLACE) + .withMarketplaceInfo(new MarketplaceInfoProperties().withOffer("xtiv") + .withPublisher("j") + .withSku("nidibgqjxg") + .withExactVersion("n")) + .withCustomInfo(new CustomInfoProperties().withResourceId("govfgpikqmhhaow")); + model = BinaryData.fromObject(model).toObject(ImageInfoProperties.class); + Assertions.assertEquals(Type.MARKETPLACE, model.imageType()); + Assertions.assertEquals("xtiv", model.marketplaceInfo().offer()); + Assertions.assertEquals("j", model.marketplaceInfo().publisher()); + Assertions.assertEquals("nidibgqjxg", model.marketplaceInfo().sku()); + Assertions.assertEquals("n", model.marketplaceInfo().exactVersion()); + Assertions.assertEquals("govfgpikqmhhaow", model.customInfo().resourceId()); + } +} 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 index e2c3281726c7..829cff664c3a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,18 +12,19 @@ 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()); + ImportPackageInfoRequest model + = BinaryData.fromString("{\"path\":\"ytdxwit\",\"packageArchitecture\":\"ARM64\"}") + .toObject(ImportPackageInfoRequest.class); + Assertions.assertEquals("ytdxwit", model.path()); + Assertions.assertEquals(AppAttachPackageArchitectures.ARM64, model.packageArchitecture()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImportPackageInfoRequest model = new ImportPackageInfoRequest().withPath("zivj") - .withPackageArchitecture(AppAttachPackageArchitectures.X86A64); + ImportPackageInfoRequest model = new ImportPackageInfoRequest().withPath("ytdxwit") + .withPackageArchitecture(AppAttachPackageArchitectures.ARM64); model = BinaryData.fromObject(model).toObject(ImportPackageInfoRequest.class); - Assertions.assertEquals("zivj", model.path()); - Assertions.assertEquals(AppAttachPackageArchitectures.X86A64, model.packageArchitecture()); + Assertions.assertEquals("ytdxwit", model.path()); + Assertions.assertEquals(AppAttachPackageArchitectures.ARM64, model.packageArchitecture()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatesPostWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatesPostWithResponseMockTests.java new file mode 100644 index 000000000000..f0dc04c7eb17 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/InitiateSessionHostUpdatesPostWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InitiateSessionHostUpdatesPostWithResponseMockTests { + @Test + public void testPostWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.initiateSessionHostUpdates() + .postWithResponse("titsf", "ofw", + new UpdateSessionHostsRequestBody().withScheduledDateTime(OffsetDateTime.parse("2021-10-26T06:51:57Z")) + .withScheduledDateTimeZone("k") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(843668740) + .withLogOffDelayMinutes(1308551166) + .withLogOffMessage("wdfriwgybjpoz")), + com.azure.core.util.Context.NONE); + + } +} 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 index ee52843d8630..e866b0cd2353 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,21 +12,10 @@ public final class LogSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogSpecification model = BinaryData - .fromString("{\"name\":\"ryhtnapczwlokjy\",\"displayName\":\"kkvnipjox\",\"blobDuration\":\"nchgej\"}") + .fromString("{\"name\":\"yahux\",\"displayName\":\"pmqnja\",\"blobDuration\":\"ixjsprozvcputeg\"}") .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()); + Assertions.assertEquals("yahux", model.name()); + Assertions.assertEquals("pmqnja", model.displayName()); + Assertions.assertEquals("ixjsprozvcputeg", model.blobDuration()); } } 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 new file mode 100644 index 000000000000..c07b7ebd4464 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MSIXPackageListTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.MSIXPackageList; +import java.time.OffsetDateTime; +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\":\"b\",\"packageName\":\"bwvqvxkdi\",\"packageFamilyName\":\"ihebwtsw\",\"displayName\":\"uwfmduragegizvc\",\"packageRelativePath\":\"elisdjub\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"kbsazgak\",\"publisher\":\"cyrcmjdmspo\",\"minVersion\":\"pv\"},{\"dependencyName\":\"rylniofrzg\",\"publisher\":\"jed\",\"minVersion\":\"tkvnlvxbcuiiznkt\"},{\"dependencyName\":\"ansnvp\",\"publisher\":\"bmikost\",\"minVersion\":\"bkiw\"},{\"dependencyName\":\"qnyophzfyls\",\"publisher\":\"rpfbcunezz\",\"minVersion\":\"zelfwyfwl\"}],\"version\":\"jwetnpsihcla\",\"lastUpdated\":\"2021-08-22T14:03:47Z\",\"packageApplications\":[{\"appId\":\"pt\",\"description\":\"qqwzt\",\"appUserModelID\":\"w\",\"friendlyName\":\"chcxwaxfewzj\",\"iconImageName\":\"exfdeqvhpsylk\"},{\"appId\":\"bffmbmxz\",\"description\":\"gywwpgjxs\",\"appUserModelID\":\"tf\",\"friendlyName\":\"gicgaaoepttaq\",\"iconImageName\":\"dewemxswv\"},{\"appId\":\"zzjgehkfki\",\"description\":\"tixo\",\"appUserModelID\":\"fqyinljqepqw\",\"friendlyName\":\"xmonstshi\",\"iconImageName\":\"gvelfc\"},{\"appId\":\"cb\",\"description\":\"ds\",\"appUserModelID\":\"wcobie\",\"friendlyName\":\"tmninw\",\"iconImageName\":\"zcilnghg\"}]},\"id\":\"jtbxqmuluxlx\",\"name\":\"zvners\",\"type\":\"ycucrwnamikzeb\"},{\"properties\":{\"imagePath\":\"bsmswziqgf\",\"packageName\":\"okzrus\",\"packageFamilyName\":\"vhczznvfby\",\"displayName\":\"sxjwwixz\",\"packageRelativePath\":\"mwmxqhndvnoamld\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"hhflzo\",\"publisher\":\"coxpelnjeta\",\"minVersion\":\"tsxoatftgz\"}],\"version\":\"pbswvefloccsrm\",\"lastUpdated\":\"2021-04-16T14:56:19Z\",\"packageApplications\":[{\"appId\":\"pgawtxxpkyjcxcjx\",\"description\":\"ytfmpc\",\"appUserModelID\":\"ilrmcaykggnox\",\"friendlyName\":\"t\",\"iconImageName\":\"sxwpndfcpfnznthj\"}]},\"id\":\"aosrxuz\",\"name\":\"oamktcq\",\"type\":\"os\"}],\"nextLink\":\"bzahgxqd\"}") + .toObject(MSIXPackageList.class); + Assertions.assertEquals("b", model.value().get(0).properties().imagePath()); + Assertions.assertEquals("bwvqvxkdi", model.value().get(0).properties().packageName()); + Assertions.assertEquals("ihebwtsw", model.value().get(0).properties().packageFamilyName()); + Assertions.assertEquals("uwfmduragegizvc", model.value().get(0).properties().displayName()); + Assertions.assertEquals("elisdjub", model.value().get(0).properties().packageRelativePath()); + Assertions.assertFalse(model.value().get(0).properties().isRegularRegistration()); + Assertions.assertTrue(model.value().get(0).properties().isActive()); + Assertions.assertEquals("kbsazgak", + model.value().get(0).properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("cyrcmjdmspo", + model.value().get(0).properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("pv", model.value().get(0).properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("jwetnpsihcla", model.value().get(0).properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T14:03:47Z"), + model.value().get(0).properties().lastUpdated()); + Assertions.assertEquals("pt", model.value().get(0).properties().packageApplications().get(0).appId()); + Assertions.assertEquals("qqwzt", model.value().get(0).properties().packageApplications().get(0).description()); + Assertions.assertEquals("w", model.value().get(0).properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("chcxwaxfewzj", + model.value().get(0).properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("exfdeqvhpsylk", + model.value().get(0).properties().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("bzahgxqd", model.nextLink()); + } +} 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 index a8ab2f5a1c8a..efeb37b82d7b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -13,18 +13,18 @@ public final class MaintenanceWindowPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceWindowPatchProperties model - = BinaryData.fromString("{\"hour\":1583288095,\"dayOfWeek\":\"Wednesday\"}") + = BinaryData.fromString("{\"hour\":1791253895,\"dayOfWeek\":\"Saturday\"}") .toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(1583288095, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); + Assertions.assertEquals(1791253895, model.hour()); + Assertions.assertEquals(DayOfWeek.SATURDAY, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MaintenanceWindowPatchProperties model - = new MaintenanceWindowPatchProperties().withHour(1583288095).withDayOfWeek(DayOfWeek.WEDNESDAY); + = new MaintenanceWindowPatchProperties().withHour(1791253895).withDayOfWeek(DayOfWeek.SATURDAY); model = BinaryData.fromObject(model).toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(1583288095, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); + Assertions.assertEquals(1791253895, model.hour()); + Assertions.assertEquals(DayOfWeek.SATURDAY, 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 index 212e2423206b..94d3f6678528 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,18 +12,18 @@ public final class MaintenanceWindowPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MaintenanceWindowProperties model = BinaryData.fromString("{\"hour\":1842679392,\"dayOfWeek\":\"Sunday\"}") + MaintenanceWindowProperties model = BinaryData.fromString("{\"hour\":1320056895,\"dayOfWeek\":\"Thursday\"}") .toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1842679392, model.hour()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek()); + Assertions.assertEquals(1320056895, model.hour()); + Assertions.assertEquals(DayOfWeek.THURSDAY, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MaintenanceWindowProperties model - = new MaintenanceWindowProperties().withHour(1842679392).withDayOfWeek(DayOfWeek.SUNDAY); + = new MaintenanceWindowProperties().withHour(1320056895).withDayOfWeek(DayOfWeek.THURSDAY); model = BinaryData.fromObject(model).toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1842679392, model.hour()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.dayOfWeek()); + Assertions.assertEquals(1320056895, model.hour()); + Assertions.assertEquals(DayOfWeek.THURSDAY, model.dayOfWeek()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedDiskPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedDiskPropertiesTests.java new file mode 100644 index 000000000000..4780729099ca --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedDiskPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedDiskProperties; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineDiskType; +import org.junit.jupiter.api.Assertions; + +public final class ManagedDiskPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedDiskProperties model + = BinaryData.fromString("{\"type\":\"Standard_LRS\"}").toObject(ManagedDiskProperties.class); + Assertions.assertEquals(VirtualMachineDiskType.STANDARD_LRS, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedDiskProperties model = new ManagedDiskProperties().withType(VirtualMachineDiskType.STANDARD_LRS); + model = BinaryData.fromObject(model).toObject(ManagedDiskProperties.class); + Assertions.assertEquals(VirtualMachineDiskType.STANDARD_LRS, model.type()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedServiceIdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..2c8c778debce --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentity; +import com.azure.resourcemanager.desktopvirtualization.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.desktopvirtualization.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"lmuzy\",\"tenantId\":\"aepdkzjanc\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"dbpgnxytxhp\":{\"principalId\":\"wbavxbniwdj\",\"clientId\":\"zt\"},\"wtctyqi\":{\"principalId\":\"bzpfzab\",\"clientId\":\"cuh\"},\"kfplgmgsxnk\":{\"principalId\":\"bbovplwzbhvgyugu\",\"clientId\":\"vmkfssxqu\"},\"zb\":{\"principalId\":\"kde\",\"clientId\":\"pvlopwiyighxpkd\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model + = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("dbpgnxytxhp", new UserAssignedIdentity(), "wtctyqi", new UserAssignedIdentity(), + "kfplgmgsxnk", new UserAssignedIdentity(), "zb", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..48bb50bf9016 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPatchPropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class MarketplaceInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarketplaceInfoPatchProperties model = BinaryData.fromString( + "{\"offer\":\"xnq\",\"publisher\":\"wgfstmhqykizm\",\"sku\":\"saoafcluqvox\",\"exactVersion\":\"cjimryvwgcwwpbmz\"}") + .toObject(MarketplaceInfoPatchProperties.class); + Assertions.assertEquals("xnq", model.offer()); + Assertions.assertEquals("wgfstmhqykizm", model.publisher()); + Assertions.assertEquals("saoafcluqvox", model.sku()); + Assertions.assertEquals("cjimryvwgcwwpbmz", model.exactVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceInfoPatchProperties model = new MarketplaceInfoPatchProperties().withOffer("xnq") + .withPublisher("wgfstmhqykizm") + .withSku("saoafcluqvox") + .withExactVersion("cjimryvwgcwwpbmz"); + model = BinaryData.fromObject(model).toObject(MarketplaceInfoPatchProperties.class); + Assertions.assertEquals("xnq", model.offer()); + Assertions.assertEquals("wgfstmhqykizm", model.publisher()); + Assertions.assertEquals("saoafcluqvox", model.sku()); + Assertions.assertEquals("cjimryvwgcwwpbmz", model.exactVersion()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPropertiesTests.java new file mode 100644 index 000000000000..29574edce95f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MarketplaceInfoPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.MarketplaceInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class MarketplaceInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarketplaceInfoProperties model = BinaryData + .fromString( + "{\"offer\":\"rmzvupo\",\"publisher\":\"qzdfuydzvkfvxcn\",\"sku\":\"mx\",\"exactVersion\":\"psw\"}") + .toObject(MarketplaceInfoProperties.class); + Assertions.assertEquals("rmzvupo", model.offer()); + Assertions.assertEquals("qzdfuydzvkfvxcn", model.publisher()); + Assertions.assertEquals("mx", model.sku()); + Assertions.assertEquals("psw", model.exactVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceInfoProperties model = new MarketplaceInfoProperties().withOffer("rmzvupo") + .withPublisher("qzdfuydzvkfvxcn") + .withSku("mx") + .withExactVersion("psw"); + model = BinaryData.fromObject(model).toObject(MarketplaceInfoProperties.class); + Assertions.assertEquals("rmzvupo", model.offer()); + Assertions.assertEquals("qzdfuydzvkfvxcn", model.publisher()); + Assertions.assertEquals("mx", model.sku()); + Assertions.assertEquals("psw", model.exactVersion()); + } +} 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 index 69ecd509e142..525523885170 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,14 +11,14 @@ 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()); + MsixImageUri model = BinaryData.fromString("{\"uri\":\"awgqwgxhni\"}").toObject(MsixImageUri.class); + Assertions.assertEquals("awgqwgxhni", model.uri()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixImageUri model = new MsixImageUri().withUri("hvnh"); + MsixImageUri model = new MsixImageUri().withUri("awgqwgxhni"); model = BinaryData.fromObject(model).toObject(MsixImageUri.class); - Assertions.assertEquals("hvnh", model.uri()); + Assertions.assertEquals("awgqwgxhni", 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 index 80609acf579f..b7624e0db352 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; @@ -23,39 +23,49 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"packageAlias\":\"oeshoygzcbyfq\",\"imagePath\":\"faoytehqpuv\",\"packageName\":\"vqmtdwckygroejn\",\"packageFamilyName\":\"ljdjuskbrreqy\",\"packageFullName\":\"ceysfaqeg\",\"displayName\":\"wryshwd\",\"packageRelativePath\":\"vbxgkqusyb\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"vvlfntymtp\",\"publisher\":\"wenaz\",\"minVersion\":\"ohzrsqalsx\"},{\"dependencyName\":\"nwqapfgsdpcvess\",\"publisher\":\"hhkuuip\",\"minVersion\":\"q\"}],\"version\":\"tekva\",\"lastUpdated\":\"2021-01-13T21:15:49Z\",\"packageApplications\":[{\"appId\":\"qvqyvweht\",\"description\":\"mxhzzysevus\",\"appUserModelID\":\"vzrrryveimi\",\"friendlyName\":\"kdyzatvfuzk\",\"iconImageName\":\"tjvv\"},{\"appId\":\"igsyeipqdsmjt\",\"description\":\"qgdgkkile\",\"appUserModelID\":\"kcsmk\",\"friendlyName\":\"wtbbaedorvvmqf\",\"iconImageName\":\"ygbdgwumgxdgdhpa\"},{\"appId\":\"xjd\",\"description\":\"jsaqwotmmwllcols\",\"appUserModelID\":\"xaptefhexcgjok\",\"friendlyName\":\"jnhvlqjbekpeeks\",\"iconImageName\":\"ksdqhjvy\"}],\"certificateName\":\"sl\",\"certificateExpiry\":\"2021-03-06T14:39:47Z\"},\"id\":\"stcpoqmavnwqjw\",\"name\":\"o\",\"type\":\"nlejjjkxybwf\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.msixImages() - .expand("p", "hzzwvywrgyngy", new MsixImageUri().withUri("rpxncaki"), com.azure.core.util.Context.NONE); + .expand("fkndl", "vtwknvgmmbugt", new MsixImageUri().withUri("atmqaqkuea"), + 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()); + Assertions.assertEquals("oeshoygzcbyfq", response.iterator().next().properties().packageAlias()); + Assertions.assertEquals("faoytehqpuv", response.iterator().next().properties().imagePath()); + Assertions.assertEquals("vqmtdwckygroejn", response.iterator().next().properties().packageName()); + Assertions.assertEquals("ljdjuskbrreqy", response.iterator().next().properties().packageFamilyName()); + Assertions.assertEquals("ceysfaqeg", response.iterator().next().properties().packageFullName()); + Assertions.assertEquals("wryshwd", response.iterator().next().properties().displayName()); + Assertions.assertEquals("vbxgkqusyb", response.iterator().next().properties().packageRelativePath()); + Assertions.assertTrue(response.iterator().next().properties().isRegularRegistration()); + Assertions.assertFalse(response.iterator().next().properties().isActive()); + Assertions.assertEquals("vvlfntymtp", + response.iterator().next().properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("wenaz", + response.iterator().next().properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("ohzrsqalsx", + response.iterator().next().properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("tekva", response.iterator().next().properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T21:15:49Z"), + response.iterator().next().properties().lastUpdated()); + Assertions.assertEquals("qvqyvweht", + response.iterator().next().properties().packageApplications().get(0).appId()); + Assertions.assertEquals("mxhzzysevus", + response.iterator().next().properties().packageApplications().get(0).description()); + Assertions.assertEquals("vzrrryveimi", + response.iterator().next().properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("kdyzatvfuzk", + response.iterator().next().properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("tjvv", + response.iterator().next().properties().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("sl", response.iterator().next().properties().certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T14:39:47Z"), + response.iterator().next().properties().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 index 0b0897b86337..959d361d2fe4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,27 +12,27 @@ 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\"}") + "{\"appId\":\"cffcyddglmj\",\"description\":\"jqkwpyeicx\",\"appUserModelID\":\"ciwqvhk\",\"friendlyName\":\"xuigdtopbobj\",\"iconImageName\":\"hm\"}") .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()); + Assertions.assertEquals("cffcyddglmj", model.appId()); + Assertions.assertEquals("jqkwpyeicx", model.description()); + Assertions.assertEquals("ciwqvhk", model.appUserModelID()); + Assertions.assertEquals("xuigdtopbobj", model.friendlyName()); + Assertions.assertEquals("hm", 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"); + MsixPackageApplications model = new MsixPackageApplications().withAppId("cffcyddglmj") + .withDescription("jqkwpyeicx") + .withAppUserModelID("ciwqvhk") + .withFriendlyName("xuigdtopbobj") + .withIconImageName("hm"); 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()); + Assertions.assertEquals("cffcyddglmj", model.appId()); + Assertions.assertEquals("jqkwpyeicx", model.description()); + Assertions.assertEquals("ciwqvhk", model.appUserModelID()); + Assertions.assertEquals("xuigdtopbobj", model.friendlyName()); + Assertions.assertEquals("hm", 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 index feaceff94db0..01f65108b9c9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,21 +11,23 @@ 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()); + MsixPackageDependencies model = BinaryData + .fromString( + "{\"dependencyName\":\"xibqeojnx\",\"publisher\":\"zvddntwndeicbtwn\",\"minVersion\":\"aoqvuh\"}") + .toObject(MsixPackageDependencies.class); + Assertions.assertEquals("xibqeojnx", model.dependencyName()); + Assertions.assertEquals("zvddntwndeicbtwn", model.publisher()); + Assertions.assertEquals("aoqvuh", model.minVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageDependencies model - = new MsixPackageDependencies().withDependencyName("sx").withPublisher("jmsvpkjp").withMinVersion("kwcf"); + MsixPackageDependencies model = new MsixPackageDependencies().withDependencyName("xibqeojnx") + .withPublisher("zvddntwndeicbtwn") + .withMinVersion("aoqvuh"); model = BinaryData.fromObject(model).toObject(MsixPackageDependencies.class); - Assertions.assertEquals("sx", model.dependencyName()); - Assertions.assertEquals("jmsvpkjp", model.publisher()); - Assertions.assertEquals("kwcf", model.minVersion()); + Assertions.assertEquals("xibqeojnx", model.dependencyName()); + Assertions.assertEquals("zvddntwndeicbtwn", model.publisher()); + Assertions.assertEquals("aoqvuh", 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 index 77f67e0d2dc3..0b82d1f4cbaa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -8,6 +8,7 @@ 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.MsixPackageProperties; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -16,76 +17,70 @@ 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\"}") + "{\"properties\":{\"imagePath\":\"opv\",\"packageName\":\"dbzqgqqihed\",\"packageFamilyName\":\"qwthmky\",\"displayName\":\"cysihs\",\"packageRelativePath\":\"cw\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"cdzsu\",\"publisher\":\"ohdxbzlmcmu\",\"minVersion\":\"cvhd\"},{\"dependencyName\":\"v\",\"publisher\":\"qxeysko\",\"minVersion\":\"zinkfkbgbzbowxeq\"},{\"dependencyName\":\"ljmygvkzqkjjeokb\",\"publisher\":\"fezrx\",\"minVersion\":\"zurtleipqxbkwvz\"}],\"version\":\"zvd\",\"lastUpdated\":\"2021-09-26T21:10:41Z\",\"packageApplications\":[{\"appId\":\"zmqpnodawopqhewj\",\"description\":\"mcgsbostzelnd\",\"appUserModelID\":\"tutmzl\",\"friendlyName\":\"ojlvfhrbbpneqvc\",\"iconImageName\":\"yyurmochpprprsnm\"}]},\"id\":\"zejnhl\",\"name\":\"kpbz\",\"type\":\"cpilj\"}") .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()); + Assertions.assertEquals("opv", model.properties().imagePath()); + Assertions.assertEquals("dbzqgqqihed", model.properties().packageName()); + Assertions.assertEquals("qwthmky", model.properties().packageFamilyName()); + Assertions.assertEquals("cysihs", model.properties().displayName()); + Assertions.assertEquals("cw", model.properties().packageRelativePath()); + Assertions.assertFalse(model.properties().isRegularRegistration()); + Assertions.assertFalse(model.properties().isActive()); + Assertions.assertEquals("cdzsu", model.properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ohdxbzlmcmu", model.properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("cvhd", model.properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("zvd", model.properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T21:10:41Z"), model.properties().lastUpdated()); + Assertions.assertEquals("zmqpnodawopqhewj", model.properties().packageApplications().get(0).appId()); + Assertions.assertEquals("mcgsbostzelnd", model.properties().packageApplications().get(0).description()); + Assertions.assertEquals("tutmzl", model.properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("ojlvfhrbbpneqvc", model.properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("yyurmochpprprsnm", model.properties().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") + MsixPackageInner model = new MsixPackageInner().withProperties(new MsixPackageProperties().withImagePath("opv") + .withPackageName("dbzqgqqihed") + .withPackageFamilyName("qwthmky") + .withDisplayName("cysihs") + .withPackageRelativePath("cw") .withIsRegularRegistration(false) - .withIsActive(true) + .withIsActive(false) .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"))); + new MsixPackageDependencies().withDependencyName("cdzsu") + .withPublisher("ohdxbzlmcmu") + .withMinVersion("cvhd"), + new MsixPackageDependencies().withDependencyName("v") + .withPublisher("qxeysko") + .withMinVersion("zinkfkbgbzbowxeq"), + new MsixPackageDependencies().withDependencyName("ljmygvkzqkjjeokb") + .withPublisher("fezrx") + .withMinVersion("zurtleipqxbkwvz"))) + .withVersion("zvd") + .withLastUpdated(OffsetDateTime.parse("2021-09-26T21:10:41Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("zmqpnodawopqhewj") + .withDescription("mcgsbostzelnd") + .withAppUserModelID("tutmzl") + .withFriendlyName("ojlvfhrbbpneqvc") + .withIconImageName("yyurmochpprprsnm")))); 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()); + Assertions.assertEquals("opv", model.properties().imagePath()); + Assertions.assertEquals("dbzqgqqihed", model.properties().packageName()); + Assertions.assertEquals("qwthmky", model.properties().packageFamilyName()); + Assertions.assertEquals("cysihs", model.properties().displayName()); + Assertions.assertEquals("cw", model.properties().packageRelativePath()); + Assertions.assertFalse(model.properties().isRegularRegistration()); + Assertions.assertFalse(model.properties().isActive()); + Assertions.assertEquals("cdzsu", model.properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ohdxbzlmcmu", model.properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("cvhd", model.properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("zvd", model.properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T21:10:41Z"), model.properties().lastUpdated()); + Assertions.assertEquals("zmqpnodawopqhewj", model.properties().packageApplications().get(0).appId()); + Assertions.assertEquals("mcgsbostzelnd", model.properties().packageApplications().get(0).description()); + Assertions.assertEquals("tutmzl", model.properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("ojlvfhrbbpneqvc", model.properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("yyurmochpprprsnm", model.properties().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 index c70bc8e71cb8..a7b5541b070b 100644 --- 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 @@ -1,32 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackagePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.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()); + MsixPackagePatchProperties model + = BinaryData.fromString("{\"isActive\":false,\"isRegularRegistration\":false,\"displayName\":\"fvwbcb\"}") + .toObject(MsixPackagePatchProperties.class); + Assertions.assertFalse(model.isActive()); + Assertions.assertFalse(model.isRegularRegistration()); + Assertions.assertEquals("fvwbcb", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MsixPackagePatchProperties model = new MsixPackagePatchProperties().withIsActive(false) - .withIsRegularRegistration(true) - .withDisplayName("dqkdlwwqfbu"); + .withIsRegularRegistration(false) + .withDisplayName("fvwbcb"); model = BinaryData.fromObject(model).toObject(MsixPackagePatchProperties.class); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals("dqkdlwwqfbu", model.displayName()); + Assertions.assertFalse(model.isActive()); + Assertions.assertFalse(model.isRegularRegistration()); + Assertions.assertEquals("fvwbcb", 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 index 3a22750d3132..9ad3b0d3c80a 100644 --- 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 @@ -1,32 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatchProperties; 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\"}") + "{\"properties\":{\"isActive\":true,\"isRegularRegistration\":false,\"displayName\":\"bgsxgnxfyqonmpq\"},\"id\":\"wdofdbxiqx\",\"name\":\"iiqbi\",\"type\":\"htmwwinh\"}") .toObject(MsixPackagePatch.class); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yhpluodpvruudlgz", model.displayName()); + Assertions.assertTrue(model.properties().isActive()); + Assertions.assertFalse(model.properties().isRegularRegistration()); + Assertions.assertEquals("bgsxgnxfyqonmpq", model.properties().displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackagePatch model = new MsixPackagePatch().withIsActive(true) - .withIsRegularRegistration(false) - .withDisplayName("yhpluodpvruudlgz"); + MsixPackagePatch model + = new MsixPackagePatch().withProperties(new MsixPackagePatchProperties().withIsActive(true) + .withIsRegularRegistration(false) + .withDisplayName("bgsxgnxfyqonmpq")); model = BinaryData.fromObject(model).toObject(MsixPackagePatch.class); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yhpluodpvruudlgz", model.displayName()); + Assertions.assertTrue(model.properties().isActive()); + Assertions.assertFalse(model.properties().isRegularRegistration()); + Assertions.assertEquals("bgsxgnxfyqonmpq", model.properties().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 index 251e62800d9e..8f6b8e6e1a74 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -16,76 +16,89 @@ 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\"}]}") + "{\"imagePath\":\"hzvechndbnwieho\",\"packageName\":\"wjwiuub\",\"packageFamilyName\":\"fqsfa\",\"displayName\":\"qtferrqwexjkmf\",\"packageRelativePath\":\"pjwogqqno\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"tqwpwya\",\"publisher\":\"zasqbucljgkyexao\",\"minVersion\":\"yaipidsda\"},{\"dependencyName\":\"tx\",\"publisher\":\"jumfqwazlnq\",\"minVersion\":\"cjngzqdqxtbjwgny\"},{\"dependencyName\":\"sf\",\"publisher\":\"vtuikzhajq\",\"minVersion\":\"cfhmlrqryxyn\"},{\"dependencyName\":\"zrdpsovwxznptgoe\",\"publisher\":\"bbabp\",\"minVersion\":\"vf\"}],\"version\":\"kvntjlrigjkskyri\",\"lastUpdated\":\"2020-12-31T15:34:24Z\",\"packageApplications\":[{\"appId\":\"sxwaabzm\",\"description\":\"rygznmmaxriz\",\"appUserModelID\":\"obgop\",\"friendlyName\":\"hsln\",\"iconImageName\":\"xieixynllxec\"},{\"appId\":\"jphslhcaw\",\"description\":\"tifdwfmvi\",\"appUserModelID\":\"rqjb\",\"friendlyName\":\"zhraglkafh\",\"iconImageName\":\"qjujeickpzvcp\"},{\"appId\":\"elnwclt\",\"description\":\"edexxmlfm\",\"appUserModelID\":\"scazuawxtzxpu\",\"friendlyName\":\"wabzxrvxcushsp\",\"iconImageName\":\"ivmxyasfl\"},{\"appId\":\"zwywako\",\"description\":\"knsmjblmljhlnymz\",\"appUserModelID\":\"qyryuzcbmqqvxm\",\"friendlyName\":\"fgtayxonsup\",\"iconImageName\":\"jlzqnhc\"}]}") .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()); + Assertions.assertEquals("hzvechndbnwieho", model.imagePath()); + Assertions.assertEquals("wjwiuub", model.packageName()); + Assertions.assertEquals("fqsfa", model.packageFamilyName()); + Assertions.assertEquals("qtferrqwexjkmf", model.displayName()); + Assertions.assertEquals("pjwogqqno", model.packageRelativePath()); + Assertions.assertTrue(model.isRegularRegistration()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("tqwpwya", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("zasqbucljgkyexao", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("yaipidsda", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("kvntjlrigjkskyri", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T15:34:24Z"), model.lastUpdated()); + Assertions.assertEquals("sxwaabzm", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rygznmmaxriz", model.packageApplications().get(0).description()); + Assertions.assertEquals("obgop", model.packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("hsln", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("xieixynllxec", 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") + MsixPackageProperties model = new MsixPackageProperties().withImagePath("hzvechndbnwieho") + .withPackageName("wjwiuub") + .withPackageFamilyName("fqsfa") + .withDisplayName("qtferrqwexjkmf") + .withPackageRelativePath("pjwogqqno") .withIsRegularRegistration(true) - .withIsActive(false) + .withIsActive(true) .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")) + new MsixPackageDependencies().withDependencyName("tqwpwya") + .withPublisher("zasqbucljgkyexao") + .withMinVersion("yaipidsda"), + new MsixPackageDependencies().withDependencyName("tx") + .withPublisher("jumfqwazlnq") + .withMinVersion("cjngzqdqxtbjwgny"), + new MsixPackageDependencies().withDependencyName("sf") + .withPublisher("vtuikzhajq") + .withMinVersion("cfhmlrqryxyn"), + new MsixPackageDependencies().withDependencyName("zrdpsovwxznptgoe") + .withPublisher("bbabp") + .withMinVersion("vf"))) + .withVersion("kvntjlrigjkskyri") + .withLastUpdated(OffsetDateTime.parse("2020-12-31T15:34:24Z")) .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"))); + new MsixPackageApplications().withAppId("sxwaabzm") + .withDescription("rygznmmaxriz") + .withAppUserModelID("obgop") + .withFriendlyName("hsln") + .withIconImageName("xieixynllxec"), + new MsixPackageApplications().withAppId("jphslhcaw") + .withDescription("tifdwfmvi") + .withAppUserModelID("rqjb") + .withFriendlyName("zhraglkafh") + .withIconImageName("qjujeickpzvcp"), + new MsixPackageApplications().withAppId("elnwclt") + .withDescription("edexxmlfm") + .withAppUserModelID("scazuawxtzxpu") + .withFriendlyName("wabzxrvxcushsp") + .withIconImageName("ivmxyasfl"), + new MsixPackageApplications().withAppId("zwywako") + .withDescription("knsmjblmljhlnymz") + .withAppUserModelID("qyryuzcbmqqvxm") + .withFriendlyName("fgtayxonsup") + .withIconImageName("jlzqnhc"))); 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()); + Assertions.assertEquals("hzvechndbnwieho", model.imagePath()); + Assertions.assertEquals("wjwiuub", model.packageName()); + Assertions.assertEquals("fqsfa", model.packageFamilyName()); + Assertions.assertEquals("qtferrqwexjkmf", model.displayName()); + Assertions.assertEquals("pjwogqqno", model.packageRelativePath()); + Assertions.assertTrue(model.isRegularRegistration()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("tqwpwya", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("zasqbucljgkyexao", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("yaipidsda", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("kvntjlrigjkskyri", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T15:34:24Z"), model.lastUpdated()); + Assertions.assertEquals("sxwaabzm", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rygznmmaxriz", model.packageApplications().get(0).description()); + Assertions.assertEquals("obgop", model.packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("hsln", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("xieixynllxec", 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 index 17c6b58c8d3b..009a613f6599 100644 --- 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 @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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 com.azure.resourcemanager.desktopvirtualization.models.MsixPackageProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -24,69 +25,63 @@ 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\"}"; + = "{\"properties\":{\"imagePath\":\"jei\",\"packageName\":\"kgqaboo\",\"packageFamilyName\":\"bmsgycqsxrmdv\",\"displayName\":\"uyqaeohpj\",\"packageRelativePath\":\"ejkbvhhdaurgho\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"xjxjoe\",\"publisher\":\"qxrkdknko\",\"minVersion\":\"ktmbozomtzami\"}],\"version\":\"igwcdgzsezn\",\"lastUpdated\":\"2021-10-15T23:02:01Z\",\"packageApplications\":[{\"appId\":\"iraabmdlqjbedpf\",\"description\":\"lhupmomihzbdnpxp\",\"appUserModelID\":\"dpr\",\"friendlyName\":\"xelyicghflr\",\"iconImageName\":\"ssjyghsfx\"},{\"appId\":\"ammgmqfmefgv\",\"description\":\"pd\",\"appUserModelID\":\"gquxweysland\",\"friendlyName\":\"cdjhunhg\",\"iconImageName\":\"gawnrrnquo\"},{\"appId\":\"ireimseobf\",\"description\":\"stcyilbvzmmxcjz\",\"appUserModelID\":\"uzexokjxebjvbzin\",\"friendlyName\":\"bwmvogljsvl\",\"iconImageName\":\"idnwceha\"},{\"appId\":\"yzltgiomqo\",\"description\":\"epiaeapfsergd\",\"appUserModelID\":\"eqn\",\"friendlyName\":\"yheqwb\",\"iconImageName\":\"qncjubkhjozfymcw\"}]},\"id\":\"yvqyvliqiips\",\"name\":\"jbsv\",\"type\":\"iaieswhddzydi\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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"))) + .define("ogatmoljiy") + .withExistingHostPool("yudivbxnhsqeaeo", "qelwgdhuruzytza") + .withProperties(new MsixPackageProperties().withImagePath("pinm") + .withPackageName("fkneerzztrkn") + .withPackageFamilyName("ulugdybnhrxlelfj") + .withDisplayName("eizcpih") + .withPackageRelativePath("miw") + .withIsRegularRegistration(false) + .withIsActive(true) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("ydbjzcqymlcf") + .withPublisher("hmhsurlgwqkpm") + .withMinVersion("pstauol"), + new MsixPackageDependencies().withDependencyName("iubmom") + .withPublisher("vvjhvvlrlohewjj") + .withMinVersion("jnkdflqion"), + new MsixPackageDependencies().withDependencyName("aeqkzfzqxjoshoh") + .withPublisher("tryegpkh") + .withMinVersion("mexznlwkb"), + new MsixPackageDependencies().withDependencyName("kxkhupzerufgj") + .withPublisher("cdr") + .withMinVersion("fcemftzgyyky"))) + .withVersion("ugekdfqn") + .withLastUpdated(OffsetDateTime.parse("2021-09-13T22:54:25Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("wrczfjjnnuxxrk") + .withDescription("hmnulwem") + .withAppUserModelID("cifrhjulrsulwzpf") + .withFriendlyName("snawmhhgzotfri") + .withIconImageName("gkoekvzwxxyxh")))) .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()); + Assertions.assertEquals("jei", response.properties().imagePath()); + Assertions.assertEquals("kgqaboo", response.properties().packageName()); + Assertions.assertEquals("bmsgycqsxrmdv", response.properties().packageFamilyName()); + Assertions.assertEquals("uyqaeohpj", response.properties().displayName()); + Assertions.assertEquals("ejkbvhhdaurgho", response.properties().packageRelativePath()); + Assertions.assertTrue(response.properties().isRegularRegistration()); + Assertions.assertFalse(response.properties().isActive()); + Assertions.assertEquals("xjxjoe", response.properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("qxrkdknko", response.properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("ktmbozomtzami", response.properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("igwcdgzsezn", response.properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T23:02:01Z"), response.properties().lastUpdated()); + Assertions.assertEquals("iraabmdlqjbedpf", response.properties().packageApplications().get(0).appId()); + Assertions.assertEquals("lhupmomihzbdnpxp", response.properties().packageApplications().get(0).description()); + Assertions.assertEquals("dpr", response.properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("xelyicghflr", response.properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("ssjyghsfx", response.properties().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 index 02c2f932a4e5..592d3ffe8bf4 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,11 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.msixPackages().deleteWithResponse("bpqvybefg", "mx", "okcvtlubses", com.azure.core.util.Context.NONE); + manager.msixPackages() + .deleteWithResponse("tbgnixxowwzkyfw", "wpiwxeiicrmpep", "ldmaxxijvskwsdgk", + 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 index 6852d3632b63..3c1369c050eb 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; @@ -21,35 +21,35 @@ 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\"}"; + = "{\"properties\":{\"imagePath\":\"gmwdh\",\"packageName\":\"buvczldbglzoutb\",\"packageFamilyName\":\"qgz\",\"displayName\":\"ajclyzgsnorbjg\",\"packageRelativePath\":\"zjotvmrxkhlo\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"diqayfl\",\"publisher\":\"yu\",\"minVersion\":\"n\"}],\"version\":\"dtelvhyibdrqrs\",\"lastUpdated\":\"2021-04-08T14:47:37Z\",\"packageApplications\":[{\"appId\":\"pyrowtj\",\"description\":\"ztfwfqchvcz\",\"appUserModelID\":\"j\",\"friendlyName\":\"cta\",\"iconImageName\":\"yvrtp\"},{\"appId\":\"hzcgkrepdqhqyhwq\",\"description\":\"mvxqab\",\"appUserModelID\":\"mzeoxinhgre\",\"friendlyName\":\"twhlpuzjpce\",\"iconImageName\":\"nzangprbfaxy\"}]},\"id\":\"ciphmsexr\",\"name\":\"qrndktxfvon\",\"type\":\"eeqgpkri\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MsixPackage response = manager.msixPackages() - .getWithResponse("sewxigpxvkqm", "upxvpifd", "aifyzyzeyuubeids", com.azure.core.util.Context.NONE) + .getWithResponse("dvrgliegftcvbi", "ftksd", "gdnk", 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()); + Assertions.assertEquals("gmwdh", response.properties().imagePath()); + Assertions.assertEquals("buvczldbglzoutb", response.properties().packageName()); + Assertions.assertEquals("qgz", response.properties().packageFamilyName()); + Assertions.assertEquals("ajclyzgsnorbjg", response.properties().displayName()); + Assertions.assertEquals("zjotvmrxkhlo", response.properties().packageRelativePath()); + Assertions.assertFalse(response.properties().isRegularRegistration()); + Assertions.assertTrue(response.properties().isActive()); + Assertions.assertEquals("diqayfl", response.properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("yu", response.properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("n", response.properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("dtelvhyibdrqrs", response.properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T14:47:37Z"), response.properties().lastUpdated()); + Assertions.assertEquals("pyrowtj", response.properties().packageApplications().get(0).appId()); + Assertions.assertEquals("ztfwfqchvcz", response.properties().packageApplications().get(0).description()); + Assertions.assertEquals("j", response.properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("cta", response.properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("yvrtp", response.properties().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 index 0b01b7abf232..20366ca6443e 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; @@ -22,35 +22,42 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"imagePath\":\"yxqicladv\",\"packageName\":\"davuqmcbyms\",\"packageFamilyName\":\"bjlquv\",\"displayName\":\"zcjumvpsimioyoig\",\"packageRelativePath\":\"miqwnnrac\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"pkl\",\"publisher\":\"ydgnha\",\"minVersion\":\"wuk\"},{\"dependencyName\":\"zgpmnma\",\"publisher\":\"ddqil\",\"minVersion\":\"d\"},{\"dependencyName\":\"fqfp\",\"publisher\":\"stcl\",\"minVersion\":\"rvwerfwxbsmtb\"},{\"dependencyName\":\"jehhci\",\"publisher\":\"wdv\",\"minVersion\":\"brekqhsqhtf\"}],\"version\":\"pqbye\",\"lastUpdated\":\"2021-07-15T23:46:30Z\",\"packageApplications\":[{\"appId\":\"dqigmg\",\"description\":\"inztxl\",\"appUserModelID\":\"khnjcmrnkfm\",\"friendlyName\":\"cqtwmlmhjnqtq\",\"iconImageName\":\"hj\"},{\"appId\":\"agpokddxe\",\"description\":\"h\",\"appUserModelID\":\"guavtptb\",\"friendlyName\":\"wkqyns\",\"iconImageName\":\"bvoffb\"}]},\"id\":\"dxaexqokmyrljia\",\"name\":\"zbnobr\",\"type\":\"lpbcjtrpz\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.msixPackages() - .list("vcuartrhun", "pirykycndzfqiv", 1105579119, false, 1729042857, com.azure.core.util.Context.NONE); + .list("gyacwrasekwef", "voinwo", 221415592, false, 872769595, 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()); + Assertions.assertEquals("yxqicladv", response.iterator().next().properties().imagePath()); + Assertions.assertEquals("davuqmcbyms", response.iterator().next().properties().packageName()); + Assertions.assertEquals("bjlquv", response.iterator().next().properties().packageFamilyName()); + Assertions.assertEquals("zcjumvpsimioyoig", response.iterator().next().properties().displayName()); + Assertions.assertEquals("miqwnnrac", response.iterator().next().properties().packageRelativePath()); + Assertions.assertTrue(response.iterator().next().properties().isRegularRegistration()); + Assertions.assertTrue(response.iterator().next().properties().isActive()); + Assertions.assertEquals("pkl", + response.iterator().next().properties().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ydgnha", + response.iterator().next().properties().packageDependencies().get(0).publisher()); + Assertions.assertEquals("wuk", + response.iterator().next().properties().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("pqbye", response.iterator().next().properties().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T23:46:30Z"), + response.iterator().next().properties().lastUpdated()); + Assertions.assertEquals("dqigmg", response.iterator().next().properties().packageApplications().get(0).appId()); + Assertions.assertEquals("inztxl", + response.iterator().next().properties().packageApplications().get(0).description()); + Assertions.assertEquals("khnjcmrnkfm", + response.iterator().next().properties().packageApplications().get(0).appUserModelID()); + Assertions.assertEquals("cqtwmlmhjnqtq", + response.iterator().next().properties().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("hj", + response.iterator().next().properties().packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..81bb0ecfddb4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPatchPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class NetworkInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkInfoPatchProperties model + = BinaryData.fromString("{\"subnetId\":\"ri\",\"securityGroupId\":\"rsrrmoucsofldp\"}") + .toObject(NetworkInfoPatchProperties.class); + Assertions.assertEquals("ri", model.subnetId()); + Assertions.assertEquals("rsrrmoucsofldp", model.securityGroupId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInfoPatchProperties model + = new NetworkInfoPatchProperties().withSubnetId("ri").withSecurityGroupId("rsrrmoucsofldp"); + model = BinaryData.fromObject(model).toObject(NetworkInfoPatchProperties.class); + Assertions.assertEquals("ri", model.subnetId()); + Assertions.assertEquals("rsrrmoucsofldp", model.securityGroupId()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPropertiesTests.java new file mode 100644 index 000000000000..67818578fc10 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/NetworkInfoPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.NetworkInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class NetworkInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkInfoProperties model + = BinaryData.fromString("{\"subnetId\":\"aglqivbgkcvkh\",\"securityGroupId\":\"vuqd\"}") + .toObject(NetworkInfoProperties.class); + Assertions.assertEquals("aglqivbgkcvkh", model.subnetId()); + Assertions.assertEquals("vuqd", model.securityGroupId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkInfoProperties model + = new NetworkInfoProperties().withSubnetId("aglqivbgkcvkh").withSecurityGroupId("vuqd"); + model = BinaryData.fromObject(model).toObject(NetworkInfoProperties.class); + Assertions.assertEquals("aglqivbgkcvkh", model.subnetId()); + Assertions.assertEquals("vuqd", model.securityGroupId()); + } +} 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 index 42b9e462a2b2..9b68c6078756 100644 --- 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 @@ -1,37 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}}") + "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"xwczbyscnp\",\"displayName\":\"uhivyqniw\",\"blobDuration\":\"br\"},{\"name\":\"vd\",\"displayName\":\"jgrtfwvukxga\",\"blobDuration\":\"ccsnhsjc\"}]}}") .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()); + Assertions.assertEquals("xwczbyscnp", model.serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("uhivyqniw", model.serviceSpecification().logSpecifications().get(0).displayName()); + Assertions.assertEquals("br", 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 index 001b6e371fe5..ab95c701a00d 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperation; @@ -22,28 +22,28 @@ 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\"}]}}}]}"; + = "{\"value\":[{\"name\":\"mwamxqzragpgdph\",\"display\":{\"provider\":\"ulajvlejchc\",\"resource\":\"lzk\",\"operation\":\"zlanrupdwvnph\",\"description\":\"zqtpjhmq\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"wdcxsmlzzhz\",\"displayName\":\"xetlgydlhqv\",\"blobDuration\":\"npxybafiq\"},{\"name\":\"aarbgjekg\",\"displayName\":\"lbyulidwcwvmze\",\"blobDuration\":\"o\"},{\"name\":\"hj\",\"displayName\":\"wgdnqzbr\",\"blobDuration\":\"spzhzmtksjc\"},{\"name\":\"digsxcdgl\",\"displayName\":\"lkeuac\",\"blobDuration\":\"omflrytswfp\"}]}}}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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", + Assertions.assertEquals("mwamxqzragpgdph", response.iterator().next().name()); + Assertions.assertEquals("ulajvlejchc", response.iterator().next().display().provider()); + Assertions.assertEquals("lzk", response.iterator().next().display().resource()); + Assertions.assertEquals("zlanrupdwvnph", response.iterator().next().display().operation()); + Assertions.assertEquals("zqtpjhmq", response.iterator().next().display().description()); + Assertions.assertFalse(response.iterator().next().isDataAction()); + Assertions.assertEquals("wdcxsmlzzhz", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("yyurmochpprprsnm", + Assertions.assertEquals("xetlgydlhqv", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("ayzejnhlbkpbz", + Assertions.assertEquals("npxybafiq", 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 index ef5285ea6a91..574d6c0d0302 100644 --- 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 @@ -1,55 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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\"}") + "{\"value\":[{\"properties\":{\"groupIds\":[\"cvwmzhwplefa\",\"vxilcbt\",\"nhnzeyqxt\"],\"privateEndpoint\":{\"id\":\"zqlqhyc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ggxdb\",\"actionsRequired\":\"smieknlra\"},\"provisioningState\":\"Failed\"},\"id\":\"wiuagydwqf\",\"name\":\"ylyrfgiagtco\",\"type\":\"ocqwogfnzjvus\"},{\"properties\":{\"groupIds\":[\"mozuxylfsb\",\"kadpysown\"],\"privateEndpoint\":{\"id\":\"kb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"qctojcmisof\",\"actionsRequired\":\"ypefojyqdhcupl\"},\"provisioningState\":\"Deleting\"},\"id\":\"wkhihihlhzdsqt\",\"name\":\"bsrgnowc\",\"type\":\"hfgmvecactxm\"},{\"properties\":{\"groupIds\":[\"yowc\"],\"privateEndpoint\":{\"id\":\"ovekqvgqouwi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"j\",\"actionsRequired\":\"ivqikfxcvhr\"},\"provisioningState\":\"Failed\"},\"id\":\"uagrttikteusqc\",\"name\":\"kvyklxubyjaffmm\",\"type\":\"bl\"}],\"nextLink\":\"cuubgq\"}") .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()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.value().get(0).properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ggxdb", + model.value().get(0).properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("smieknlra", + model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("cuubgq", model.nextLink()); } } 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 index a4bfb68e6494..9c6150b2d850 100644 --- 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 @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; import org.junit.jupiter.api.Assertions; @@ -15,12 +15,12 @@ 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\"}") + "{\"groupIds\":[\"ndo\",\"ongbjcnt\",\"jitcjedftwwaez\"],\"privateEndpoint\":{\"id\":\"v\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"foqouicybx\",\"actionsRequired\":\"zg\"},\"provisioningState\":\"Creating\"}") .toObject(PrivateEndpointConnectionProperties.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("txilnerkujy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("l", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("foqouicybx", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zg", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -29,12 +29,12 @@ public void testSerialize() throws Exception { = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("txilnerkujy") - .withActionsRequired("l")); + .withDescription("foqouicybx") + .withActionsRequired("zg")); 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()); + Assertions.assertEquals("foqouicybx", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zg", 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 index 2eee6ba260fe..90ba3e534579 100644 --- 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 @@ -1,39 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"properties\":{\"groupIds\":[\"xqtvcofu\",\"f\",\"vkg\"],\"privateEndpoint\":{\"id\":\"gdknnqv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qntorudsgsahmkyc\",\"actionsRequired\":\"auwjuetaebu\"},\"provisioningState\":\"Failed\"},\"id\":\"movsmzlxwabmqoe\",\"name\":\"kif\",\"type\":\"vtpuqujmqlgk\"}") .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()); + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qntorudsgsahmkyc", + model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("auwjuetaebu", + model.properties().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 index 4d36dd55ab74..05df6fbc6bfa 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; import org.junit.jupiter.api.Assertions; @@ -15,26 +16,27 @@ 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\"}") + "{\"properties\":{\"groupIds\":[\"suxmpraf\",\"g\",\"khocxvdfffwaf\",\"roud\"],\"privateEndpoint\":{\"id\":\"avehhrvkbunzo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"cxgkmoyxcdyui\",\"actionsRequired\":\"mfdn\"},\"provisioningState\":\"Deleting\"},\"id\":\"vfvfcj\",\"name\":\"aeoisrvh\",\"type\":\"gorf\"}") .toObject(PrivateEndpointConnectionWithSystemDataInner.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tqgtzxdpnqbqq", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rjfeallnwsubisnj", model.privateLinkServiceConnectionState().actionsRequired()); + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("cxgkmoyxcdyui", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mfdn", model.properties().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")); + = new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("cxgkmoyxcdyui") + .withActionsRequired("mfdn"))); 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()); + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("cxgkmoyxcdyui", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mfdn", model.properties().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 index f879829e8d2c..ab3082ecc890 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testDeleteByHostPoolWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.privateEndpointConnections() - .deleteByHostPoolWithResponse("rd", "jxtxrdc", "tjvidt", com.azure.core.util.Context.NONE); + .deleteByHostPoolWithResponse("niiwllbvgwz", "fftedousnktj", "gravaqogfkbebauz", + 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 index f0d75299c480..b58a53f30fee 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteByWorkspaceWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.privateEndpointConnections() - .deleteByWorkspaceWithResponse("jfrnxousxauzlwv", "gmwohqfzizvu", "mmkjsvthnwpztek", + .deleteByWorkspaceWithResponse("tuadxkxeqb", "pntghyks", "rcdrnxsluvlzlad", 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 index b19423c68649..f561be7c744e 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; @@ -22,22 +22,24 @@ 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\"}"; + = "{\"properties\":{\"groupIds\":[\"tiochlutixmqr\",\"djizcbf\",\"mcrunfhiucn\"],\"privateEndpoint\":{\"id\":\"cpaqkt\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"zuedkyzbfvxovqk\",\"actionsRequired\":\"uxqggvqrnhyhl\"},\"provisioningState\":\"Succeeded\"},\"id\":\"qggjhf\",\"name\":\"bxrqrkijp\",\"type\":\"uqlsdx\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .getByHostPoolWithResponse("obkauxofsh", "phwpnulaiywzej", "whslwkoj", com.azure.core.util.Context.NONE) + .getByHostPoolWithResponse("asvvoqsbpkfl", "nfkgxsyaowuzowpu", "hdkcprgu", 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()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("zuedkyzbfvxovqk", + response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("uxqggvqrnhyhl", + response.properties().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 index 5fbabe2c92c4..389749bb1382 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; @@ -22,22 +22,24 @@ 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\"}"; + = "{\"properties\":{\"groupIds\":[\"qtwloes\",\"rg\",\"vrbnyrukoil\",\"ciduwjle\"],\"privateEndpoint\":{\"id\":\"lh\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"zr\",\"actionsRequired\":\"ythqkkwhbgxvel\"},\"provisioningState\":\"Deleting\"},\"id\":\"nxdmnitmujdtv\",\"name\":\"clyymffhmjpddn\",\"type\":\"xfzuvrzmzqmzj\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .getByWorkspaceWithResponse("idibgqjxgpn", "hgovfgp", "kqmhhaowjr", com.azure.core.util.Context.NONE) + .getByWorkspaceWithResponse("gcwvrrmdqntycna", "thvmaxgnuyeamcmh", "dfjeceho", + 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()); + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("zr", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("ythqkkwhbgxvel", + response.properties().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 index ec5fb43f2dab..79028d18a97f 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; @@ -23,23 +23,23 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"groupIds\":[\"boy\",\"hczzqrhm\",\"gqbedygi\",\"rzwnyk\"],\"privateEndpoint\":{\"id\":\"jch\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"wctofldseacdhz\",\"actionsRequired\":\"kbrfgdrwji\"},\"provisioningState\":\"Deleting\"},\"id\":\"fj\",\"name\":\"rwq\",\"type\":\"xet\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.privateEndpointConnections() - .listByHostPool("yefchnm", "ahmnxhkxjqirw", 1600818034, true, 1057526816, com.azure.core.util.Context.NONE); + .listByHostPool("qbtxxwpf", "njzudr", 914787002, false, 1320591219, 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()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + response.iterator().next().properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("wctofldseacdhz", + response.iterator().next().properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("kbrfgdrwji", + response.iterator().next().properties().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 index 12963cd716e2..032a244d16cf 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; @@ -23,23 +23,23 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"groupIds\":[\"zdanojis\",\"glmvoka\",\"uztjct\",\"bpvbkaehxsmzygd\"],\"privateEndpoint\":{\"id\":\"kwseivmakxhyso\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"x\",\"actionsRequired\":\"bectvtfjmskdch\"},\"provisioningState\":\"Deleting\"},\"id\":\"bavlzwpvgmfalkz\",\"name\":\"zmgokedgjqafk\",\"type\":\"krokzrthqetwpqrt\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.privateEndpointConnections() - .listByWorkspace("tmaaj", "uhuxylrjvmtyg", com.azure.core.util.Context.NONE); + .listByWorkspace("t", "kpbqhvfdqqjw", 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()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + response.iterator().next().properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("x", + response.iterator().next().properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("bectvtfjmskdch", + response.iterator().next().properties().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 index 563c02798971..e6b78c31ee96 100644 --- 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -25,28 +26,29 @@ public final class PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTes @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\"}"; + = "{\"properties\":{\"groupIds\":[\"o\",\"e\",\"wjcciklhsy\"],\"privateEndpoint\":{\"id\":\"drenxol\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"h\",\"actionsRequired\":\"eivdlhy\"},\"provisioningState\":\"Creating\"},\"id\":\"bfgrlpunytjlkes\",\"name\":\"mpathubtah\",\"type\":\"e\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .updateByHostPoolWithResponse("gepuslvyjtc", "uwkasiz", "esfuught", - new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("wpusxjbaqehg") - .withActionsRequired("ohzjqatucoigeb")), + .updateByHostPoolWithResponse("qztvx", "mwwmjswenaww", "me", + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("vjrktpgaeukyawoh") + .withActionsRequired("w"))), 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()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("h", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("eivdlhy", response.properties().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 index 66d1ac02f362..da8bc7deeec6 100644 --- 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; @@ -25,28 +26,29 @@ public final class PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTe @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\"}"; + = "{\"properties\":{\"groupIds\":[\"tzgixgyrihlgmgb\",\"hlqtxnrflkn\",\"rndpgfjodhdaqotw\",\"hipx\"],\"privateEndpoint\":{\"id\":\"abvcipowzaf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"mlj\",\"actionsRequired\":\"rvpe\"},\"provisioningState\":\"Deleting\"},\"id\":\"veitit\",\"name\":\"nsxzajlns\",\"type\":\"hwjuyxxbxqvmvua\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() - .updateByWorkspaceWithResponse("vmribiat", "gplucfotangcfhny", "zcugswvxwlmzqw", - new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("n") - .withActionsRequired("oxgjiuqhibt")), + .updateByWorkspaceWithResponse("rb", "pv", "mdyfoebojtj", + new PrivateEndpointConnectionWithSystemDataInner() + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("dqaolfylnkk") + .withActionsRequired("pjvlywltmfwo"))), 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()); + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("mlj", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("rvpe", response.properties().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 index f44d340657d3..afcbb9c14fc8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"fqawrlyxw\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"oxciqopidoamcio\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test 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 index a8541d2bb058..703ec5aeadb5 100644 --- 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 @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"properties\":{\"groupId\":\"i\",\"requiredMembers\":[\"pdtii\",\"q\",\"d\",\"oaxoruzfgsqu\"],\"requiredZoneNames\":[\"rxxle\",\"tramxjez\"]},\"id\":\"wnwxuqlcvyd\",\"name\":\"patdooaojkniodko\",\"type\":\"ebwnujhe\"}") .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)); + Assertions.assertEquals("rxxle", model.properties().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 index fdec7536bad6..b96277b6b4ec 100644 --- 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 @@ -1,29 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.PrivateLinkResourceListResult; 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\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"aanozjosphyoulpj\",\"requiredMembers\":[\"ag\"],\"requiredZoneNames\":[\"imjwosyt\",\"itc\"]},\"id\":\"fcktqumiekke\",\"name\":\"zikhl\",\"type\":\"fjhdg\"},{\"properties\":{\"groupId\":\"ebdunyg\",\"requiredMembers\":[\"idb\",\"fatpxllrxcyjmoa\",\"su\",\"arm\"],\"requiredZoneNames\":[\"mjsjqb\",\"hhyxxrw\"]},\"id\":\"co\",\"name\":\"uhpkxkgymar\",\"type\":\"qnajxqugj\"},{\"properties\":{\"groupId\":\"cubeddgssofw\",\"requiredMembers\":[\"qal\",\"rmnjijpx\",\"cqqudf\",\"byxbaaabjy\"],\"requiredZoneNames\":[\"ffimrzrtuzqogsex\",\"evfdnwnwm\",\"wzsyyceuzs\",\"i\"]},\"id\":\"ud\",\"name\":\"frxtrthzvaytdwk\",\"type\":\"brqubp\"}],\"nextLink\":\"h\"}") .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)); + Assertions.assertEquals("imjwosyt", model.value().get(0).properties().requiredZoneNames().get(0)); + Assertions.assertEquals("h", model.nextLink()); } } 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 index ac6b562a8b52..f84df15111b0 100644 --- 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 @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceProperties; 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\"]}") + "{\"groupId\":\"sbvdkcrodtjinfw\",\"requiredMembers\":[\"lt\",\"acjvefkd\"],\"requiredZoneNames\":[\"akggkfpag\",\"owpulpq\",\"lyls\"]}") .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)); + Assertions.assertEquals("akggkfpag", 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 index d83f1916e859..eeaf3f5342ad 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; @@ -22,18 +22,18 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"us\",\"requiredMembers\":[\"pkupnq\",\"mgjfbpkuwxeoio\",\"fiz\"],\"requiredZoneNames\":[\"kjzwfbcyayk\",\"mfzsbf\",\"xrzxmdewsrsxkrp\",\"bjazejwwviy\"]},\"id\":\"ps\",\"name\":\"hbrnnhjx\",\"type\":\"qwjhqkbiwetpozyc\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.privateLinkResources() - .listByHostPool("ji", "xfz", 9701584, false, 2008272584, com.azure.core.util.Context.NONE); + .listByHostPool("bkjbz", "ensvkzykjtj", 1399130585, true, 1535678701, com.azure.core.util.Context.NONE); - Assertions.assertEquals("jqi", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("kjzwfbcyayk", response.iterator().next().properties().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 index cef455daf9f8..7817fe496f30 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; @@ -22,18 +22,19 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"kkdtnhqsy\",\"requiredMembers\":[\"selpkpbaf\",\"afhlbyl\",\"cbevxrhyzdfw\",\"sofpltd\"],\"requiredZoneNames\":[\"irrhv\",\"fnrac\",\"npq\",\"g\"]},\"id\":\"ujwouhdawsi\",\"name\":\"rb\",\"type\":\"bxsjybvitvqkj\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.privateLinkResources() - .listByWorkspace("gdirazf", "xejw", 1368771016, true, 492529805, com.azure.core.util.Context.NONE); + .listByWorkspace("qiqyhgfsetzlexbs", "ledynojpz", 1537365328, false, 1263064497, + com.azure.core.util.Context.NONE); - Assertions.assertEquals("buhhlkyqlt", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("irrhv", response.iterator().next().properties().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 index c92ebf73e3d6..1d408a9d2d82 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -13,22 +13,22 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Rejected\",\"description\":\"rbnwbxgjvtbvpy\",\"actionsRequired\":\"zdn\"}") + .fromString("{\"status\":\"Approved\",\"description\":\"azxkhnzbonlwnto\",\"actionsRequired\":\"okdwb\"}") .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("azxkhnzbonlwnto", model.description()); + Assertions.assertEquals("okdwb", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("rbnwbxgjvtbvpy") - .withActionsRequired("zdn"); + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("azxkhnzbonlwnto") + .withActionsRequired("okdwb"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("azxkhnzbonlwnto", model.description()); + Assertions.assertEquals("okdwb", 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 index 38235be40fa0..831a7cd4939e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,25 +11,12 @@ 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\"}") + ResourceProviderOperationDisplay model = BinaryData + .fromString("{\"provider\":\"bj\",\"resource\":\"a\",\"operation\":\"th\",\"description\":\"hab\"}") .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()); + Assertions.assertEquals("bj", model.provider()); + Assertions.assertEquals("a", model.resource()); + Assertions.assertEquals("th", model.operation()); + Assertions.assertEquals("hab", 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 index ae983468e237..ff83bd400f9b 100644 --- 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 @@ -1,62 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}}}") + "{\"name\":\"mpoyfd\",\"display\":{\"provider\":\"gknygjofjddeqs\",\"resource\":\"eupewnwreitjz\",\"operation\":\"lusarh\",\"description\":\"fcqhsmyurkd\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"k\",\"displayName\":\"txukcdmp\",\"blobDuration\":\"cryuan\"},{\"name\":\"uxzdxtay\",\"displayName\":\"hmwhfpmrqo\",\"blobDuration\":\"tu\"},{\"name\":\"nryrtihf\",\"displayName\":\"ijbpzvgnwzsymgl\",\"blobDuration\":\"fcyzkohdbihanufh\"}]}}}") .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", + Assertions.assertEquals("mpoyfd", model.name()); + Assertions.assertEquals("gknygjofjddeqs", model.display().provider()); + Assertions.assertEquals("eupewnwreitjz", model.display().resource()); + Assertions.assertEquals("lusarh", model.display().operation()); + Assertions.assertEquals("fcqhsmyurkd", model.display().description()); + Assertions.assertFalse(model.isDataAction()); + Assertions.assertEquals("k", model.properties().serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("txukcdmp", 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", + Assertions.assertEquals("cryuan", model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListResultTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListResultTests.java new file mode 100644 index 000000000000..215bb27a383c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.ResourceProviderOperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class ResourceProviderOperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProviderOperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"display\":{\"provider\":\"jxpybczmeh\",\"resource\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"description\":\"hdxbmtqio\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"ufpo\",\"display\":{\"provider\":\"izhwlrxy\",\"resource\":\"soqijg\",\"operation\":\"mbpazlobcufpdzn\",\"description\":\"t\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"hqgnufooojywif\",\"display\":{\"provider\":\"saagdf\",\"resource\":\"lzl\",\"operation\":\"xrifkwmrvkts\",\"description\":\"nt\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}}],\"nextLink\":\"jpsq\"}") + .toObject(ResourceProviderOperationListResult.class); + Assertions.assertEquals("hq", model.value().get(0).name()); + Assertions.assertEquals("jxpybczmeh", model.value().get(0).display().provider()); + Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().resource()); + Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().operation()); + Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().description()); + Assertions.assertFalse(model.value().get(0).isDataAction()); + Assertions.assertEquals("jpsq", model.nextLink()); + } +} 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 index 7d4bb22d5efd..a02716e6cbae 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,18 +12,18 @@ public final class ScalingHostPoolReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScalingHostPoolReference model - = BinaryData.fromString("{\"hostPoolArmPath\":\"czfc\",\"scalingPlanEnabled\":true}") + = BinaryData.fromString("{\"hostPoolArmPath\":\"kfwynw\",\"scalingPlanEnabled\":true}") .toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("czfc", model.hostPoolArmPath()); - Assertions.assertEquals(true, model.scalingPlanEnabled()); + Assertions.assertEquals("kfwynw", model.hostPoolArmPath()); + Assertions.assertTrue(model.scalingPlanEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ScalingHostPoolReference model - = new ScalingHostPoolReference().withHostPoolArmPath("czfc").withScalingPlanEnabled(true); + = new ScalingHostPoolReference().withHostPoolArmPath("kfwynw").withScalingPlanEnabled(true); model = BinaryData.fromObject(model).toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("czfc", model.hostPoolArmPath()); - Assertions.assertEquals(true, model.scalingPlanEnabled()); + Assertions.assertEquals("kfwynw", model.hostPoolArmPath()); + Assertions.assertTrue(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 index 4e8691094a43..bd9b5e63a07a 100644 --- 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 @@ -1,14 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatchProperties; 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; @@ -19,144 +21,167 @@ 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}]}") + "{\"description\":\"wjygvjayvblmhvk\",\"friendlyName\":\"hbxvvyhgsopbyrqu\",\"timeZone\":\"g\",\"exclusionTag\":\"vwz\",\"schedules\":[{\"name\":\"lmctlpd\",\"daysOfWeek\":[\"Friday\",\"Thursday\",\"Thursday\",\"Wednesday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":731430664,\"rampUpMinimumHostPoolSize\":479082652,\"rampDownMaximumHostPoolSize\":1918183021,\"rampDownMinimumHostPoolSize\":1594893264},\"rampUpStartTime\":{\"hour\":2074654020,\"minute\":568576807},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1196101983,\"rampUpCapacityThresholdPct\":662218702,\"peakStartTime\":{\"hour\":1396422146,\"minute\":1437302517},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1544026895,\"minute\":963603452},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1956561787,\"rampDownCapacityThresholdPct\":1155534980,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1191628211,\"rampDownNotificationMessage\":\"vqahqkghtpwi\",\"offPeakStartTime\":{\"hour\":205565987,\"minute\":1695369378},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"f\",\"daysOfWeek\":[\"Friday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":1638099636,\"rampUpMinimumHostPoolSize\":1432039149,\"rampDownMaximumHostPoolSize\":12517918,\"rampDownMinimumHostPoolSize\":64762748},\"rampUpStartTime\":{\"hour\":1542323889,\"minute\":312657559},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1846844477,\"rampUpCapacityThresholdPct\":768184156,\"peakStartTime\":{\"hour\":465000674,\"minute\":666805077},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":856785773,\"minute\":2072620851},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1358743575,\"rampDownCapacityThresholdPct\":1260829297,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1488259864,\"rampDownNotificationMessage\":\"rrjreafxtsgu\",\"offPeakStartTime\":{\"hour\":1263462710,\"minute\":1019109775},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"kxw\",\"daysOfWeek\":[\"Thursday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":878184103,\"rampUpMinimumHostPoolSize\":613388775,\"rampDownMaximumHostPoolSize\":1725196825,\"rampDownMinimumHostPoolSize\":1023850423},\"rampUpStartTime\":{\"hour\":1613313334,\"minute\":1732171023},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1170728394,\"rampUpCapacityThresholdPct\":556961865,\"peakStartTime\":{\"hour\":763625934,\"minute\":1811629321},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":879908926,\"minute\":282428927},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1406843727,\"rampDownCapacityThresholdPct\":76074858,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1312335759,\"rampDownNotificationMessage\":\"saz\",\"offPeakStartTime\":{\"hour\":552544194,\"minute\":1268634918},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"hsxttaugzxnf\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"xdtnkdmkqjjlw\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"rkpyouaibrebqaay\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"xqtnq\",\"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("wjygvjayvblmhvk", model.description()); + Assertions.assertEquals("hbxvvyhgsopbyrqu", model.friendlyName()); + Assertions.assertEquals("g", model.timeZone()); + Assertions.assertEquals("vwz", model.exclusionTag()); + Assertions.assertEquals("lmctlpd", model.schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.schedules().get(0).scalingMethod()); + Assertions.assertEquals(731430664, model.schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(479082652, model.schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1918183021, model.schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1594893264, model.schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(2074654020, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(568576807, model.schedules().get(0).rampUpStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1196101983, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(662218702, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1396422146, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1437302517, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_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(1544026895, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(963603452, 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(1956561787, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1155534980, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertTrue(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, + Assertions.assertEquals(1191628211, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("vqahqkghtpwi", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(205565987, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1695369378, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("yrxvwfudwpznt", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals("hsxttaugzxnf", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertFalse(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") + = new ScalingPlanPatchProperties().withDescription("wjygvjayvblmhvk") + .withFriendlyName("hbxvvyhgsopbyrqu") + .withTimeZone("g") + .withExclusionTag("vwz") .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)) + new ScalingSchedule().withName("lmctlpd") + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.THURSDAY, DayOfWeek.THURSDAY, + DayOfWeek.WEDNESDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(731430664) + .withRampUpMinimumHostPoolSize(479082652) + .withRampDownMaximumHostPoolSize(1918183021) + .withRampDownMinimumHostPoolSize(1594893264)) + .withRampUpStartTime(new Time().withHour(2074654020).withMinute(568576807)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(1196101983) + .withRampUpCapacityThresholdPct(662218702) + .withPeakStartTime(new Time().withHour(1396422146).withMinute(1437302517)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1544026895).withMinute(963603452)) .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1677238877) - .withRampDownCapacityThresholdPct(1210562441) - .withRampDownForceLogoffUsers(false) + .withRampDownMinimumHostsPct(1956561787) + .withRampDownCapacityThresholdPct(1155534980) + .withRampDownForceLogoffUsers(true) .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)) + .withRampDownWaitTimeMinutes(1191628211) + .withRampDownNotificationMessage("vqahqkghtpwi") + .withOffPeakStartTime(new Time().withHour(205565987).withMinute(1695369378)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), + new ScalingSchedule().withName("f") + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1638099636) + .withRampUpMinimumHostPoolSize(1432039149) + .withRampDownMaximumHostPoolSize(12517918) + .withRampDownMinimumHostPoolSize(64762748)) + .withRampUpStartTime(new Time().withHour(1542323889).withMinute(312657559)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(197964626) - .withRampUpCapacityThresholdPct(1452176185) - .withPeakStartTime(new Time().withHour(949474495).withMinute(95653514)) + .withRampUpMinimumHostsPct(1846844477) + .withRampUpCapacityThresholdPct(768184156) + .withPeakStartTime(new Time().withHour(465000674).withMinute(666805077)) .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(657781919).withMinute(1907592616)) + .withRampDownStartTime(new Time().withHour(856785773).withMinute(2072620851)) .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1501927720) - .withRampDownCapacityThresholdPct(1284749235) - .withRampDownForceLogoffUsers(false) + .withRampDownMinimumHostsPct(1358743575) + .withRampDownCapacityThresholdPct(1260829297) + .withRampDownForceLogoffUsers(true) .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)) + .withRampDownWaitTimeMinutes(1488259864) + .withRampDownNotificationMessage("rrjreafxtsgu") + .withOffPeakStartTime(new Time().withHour(1263462710).withMinute(1019109775)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), + new ScalingSchedule().withName("kxw") + .withDaysOfWeek(Arrays.asList(DayOfWeek.THURSDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(878184103) + .withRampUpMinimumHostPoolSize(613388775) + .withRampDownMaximumHostPoolSize(1725196825) + .withRampDownMinimumHostPoolSize(1023850423)) + .withRampUpStartTime(new Time().withHour(1613313334).withMinute(1732171023)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1170728394) + .withRampUpCapacityThresholdPct(556961865) + .withPeakStartTime(new Time().withHour(763625934).withMinute(1811629321)) .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(224913714).withMinute(1039812081)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(640895390) - .withRampDownCapacityThresholdPct(1148622887) + .withRampDownStartTime(new Time().withHour(879908926).withMinute(282428927)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1406843727) + .withRampDownCapacityThresholdPct(76074858) .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(991595077) - .withRampDownNotificationMessage("laocqxtccmg") - .withOffPeakStartTime(new Time().withHour(1054992005).withMinute(435564330)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1312335759) + .withRampDownNotificationMessage("saz") + .withOffPeakStartTime(new Time().withHour(552544194).withMinute(1268634918)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_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))); + new ScalingHostPoolReference().withHostPoolArmPath("hsxttaugzxnf").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("xdtnkdmkqjjlw").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("rkpyouaibrebqaay").withScalingPlanEnabled(true), + new ScalingHostPoolReference().withHostPoolArmPath("xqtnq").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("wjygvjayvblmhvk", model.description()); + Assertions.assertEquals("hbxvvyhgsopbyrqu", model.friendlyName()); + Assertions.assertEquals("g", model.timeZone()); + Assertions.assertEquals("vwz", model.exclusionTag()); + Assertions.assertEquals("lmctlpd", model.schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.schedules().get(0).scalingMethod()); + Assertions.assertEquals(731430664, model.schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(479082652, model.schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1918183021, model.schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1594893264, model.schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(2074654020, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(568576807, model.schedules().get(0).rampUpStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1196101983, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(662218702, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1396422146, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1437302517, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_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(1544026895, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(963603452, 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(1956561787, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1155534980, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertTrue(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, + Assertions.assertEquals(1191628211, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("vqahqkghtpwi", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(205565987, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1695369378, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("yrxvwfudwpznt", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals("hsxttaugzxnf", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertFalse(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 index db1c27937cb0..f45e41c922c8 100644 --- 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 @@ -1,14 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; 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.ScalingScheduleDaysOfWeekItem; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -21,108 +24,158 @@ 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}]}}") + "{\"tags\":{\"tnvyqiatkzwp\":\"kayh\"},\"properties\":{\"description\":\"wzcjaesgvvsccy\",\"friendlyName\":\"g\",\"timeZone\":\"fhwygzlvdnkfxus\",\"exclusionTag\":\"dwzrmuh\",\"schedules\":[{\"name\":\"qdpsqxqvpsvu\",\"daysOfWeek\":[\"Thursday\",\"Tuesday\",\"Friday\",\"Wednesday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":62275538,\"rampUpMinimumHostPoolSize\":1608299260,\"rampDownMaximumHostPoolSize\":69464261,\"rampDownMinimumHostPoolSize\":643673289},\"rampUpStartTime\":{\"hour\":1526160673,\"minute\":2012599449},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1007513685,\"rampUpCapacityThresholdPct\":835251373,\"peakStartTime\":{\"hour\":137094818,\"minute\":359384916},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1642208339,\"minute\":1055442764},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1041237961,\"rampDownCapacityThresholdPct\":615107136,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":2049440725,\"rampDownNotificationMessage\":\"kbwcc\",\"offPeakStartTime\":{\"hour\":942350763,\"minute\":1094493551},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"xlpqekftnkhtjsy\",\"daysOfWeek\":[\"Monday\",\"Sunday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":231439885,\"rampUpMinimumHostPoolSize\":1405342126,\"rampDownMaximumHostPoolSize\":866000446,\"rampDownMinimumHostPoolSize\":1983654874},\"rampUpStartTime\":{\"hour\":813771165,\"minute\":1700439966},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1506382079,\"rampUpCapacityThresholdPct\":1300301532,\"peakStartTime\":{\"hour\":35154388,\"minute\":968299480},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1291517950,\"minute\":1172155827},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":421118351,\"rampDownCapacityThresholdPct\":524454595,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1271536570,\"rampDownNotificationMessage\":\"aatjinrvgoupmfi\",\"offPeakStartTime\":{\"hour\":327362442,\"minute\":121941130},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"lvrwxkvtkk\",\"scalingPlanEnabled\":true}]}}") .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("kayh", model.tags().get("tnvyqiatkzwp")); + Assertions.assertEquals("wzcjaesgvvsccy", model.properties().description()); + Assertions.assertEquals("g", model.properties().friendlyName()); + Assertions.assertEquals("fhwygzlvdnkfxus", model.properties().timeZone()); + Assertions.assertEquals("dwzrmuh", model.properties().exclusionTag()); + Assertions.assertEquals("qdpsqxqvpsvu", model.properties().schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.THURSDAY, model.properties().schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, + model.properties().schedules().get(0).scalingMethod()); + Assertions.assertEquals(62275538, + model.properties().schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1608299260, + model.properties().schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(69464261, + model.properties().schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(643673289, + model.properties().schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1526160673, model.properties().schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(2012599449, model.properties().schedules().get(0).rampUpStartTime().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()); + model.properties().schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1007513685, model.properties().schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(835251373, model.properties().schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(137094818, model.properties().schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(359384916, model.properties().schedules().get(0).peakStartTime().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()); + model.properties().schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1642208339, model.properties().schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1055442764, model.properties().schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1041237961, model.properties().schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(615107136, model.properties().schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, + model.properties().schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(2049440725, model.properties().schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("kbwcc", model.properties().schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(942350763, model.properties().schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1094493551, model.properties().schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("lvrwxkvtkk", model.properties().hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertTrue(model.properties().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))); + ScalingPlanPatch model + = new ScalingPlanPatch().withTags(mapOf("tnvyqiatkzwp", "kayh")) + .withProperties(new ScalingPlanPatchProperties().withDescription("wzcjaesgvvsccy") + .withFriendlyName("g") + .withTimeZone("fhwygzlvdnkfxus") + .withExclusionTag("dwzrmuh") + .withSchedules(Arrays.asList( + new ScalingSchedule().withName("qdpsqxqvpsvu") + .withDaysOfWeek(Arrays + .asList(DayOfWeek.THURSDAY, DayOfWeek.TUESDAY, DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(62275538) + .withRampUpMinimumHostPoolSize(1608299260) + .withRampDownMaximumHostPoolSize(69464261) + .withRampDownMinimumHostPoolSize(643673289)) + .withRampUpStartTime(new Time().withHour(1526160673).withMinute(2012599449)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(1007513685) + .withRampUpCapacityThresholdPct(835251373) + .withPeakStartTime(new Time().withHour(137094818).withMinute(359384916)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1642208339).withMinute(1055442764)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1041237961) + .withRampDownCapacityThresholdPct(615107136) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(2049440725) + .withRampDownNotificationMessage("kbwcc") + .withOffPeakStartTime(new Time().withHour(942350763).withMinute(1094493551)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), + new ScalingSchedule().withName("xlpqekftnkhtjsy") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.SUNDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(231439885) + .withRampUpMinimumHostPoolSize(1405342126) + .withRampDownMaximumHostPoolSize(866000446) + .withRampDownMinimumHostPoolSize(1983654874)) + .withRampUpStartTime(new Time().withHour(813771165).withMinute(1700439966)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1506382079) + .withRampUpCapacityThresholdPct(1300301532) + .withPeakStartTime(new Time().withHour(35154388).withMinute(968299480)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1291517950).withMinute(1172155827)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(421118351) + .withRampDownCapacityThresholdPct(524454595) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1271536570) + .withRampDownNotificationMessage("aatjinrvgoupmfi") + .withOffPeakStartTime(new Time().withHour(327362442).withMinute(121941130)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences( + Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath("lvrwxkvtkk") + .withScalingPlanEnabled(true)))); 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("kayh", model.tags().get("tnvyqiatkzwp")); + Assertions.assertEquals("wzcjaesgvvsccy", model.properties().description()); + Assertions.assertEquals("g", model.properties().friendlyName()); + Assertions.assertEquals("fhwygzlvdnkfxus", model.properties().timeZone()); + Assertions.assertEquals("dwzrmuh", model.properties().exclusionTag()); + Assertions.assertEquals("qdpsqxqvpsvu", model.properties().schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.THURSDAY, model.properties().schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, + model.properties().schedules().get(0).scalingMethod()); + Assertions.assertEquals(62275538, + model.properties().schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1608299260, + model.properties().schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(69464261, + model.properties().schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(643673289, + model.properties().schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1526160673, model.properties().schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(2012599449, model.properties().schedules().get(0).rampUpStartTime().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()); + model.properties().schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1007513685, model.properties().schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(835251373, model.properties().schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(137094818, model.properties().schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(359384916, model.properties().schedules().get(0).peakStartTime().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()); + model.properties().schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1642208339, model.properties().schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1055442764, model.properties().schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1041237961, model.properties().schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(615107136, model.properties().schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, + model.properties().schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(2049440725, model.properties().schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("kbwcc", model.properties().schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(942350763, model.properties().schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1094493551, model.properties().schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("lvrwxkvtkk", model.properties().hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertTrue(model.properties().hostPoolReferences().get(0).scalingPlanEnabled()); } // Use "Map.of" if available 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 index 1a3cc7991d95..967f81642170 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ScalingPlanPersonalScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -18,100 +19,100 @@ 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\"}") + "{\"properties\":{\"daysOfWeek\":[\"Sunday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":854421843,\"minute\":449157844},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":460830566,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":747956494,\"peakStartTime\":{\"hour\":930197061,\"minute\":1692920118},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":1884161573,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":1646368480,\"rampDownStartTime\":{\"hour\":647971020,\"minute\":1349515280},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":746585661,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1996681475,\"offPeakStartTime\":{\"hour\":731707521,\"minute\":1473376981},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":373003713,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1062514292},\"id\":\"xebeybpmz\",\"name\":\"nrtffyaqi\",\"type\":\"mhh\"}") .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()); + Assertions.assertEquals(DayOfWeek.SUNDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(854421843, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(449157844, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(460830566, model.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(747956494, model.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(930197061, model.properties().peakStartTime().hour()); + Assertions.assertEquals(1692920118, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().peakActionOnDisconnect()); + Assertions.assertEquals(1884161573, model.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().peakActionOnLogoff()); + Assertions.assertEquals(1646368480, model.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(647971020, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1349515280, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(746585661, model.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1996681475, model.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(731707521, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1473376981, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(373003713, model.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1062514292, model.properties().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); + ScalingPlanPersonalScheduleInner model + = new ScalingPlanPersonalScheduleInner().withProperties(new ScalingPlanPersonalScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.SATURDAY)) + .withRampUpStartTime(new Time().withHour(854421843).withMinute(449157844)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnDisconnect(460830566) + .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnLogoff(747956494) + .withPeakStartTime(new Time().withHour(930197061).withMinute(1692920118)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnDisconnect(1884161573) + .withPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnLogoff(1646368480) + .withRampDownStartTime(new Time().withHour(647971020).withMinute(1349515280)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnDisconnect(746585661) + .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnLogoff(1996681475) + .withOffPeakStartTime(new Time().withHour(731707521).withMinute(1473376981)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnDisconnect(373003713) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(1062514292)); 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()); + Assertions.assertEquals(DayOfWeek.SUNDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(854421843, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(449157844, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(460830566, model.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(747956494, model.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(930197061, model.properties().peakStartTime().hour()); + Assertions.assertEquals(1692920118, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().peakActionOnDisconnect()); + Assertions.assertEquals(1884161573, model.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().peakActionOnLogoff()); + Assertions.assertEquals(1646368480, model.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(647971020, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1349515280, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(746585661, model.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1996681475, model.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(731707521, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1473376981, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(373003713, model.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1062514292, model.properties().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 index 5cc176cd65d4..47f4127764da 100644 --- 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 @@ -1,176 +1,64 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.ScalingPlanPersonalScheduleList; 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\"}") + "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Friday\"],\"rampUpStartTime\":{\"hour\":1941131866,\"minute\":36862007},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1577867001,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":347039984,\"peakStartTime\":{\"hour\":904194330,\"minute\":179339083},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":149120205,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":1240461141,\"rampDownStartTime\":{\"hour\":515034915,\"minute\":432756215},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":1186991439,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":77592298,\"offPeakStartTime\":{\"hour\":96639942,\"minute\":82172099},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":1131661980,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":447073477},\"id\":\"fhfovv\",\"name\":\"cqpbtuo\",\"type\":\"xesz\"},{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Wednesday\",\"Monday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":2077442108,\"minute\":308639473},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":602871579,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":901428916,\"peakStartTime\":{\"hour\":161625264,\"minute\":2074554756},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":1173468754,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":940647846,\"rampDownStartTime\":{\"hour\":757428408,\"minute\":455828488},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":643812278,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":382004958,\"offPeakStartTime\":{\"hour\":1702145471,\"minute\":502695723},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":555944790,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1477203796},\"id\":\"zsrzpgepq\",\"name\":\"yb\",\"type\":\"wwpgdakchzyvlixq\"}],\"nextLink\":\"kcxk\"}") .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()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.value().get(0).properties().daysOfWeek().get(0)); + Assertions.assertEquals(1941131866, model.value().get(0).properties().rampUpStartTime().hour()); + Assertions.assertEquals(36862007, model.value().get(0).properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.value().get(0).properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, + model.value().get(0).properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, + model.value().get(0).properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(1577867001, model.value().get(0).properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + model.value().get(0).properties().rampUpActionOnLogoff()); + Assertions.assertEquals(347039984, model.value().get(0).properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(904194330, model.value().get(0).properties().peakStartTime().hour()); + Assertions.assertEquals(179339083, model.value().get(0).properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + model.value().get(0).properties().peakActionOnDisconnect()); + Assertions.assertEquals(149120205, model.value().get(0).properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + model.value().get(0).properties().peakActionOnLogoff()); + Assertions.assertEquals(1240461141, model.value().get(0).properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(515034915, model.value().get(0).properties().rampDownStartTime().hour()); + Assertions.assertEquals(432756215, model.value().get(0).properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, + model.value().get(0).properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + model.value().get(0).properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1186991439, model.value().get(0).properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, + model.value().get(0).properties().rampDownActionOnLogoff()); + Assertions.assertEquals(77592298, model.value().get(0).properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(96639942, model.value().get(0).properties().offPeakStartTime().hour()); + Assertions.assertEquals(82172099, model.value().get(0).properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, + model.value().get(0).properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + model.value().get(0).properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(1131661980, model.value().get(0).properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, + model.value().get(0).properties().offPeakActionOnLogoff()); + Assertions.assertEquals(447073477, model.value().get(0).properties().offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals("kcxk", model.nextLink()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchPropertiesTests.java new file mode 100644 index 000000000000..d7ee383dec32 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchPropertiesTests.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +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; +import com.azure.resourcemanager.desktopvirtualization.models.Time; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ScalingPlanPersonalSchedulePatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScalingPlanPersonalSchedulePatchProperties model = BinaryData.fromString( + "{\"daysOfWeek\":[\"Wednesday\",\"Saturday\",\"Monday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":1773842356,\"minute\":615677000},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":1372717465,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1372249565,\"peakStartTime\":{\"hour\":842063408,\"minute\":1712193542},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":654993570,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":267983336,\"rampDownStartTime\":{\"hour\":1646833466,\"minute\":402062508},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":344121425,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":1441551440,\"offPeakStartTime\":{\"hour\":1920486563,\"minute\":325656680},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":164017855,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1054212324}") + .toObject(ScalingPlanPersonalSchedulePatchProperties.class); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1773842356, model.rampUpStartTime().hour()); + Assertions.assertEquals(615677000, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(1372717465, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(1372249565, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(842063408, model.peakStartTime().hour()); + Assertions.assertEquals(1712193542, model.peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(654993570, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); + Assertions.assertEquals(267983336, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1646833466, model.rampDownStartTime().hour()); + Assertions.assertEquals(402062508, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(344121425, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1441551440, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1920486563, model.offPeakStartTime().hour()); + Assertions.assertEquals(325656680, model.offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(164017855, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(1054212324, model.offPeakMinutesToWaitOnLogoff()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScalingPlanPersonalSchedulePatchProperties model = new ScalingPlanPersonalSchedulePatchProperties() + .withDaysOfWeek( + Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.SATURDAY, DayOfWeek.MONDAY, DayOfWeek.THURSDAY)) + .withRampUpStartTime(new Time().withHour(1773842356).withMinute(615677000)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(1372717465) + .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnLogoff(1372249565) + .withPeakStartTime(new Time().withHour(842063408).withMinute(1712193542)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnDisconnect(654993570) + .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnLogoff(267983336) + .withRampDownStartTime(new Time().withHour(1646833466).withMinute(402062508)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(344121425) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(1441551440) + .withOffPeakStartTime(new Time().withHour(1920486563).withMinute(325656680)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(164017855) + .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnLogoff(1054212324); + model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalSchedulePatchProperties.class); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1773842356, model.rampUpStartTime().hour()); + Assertions.assertEquals(615677000, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(1372717465, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(1372249565, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(842063408, model.peakStartTime().hour()); + Assertions.assertEquals(1712193542, model.peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(654993570, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); + Assertions.assertEquals(267983336, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1646833466, model.rampDownStartTime().hour()); + Assertions.assertEquals(402062508, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(344121425, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1441551440, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1920486563, model.offPeakStartTime().hour()); + Assertions.assertEquals(325656680, model.offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(164017855, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(1054212324, model.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 index 6e1bc73be6d5..b35f182ffca4 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ScalingPlanPersonalSchedulePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -18,99 +19,100 @@ 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}}") + "{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Wednesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1436327406,\"minute\":994025187},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1385041485,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":389072329,\"peakStartTime\":{\"hour\":134126740,\"minute\":589242227},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":1572707089,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":1684987702,\"rampDownStartTime\":{\"hour\":466898477,\"minute\":411068196},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":1694403926,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":1045355720,\"offPeakStartTime\":{\"hour\":582198850,\"minute\":1957842604},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":1454140315,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1846677529}}") .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()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(1436327406, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(994025187, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(1385041485, model.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(389072329, model.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(134126740, model.properties().peakStartTime().hour()); + Assertions.assertEquals(589242227, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().peakActionOnDisconnect()); + Assertions.assertEquals(1572707089, model.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().peakActionOnLogoff()); + Assertions.assertEquals(1684987702, model.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(466898477, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(411068196, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1694403926, model.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1045355720, model.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(582198850, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1957842604, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(1454140315, model.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1846677529, model.properties().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) + = new ScalingPlanPersonalSchedulePatch().withProperties(new ScalingPlanPersonalSchedulePatchProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(1436327406).withMinute(994025187)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(1238517729) + .withRampUpMinutesToWaitOnDisconnect(1385041485) .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)) + .withRampUpMinutesToWaitOnLogoff(389072329) + .withPeakStartTime(new Time().withHour(134126740).withMinute(589242227)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(1572707089) + .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnLogoff(1684987702) + .withRampDownStartTime(new Time().withHour(466898477).withMinute(411068196)) .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(1297199271) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(585310107) - .withOffPeakStartTime(new Time().withHour(1282949861).withMinute(245335843)) + .withRampDownActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnDisconnect(1694403926) + .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnLogoff(1045355720) + .withOffPeakStartTime(new Time().withHour(582198850).withMinute(1957842604)) .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(57076299) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnDisconnect(1454140315) .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(220721528); + .withOffPeakMinutesToWaitOnLogoff(1846677529)); 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()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(1436327406, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(994025187, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, model.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(1385041485, model.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(389072329, model.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(134126740, model.properties().peakStartTime().hour()); + Assertions.assertEquals(589242227, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.properties().peakActionOnDisconnect()); + Assertions.assertEquals(1572707089, model.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().peakActionOnLogoff()); + Assertions.assertEquals(1684987702, model.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(466898477, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(411068196, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1694403926, model.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1045355720, model.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(582198850, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1957842604, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(1454140315, model.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1846677529, model.properties().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 index 2d656a33b9df..ecc4a81460b3 100644 --- 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 @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ScalingPlanPersonalScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -18,100 +18,99 @@ 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}") + "{\"daysOfWeek\":[\"Monday\",\"Monday\",\"Monday\"],\"rampUpStartTime\":{\"hour\":170135486,\"minute\":1714927386},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":703231006,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":795204562,\"peakStartTime\":{\"hour\":1303034345,\"minute\":506736213},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":2043816183,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":1089629771,\"rampDownStartTime\":{\"hour\":1050699636,\"minute\":1371903208},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":114126380,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":2131162818,\"offPeakStartTime\":{\"hour\":364566844,\"minute\":1265444378},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":1270096512,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":2057099950}") .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(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(170135486, model.rampUpStartTime().hour()); + Assertions.assertEquals(1714927386, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(703231006, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(795204562, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1303034345, model.peakStartTime().hour()); + Assertions.assertEquals(506736213, 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(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(2043816183, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnLogoff()); + Assertions.assertEquals(1089629771, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1050699636, model.rampDownStartTime().hour()); + Assertions.assertEquals(1371903208, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(114126380, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(2131162818, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(364566844, model.offPeakStartTime().hour()); + Assertions.assertEquals(1265444378, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1800612686, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(1270096512, model.offPeakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1279542640, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(2057099950, 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)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.MONDAY, DayOfWeek.MONDAY)) + .withRampUpStartTime(new Time().withHour(170135486).withMinute(1714927386)) + .withRampUpAutoStartHosts(StartupBehavior.NONE) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(703231006) + .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnLogoff(795204562) + .withPeakStartTime(new Time().withHour(1303034345).withMinute(506736213)) .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)) + .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnDisconnect(2043816183) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(1089629771) + .withRampDownStartTime(new Time().withHour(1050699636).withMinute(1371903208)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnDisconnect(114126380) + .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnLogoff(2131162818) + .withOffPeakStartTime(new Time().withHour(364566844).withMinute(1265444378)) .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnDisconnect(1800612686) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(1270096512) .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(1279542640); + .withOffPeakMinutesToWaitOnLogoff(2057099950); 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(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(170135486, model.rampUpStartTime().hour()); + Assertions.assertEquals(1714927386, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(703231006, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(795204562, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1303034345, model.peakStartTime().hour()); + Assertions.assertEquals(506736213, 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(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(2043816183, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnLogoff()); + Assertions.assertEquals(1089629771, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1050699636, model.rampDownStartTime().hour()); + Assertions.assertEquals(1371903208, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(114126380, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(2131162818, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(364566844, model.offPeakStartTime().hour()); + Assertions.assertEquals(1265444378, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1800612686, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(1270096512, model.offPeakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(1279542640, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(2057099950, 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 index f5c2ddce9c5d..ca7308f874f8 100644 --- 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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.ScalingPlanPersonalScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; @@ -27,75 +28,76 @@ 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\"}"; + = "{\"properties\":{\"daysOfWeek\":[\"Saturday\"],\"rampUpStartTime\":{\"hour\":494308387,\"minute\":980314915},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":782520891,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1921763582,\"peakStartTime\":{\"hour\":1969772389,\"minute\":1318216752},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":182112001,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":2109980848,\"rampDownStartTime\":{\"hour\":247829939,\"minute\":971995158},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":1451117706,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":1925644656,\"offPeakStartTime\":{\"hour\":748652264,\"minute\":342924982},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1049447036,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1249625164},\"id\":\"cruxspinym\",\"name\":\"qgwokmikp\",\"type\":\"zfbmjxuv\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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) + .define("wo") + .withExistingScalingPlan("e", "ptrklzmija") + .withProperties(new ScalingPlanPersonalScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.THURSDAY)) + .withRampUpStartTime(new Time().withHour(834669108).withMinute(202449168)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnDisconnect(356088444) + .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnLogoff(1397750916) + .withPeakStartTime(new Time().withHour(677665183).withMinute(920278919)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(1937115056) + .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnLogoff(357206525) + .withRampDownStartTime(new Time().withHour(1665426893).withMinute(853693060)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(1448235256) + .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnLogoff(882366238) + .withOffPeakStartTime(new Time().withHour(1220614704).withMinute(1914716275)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(1666070371) + .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnLogoff(1883147772)) .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()); + Assertions.assertEquals(DayOfWeek.SATURDAY, response.properties().daysOfWeek().get(0)); + Assertions.assertEquals(494308387, response.properties().rampUpStartTime().hour()); + Assertions.assertEquals(980314915, response.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, response.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(782520891, response.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(1921763582, response.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1969772389, response.properties().peakStartTime().hour()); + Assertions.assertEquals(1318216752, response.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().peakActionOnDisconnect()); + Assertions.assertEquals(182112001, response.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().peakActionOnLogoff()); + Assertions.assertEquals(2109980848, response.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(247829939, response.properties().rampDownStartTime().hour()); + Assertions.assertEquals(971995158, response.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1451117706, response.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1925644656, response.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(748652264, response.properties().offPeakStartTime().hour()); + Assertions.assertEquals(342924982, response.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(1049447036, response.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1249625164, response.properties().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 index 89acb5ad12fc..4f27994fd918 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.scalingPlanPersonalSchedules() - .deleteWithResponse("ja", "urnnqbnqbpiz", "qltgrd", com.azure.core.util.Context.NONE); + .deleteWithResponse("zerwgudas", "xubvf", "ngfcocefhpriyl", 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 index dee50bb3c5b1..109e67d912ae 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; @@ -25,48 +25,48 @@ 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\"}"; + = "{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":565782278,\"minute\":1754193010},\"rampUpAutoStartHosts\":\"WithAssignedUser\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":657752812,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":272079374,\"peakStartTime\":{\"hour\":221950277,\"minute\":1910621771},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":1722581941,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":1293844399,\"rampDownStartTime\":{\"hour\":468774644,\"minute\":1514665980},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":1650089892,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":839586334,\"offPeakStartTime\":{\"hour\":1862758850,\"minute\":166238370},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":763069033,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1555297539},\"id\":\"aucmcirtnee\",\"name\":\"mjauwcgx\",\"type\":\"fnohaitran\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScalingPlanPersonalSchedule response = manager.scalingPlanPersonalSchedules() - .getWithResponse("hkgmnsg", "pxycphdr", "jjkhvyomaclu", com.azure.core.util.Context.NONE) + .getWithResponse("sqgpewqcfu", "mdpv", "zgl", 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()); + Assertions.assertEquals(DayOfWeek.THURSDAY, response.properties().daysOfWeek().get(0)); + Assertions.assertEquals(565782278, response.properties().rampUpStartTime().hour()); + Assertions.assertEquals(1754193010, response.properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.WITH_ASSIGNED_USER, response.properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.properties().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(657752812, response.properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().rampUpActionOnLogoff()); + Assertions.assertEquals(272079374, response.properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(221950277, response.properties().peakStartTime().hour()); + Assertions.assertEquals(1910621771, response.properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.properties().peakActionOnDisconnect()); + Assertions.assertEquals(1722581941, response.properties().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().peakActionOnLogoff()); + Assertions.assertEquals(1293844399, response.properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(468774644, response.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1514665980, response.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1650089892, response.properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().rampDownActionOnLogoff()); + Assertions.assertEquals(839586334, response.properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1862758850, response.properties().offPeakStartTime().hour()); + Assertions.assertEquals(166238370, response.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(763069033, response.properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1555297539, response.properties().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 index 7ffc752b8f6d..048078df2e69 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; @@ -26,50 +26,60 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":1146040663,\"minute\":1719722751},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":2083179268,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":1093924597,\"peakStartTime\":{\"hour\":306071992,\"minute\":1703941871},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":325713756,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":399524606,\"rampDownStartTime\":{\"hour\":1102265131,\"minute\":155020717},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":1724482587,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1795034421,\"offPeakStartTime\":{\"hour\":362600474,\"minute\":1187333860},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":1283284835,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1138228089},\"id\":\"einkfsc\",\"name\":\"fncjwvua\",\"type\":\"fqwtltngvm\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.scalingPlanPersonalSchedules() - .list("gypxrxvbfihwuhvc", "a", 64697059, true, 2010585731, com.azure.core.util.Context.NONE); + .list("mpztraudsvhlc", "culregpqt", 1371553792, true, 2138989131, 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(DayOfWeek.SATURDAY, response.iterator().next().properties().daysOfWeek().get(0)); + Assertions.assertEquals(1146040663, response.iterator().next().properties().rampUpStartTime().hour()); + Assertions.assertEquals(1719722751, response.iterator().next().properties().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, response.iterator().next().properties().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, + response.iterator().next().properties().rampUpStartVMOnConnect()); 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()); + response.iterator().next().properties().rampUpActionOnDisconnect()); + Assertions.assertEquals(2083179268, response.iterator().next().properties().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + response.iterator().next().properties().rampUpActionOnLogoff()); + Assertions.assertEquals(1093924597, response.iterator().next().properties().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(306071992, response.iterator().next().properties().peakStartTime().hour()); + Assertions.assertEquals(1703941871, response.iterator().next().properties().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, + response.iterator().next().properties().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + response.iterator().next().properties().peakActionOnDisconnect()); + Assertions.assertEquals(325713756, response.iterator().next().properties().peakMinutesToWaitOnDisconnect()); 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()); + response.iterator().next().properties().peakActionOnLogoff()); + Assertions.assertEquals(399524606, response.iterator().next().properties().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1102265131, response.iterator().next().properties().rampDownStartTime().hour()); + Assertions.assertEquals(155020717, response.iterator().next().properties().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, + response.iterator().next().properties().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + response.iterator().next().properties().rampDownActionOnDisconnect()); + Assertions.assertEquals(1724482587, + response.iterator().next().properties().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + response.iterator().next().properties().rampDownActionOnLogoff()); + Assertions.assertEquals(1795034421, response.iterator().next().properties().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(362600474, response.iterator().next().properties().offPeakStartTime().hour()); + Assertions.assertEquals(1187333860, response.iterator().next().properties().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, + response.iterator().next().properties().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, + response.iterator().next().properties().offPeakActionOnDisconnect()); + Assertions.assertEquals(1283284835, response.iterator().next().properties().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + response.iterator().next().properties().offPeakActionOnLogoff()); + Assertions.assertEquals(1138228089, response.iterator().next().properties().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 index df7abe37d332..27d1ee452e07 100644 --- 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 @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -17,72 +20,95 @@ 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\"}") + "{\"properties\":{\"name\":\"bn\",\"daysOfWeek\":[\"Tuesday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":1250131057,\"rampUpMinimumHostPoolSize\":1365374514,\"rampDownMaximumHostPoolSize\":342142930,\"rampDownMinimumHostPoolSize\":1773751874},\"rampUpStartTime\":{\"hour\":134024740,\"minute\":2016652942},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1185844831,\"rampUpCapacityThresholdPct\":607334150,\"peakStartTime\":{\"hour\":496912008,\"minute\":382801077},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1230489128,\"minute\":2114285001},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1094217479,\"rampDownCapacityThresholdPct\":451814884,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":2077646980,\"rampDownNotificationMessage\":\"kcdqzhlct\",\"offPeakStartTime\":{\"hour\":1266865634,\"minute\":1078377836},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"yfp\",\"name\":\"hrqbnjjrcg\",\"type\":\"gydcw\"}") .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()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.properties().scalingMethod()); + Assertions.assertEquals(1250131057, model.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1365374514, model.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(342142930, model.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1773751874, model.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(134024740, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(2016652942, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1185844831, model.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(607334150, model.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(496912008, model.properties().peakStartTime().hour()); + Assertions.assertEquals(382801077, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1230489128, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(2114285001, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1094217479, model.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(451814884, model.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(2077646980, model.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("kcdqzhlct", model.properties().rampDownNotificationMessage()); + Assertions.assertEquals(1266865634, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1078377836, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().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)) + ScalingPlanPooledScheduleInner model = new ScalingPlanPooledScheduleInner() + .withProperties(new ScalingPlanPooledScheduleProperties().withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1250131057) + .withRampUpMinimumHostPoolSize(1365374514) + .withRampDownMaximumHostPoolSize(342142930) + .withRampDownMinimumHostPoolSize(1773751874)) + .withRampUpStartTime(new Time().withHour(134024740).withMinute(2016652942)) .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)) + .withRampUpMinimumHostsPct(1185844831) + .withRampUpCapacityThresholdPct(607334150) + .withPeakStartTime(new Time().withHour(496912008).withMinute(382801077)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(1230489128).withMinute(2114285001)) .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); + .withRampDownMinimumHostsPct(1094217479) + .withRampDownCapacityThresholdPct(451814884) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(2077646980) + .withRampDownNotificationMessage("kcdqzhlct") + .withOffPeakStartTime(new Time().withHour(1266865634).withMinute(1078377836)) + .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()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.properties().scalingMethod()); + Assertions.assertEquals(1250131057, model.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1365374514, model.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(342142930, model.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1773751874, model.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(134024740, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(2016652942, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1185844831, model.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(607334150, model.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(496912008, model.properties().peakStartTime().hour()); + Assertions.assertEquals(382801077, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1230489128, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(2114285001, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1094217479, model.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(451814884, model.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(2077646980, model.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("kcdqzhlct", model.properties().rampDownNotificationMessage()); + Assertions.assertEquals(1266865634, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1078377836, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().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 index 1a5caeaf1eb3..d2567b82bebb 100644 --- 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 @@ -1,132 +1,58 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.ScalingPlanPooledScheduleList; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; -import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleList; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; 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\"}") + "{\"value\":[{\"properties\":{\"name\":\"dsmexiitdfux\",\"daysOfWeek\":[\"Saturday\",\"Wednesday\",\"Tuesday\",\"Monday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":1192000578,\"rampUpMinimumHostPoolSize\":1721693847,\"rampDownMaximumHostPoolSize\":2019693740,\"rampDownMinimumHostPoolSize\":550781101},\"rampUpStartTime\":{\"hour\":453653118,\"minute\":11223363},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1842685093,\"rampUpCapacityThresholdPct\":202183770,\"peakStartTime\":{\"hour\":1332076881,\"minute\":331597501},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1356013965,\"minute\":657372547},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":710073444,\"rampDownCapacityThresholdPct\":1621390850,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":307968762,\"rampDownNotificationMessage\":\"wy\",\"offPeakStartTime\":{\"hour\":677853893,\"minute\":147246399},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"hu\",\"name\":\"cmjkavlgorbmftpm\",\"type\":\"tzfjltf\"}],\"nextLink\":\"zcyjtot\"}") .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(DayOfWeek.SATURDAY, model.value().get(0).properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, + model.value().get(0).properties().scalingMethod()); + Assertions.assertEquals(1192000578, + model.value().get(0).properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1721693847, + model.value().get(0).properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(2019693740, + model.value().get(0).properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(550781101, + model.value().get(0).properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(453653118, model.value().get(0).properties().rampUpStartTime().hour()); + Assertions.assertEquals(11223363, model.value().get(0).properties().rampUpStartTime().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()); + model.value().get(0).properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1842685093, model.value().get(0).properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(202183770, model.value().get(0).properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(1332076881, model.value().get(0).properties().peakStartTime().hour()); + Assertions.assertEquals(331597501, model.value().get(0).properties().peakStartTime().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()); + model.value().get(0).properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1356013965, model.value().get(0).properties().rampDownStartTime().hour()); + Assertions.assertEquals(657372547, model.value().get(0).properties().rampDownStartTime().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()); + model.value().get(0).properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(710073444, model.value().get(0).properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(1621390850, model.value().get(0).properties().rampDownCapacityThresholdPct()); + Assertions.assertTrue(model.value().get(0).properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.value().get(0).properties().rampDownStopHostsWhen()); + Assertions.assertEquals(307968762, model.value().get(0).properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("wy", model.value().get(0).properties().rampDownNotificationMessage()); + Assertions.assertEquals(677853893, model.value().get(0).properties().offPeakStartTime().hour()); + Assertions.assertEquals(147246399, model.value().get(0).properties().offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.value().get(0).offPeakLoadBalancingAlgorithm()); + model.value().get(0).properties().offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("zcyjtot", model.nextLink()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchPropertiesTests.java new file mode 100644 index 000000000000..8f2d4dfa76a3 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchPropertiesTests.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +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; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ScalingPlanPooledSchedulePatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScalingPlanPooledSchedulePatchProperties model = BinaryData.fromString( + "{\"name\":\"bqqxlaj\",\"daysOfWeek\":[\"Wednesday\",\"Saturday\",\"Sunday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":843189090,\"rampUpMinimumHostPoolSize\":1432643181,\"rampDownMaximumHostPoolSize\":1322140273,\"rampDownMinimumHostPoolSize\":1997384457},\"rampUpStartTime\":{\"hour\":1289624763,\"minute\":168622521},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1476651510,\"rampUpCapacityThresholdPct\":1667694351,\"peakStartTime\":{\"hour\":317392928,\"minute\":1809533021},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2085651049,\"minute\":416080611},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":54878008,\"rampDownCapacityThresholdPct\":497715430,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1251385570,\"rampDownNotificationMessage\":\"eyhlqhykprl\",\"offPeakStartTime\":{\"hour\":147265741,\"minute\":1261691522},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") + .toObject(ScalingPlanPooledSchedulePatchProperties.class); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(843189090, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1432643181, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1322140273, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1997384457, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1289624763, model.rampUpStartTime().hour()); + Assertions.assertEquals(168622521, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1476651510, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1667694351, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(317392928, model.peakStartTime().hour()); + Assertions.assertEquals(1809533021, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(2085651049, model.rampDownStartTime().hour()); + Assertions.assertEquals(416080611, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(54878008, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(497715430, model.rampDownCapacityThresholdPct()); + Assertions.assertTrue(model.rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(1251385570, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("eyhlqhykprl", model.rampDownNotificationMessage()); + Assertions.assertEquals(147265741, model.offPeakStartTime().hour()); + Assertions.assertEquals(1261691522, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScalingPlanPooledSchedulePatchProperties model = new ScalingPlanPooledSchedulePatchProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(843189090) + .withRampUpMinimumHostPoolSize(1432643181) + .withRampDownMaximumHostPoolSize(1322140273) + .withRampDownMinimumHostPoolSize(1997384457)) + .withRampUpStartTime(new Time().withHour(1289624763).withMinute(168622521)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(1476651510) + .withRampUpCapacityThresholdPct(1667694351) + .withPeakStartTime(new Time().withHour(317392928).withMinute(1809533021)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(2085651049).withMinute(416080611)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(54878008) + .withRampDownCapacityThresholdPct(497715430) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1251385570) + .withRampDownNotificationMessage("eyhlqhykprl") + .withOffPeakStartTime(new Time().withHour(147265741).withMinute(1261691522)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); + model = BinaryData.fromObject(model).toObject(ScalingPlanPooledSchedulePatchProperties.class); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(843189090, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1432643181, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1322140273, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1997384457, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1289624763, model.rampUpStartTime().hour()); + Assertions.assertEquals(168622521, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1476651510, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1667694351, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(317392928, model.peakStartTime().hour()); + Assertions.assertEquals(1809533021, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(2085651049, model.rampDownStartTime().hour()); + Assertions.assertEquals(416080611, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(54878008, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(497715430, model.rampDownCapacityThresholdPct()); + Assertions.assertTrue(model.rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(1251385570, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("eyhlqhykprl", model.rampDownNotificationMessage()); + Assertions.assertEquals(147265741, model.offPeakStartTime().hour()); + Assertions.assertEquals(1261691522, 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/ScalingPlanPooledSchedulePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java index cb0d64bba044..2ebcf68f6593 100644 --- 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 @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; 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; @@ -17,72 +20,95 @@ 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\"}") + "{\"properties\":{\"name\":\"lzo\",\"daysOfWeek\":[\"Wednesday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":1500212037,\"rampUpMinimumHostPoolSize\":1889500647,\"rampDownMaximumHostPoolSize\":2130318282,\"rampDownMinimumHostPoolSize\":120965041},\"rampUpStartTime\":{\"hour\":1293168350,\"minute\":1814498181},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":2136201648,\"rampUpCapacityThresholdPct\":1242659668,\"peakStartTime\":{\"hour\":1204887332,\"minute\":1233581087},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":976674781,\"minute\":1970936135},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":698820955,\"rampDownCapacityThresholdPct\":1225103578,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":703676332,\"rampDownNotificationMessage\":\"yhyhsgzfczb\",\"offPeakStartTime\":{\"hour\":778841365,\"minute\":1580629361},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"glqgleoh\",\"name\":\"betnluankrrfxee\",\"type\":\"btijvacvbm\"}") .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()); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.properties().scalingMethod()); + Assertions.assertEquals(1500212037, model.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1889500647, model.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(2130318282, model.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(120965041, model.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1293168350, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(1814498181, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(2136201648, model.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(1242659668, model.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(1204887332, model.properties().peakStartTime().hour()); + Assertions.assertEquals(1233581087, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(976674781, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1970936135, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(698820955, model.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(1225103578, model.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(703676332, model.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("yhyhsgzfczb", model.properties().rampDownNotificationMessage()); + Assertions.assertEquals(778841365, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1580629361, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().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); + ScalingPlanPooledSchedulePatch model = new ScalingPlanPooledSchedulePatch().withProperties( + new ScalingPlanPooledSchedulePatchProperties().withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1500212037) + .withRampUpMinimumHostPoolSize(1889500647) + .withRampDownMaximumHostPoolSize(2130318282) + .withRampDownMinimumHostPoolSize(120965041)) + .withRampUpStartTime(new Time().withHour(1293168350).withMinute(1814498181)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(2136201648) + .withRampUpCapacityThresholdPct(1242659668) + .withPeakStartTime(new Time().withHour(1204887332).withMinute(1233581087)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(976674781).withMinute(1970936135)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(698820955) + .withRampDownCapacityThresholdPct(1225103578) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(703676332) + .withRampDownNotificationMessage("yhyhsgzfczb") + .withOffPeakStartTime(new Time().withHour(778841365).withMinute(1580629361)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_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()); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, model.properties().scalingMethod()); + Assertions.assertEquals(1500212037, model.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1889500647, model.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(2130318282, model.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(120965041, model.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1293168350, model.properties().rampUpStartTime().hour()); + Assertions.assertEquals(1814498181, model.properties().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(2136201648, model.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(1242659668, model.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(1204887332, model.properties().peakStartTime().hour()); + Assertions.assertEquals(1233581087, model.properties().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(976674781, model.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1970936135, model.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(698820955, model.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(1225103578, model.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(703676332, model.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("yhyhsgzfczb", model.properties().rampDownNotificationMessage()); + Assertions.assertEquals(778841365, model.properties().offPeakStartTime().hour()); + Assertions.assertEquals(1580629361, model.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.properties().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 index 54cf6ce9d22f..8817e6035497 100644 --- 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 @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -17,74 +19,88 @@ 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\"}") + "{\"name\":\"xjumvq\",\"daysOfWeek\":[\"Saturday\",\"Sunday\",\"Wednesday\",\"Saturday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":181506173,\"rampUpMinimumHostPoolSize\":1029083448,\"rampDownMaximumHostPoolSize\":1002121154,\"rampDownMinimumHostPoolSize\":1218728383},\"rampUpStartTime\":{\"hour\":617532608,\"minute\":1702747573},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1541278105,\"rampUpCapacityThresholdPct\":1492295803,\"peakStartTime\":{\"hour\":1140941505,\"minute\":1614609688},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1851238843,\"minute\":2039990607},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1256025401,\"rampDownCapacityThresholdPct\":231724213,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":26585986,\"rampDownNotificationMessage\":\"dfqwmkyoq\",\"offPeakStartTime\":{\"hour\":1748884059,\"minute\":2136104967},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}") .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(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(181506173, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1029083448, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1002121154, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1218728383, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(617532608, model.rampUpStartTime().hour()); + Assertions.assertEquals(1702747573, 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(1541278105, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1492295803, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1140941505, model.peakStartTime().hour()); + Assertions.assertEquals(1614609688, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1851238843, model.rampDownStartTime().hour()); + Assertions.assertEquals(2039990607, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1256025401, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(231724213, model.rampDownCapacityThresholdPct()); + Assertions.assertTrue(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()); + Assertions.assertEquals(26585986, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("dfqwmkyoq", model.rampDownNotificationMessage()); + Assertions.assertEquals(1748884059, model.offPeakStartTime().hour()); + Assertions.assertEquals(2136104967, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_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)) + .withDaysOfWeek( + Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.SUNDAY, DayOfWeek.WEDNESDAY, DayOfWeek.SATURDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(181506173) + .withRampUpMinimumHostPoolSize(1029083448) + .withRampDownMaximumHostPoolSize(1002121154) + .withRampDownMinimumHostPoolSize(1218728383)) + .withRampUpStartTime(new Time().withHour(617532608).withMinute(1702747573)) .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) + .withRampUpMinimumHostsPct(1541278105) + .withRampUpCapacityThresholdPct(1492295803) + .withPeakStartTime(new Time().withHour(1140941505).withMinute(1614609688)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1851238843).withMinute(2039990607)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(1256025401) + .withRampDownCapacityThresholdPct(231724213) + .withRampDownForceLogoffUsers(true) .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(820009390) - .withRampDownNotificationMessage("f") - .withOffPeakStartTime(new Time().withHour(568244971).withMinute(519560547)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); + .withRampDownWaitTimeMinutes(26585986) + .withRampDownNotificationMessage("dfqwmkyoq") + .withOffPeakStartTime(new Time().withHour(1748884059).withMinute(2136104967)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_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(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(181506173, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1029083448, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1002121154, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1218728383, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(617532608, model.rampUpStartTime().hour()); + Assertions.assertEquals(1702747573, 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(1541278105, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1492295803, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1140941505, model.peakStartTime().hour()); + Assertions.assertEquals(1614609688, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1851238843, model.rampDownStartTime().hour()); + Assertions.assertEquals(2039990607, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1256025401, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(231724213, model.rampDownCapacityThresholdPct()); + Assertions.assertTrue(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()); + Assertions.assertEquals(26585986, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("dfqwmkyoq", model.rampDownNotificationMessage()); + Assertions.assertEquals(1748884059, model.offPeakStartTime().hour()); + Assertions.assertEquals(2136104967, 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/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java index 251734b32360..d26cddbab820 100644 --- 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 @@ -1,17 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledScheduleProperties; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; @@ -26,60 +29,73 @@ 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\"}"; + = "{\"properties\":{\"name\":\"vmtumxpym\",\"daysOfWeek\":[\"Monday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":2012943532,\"rampUpMinimumHostPoolSize\":1699476003,\"rampDownMaximumHostPoolSize\":1455564634,\"rampDownMinimumHostPoolSize\":458062227},\"rampUpStartTime\":{\"hour\":1174618316,\"minute\":788439044},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":494652447,\"rampUpCapacityThresholdPct\":924415526,\"peakStartTime\":{\"hour\":1436666704,\"minute\":755481767},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":441742896,\"minute\":12992231},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":2043653777,\"rampDownCapacityThresholdPct\":757487454,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1483560552,\"rampDownNotificationMessage\":\"qepdx\",\"offPeakStartTime\":{\"hour\":385113507,\"minute\":187295850},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"yvpjbowcpjqduqg\",\"name\":\"xe\",\"type\":\"kydfbwljavhuerkj\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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) + .define("qxetqmmlivrjjx") + .withExistingScalingPlan("hpqatiwkkvyanxk", "vcsemsvuvdj") + .withProperties(new ScalingPlanPooledScheduleProperties() + .withDaysOfWeek( + Arrays.asList(DayOfWeek.THURSDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY, DayOfWeek.WEDNESDAY)) + .withScalingMethod(ScalingMethodType.POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1064794889) + .withRampUpMinimumHostPoolSize(1792506413) + .withRampDownMaximumHostPoolSize(625489689) + .withRampDownMinimumHostPoolSize(139978050)) + .withRampUpStartTime(new Time().withHour(568323800).withMinute(1697047368)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1998740765) + .withRampUpCapacityThresholdPct(1806223312) + .withPeakStartTime(new Time().withHour(1518509688).withMinute(242441181)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(1571619447).withMinute(1712959814)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1692490302) + .withRampDownCapacityThresholdPct(254926221) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(1787804610) + .withRampDownNotificationMessage("uisdzhgbdgz") + .withOffPeakStartTime(new Time().withHour(1574777857).withMinute(1393102349)) + .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(DayOfWeek.MONDAY, response.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, response.properties().scalingMethod()); + Assertions.assertEquals(2012943532, response.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1699476003, response.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1455564634, response.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(458062227, response.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1174618316, response.properties().rampUpStartTime().hour()); + Assertions.assertEquals(788439044, response.properties().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + response.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(494652447, response.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(924415526, response.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(1436666704, response.properties().peakStartTime().hour()); + Assertions.assertEquals(755481767, response.properties().peakStartTime().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()); + response.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(441742896, response.properties().rampDownStartTime().hour()); + Assertions.assertEquals(12992231, response.properties().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()); + response.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(2043653777, response.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(757487454, response.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(response.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, response.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(1483560552, response.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("qepdx", response.properties().rampDownNotificationMessage()); + Assertions.assertEquals(385113507, response.properties().offPeakStartTime().hour()); + Assertions.assertEquals(187295850, response.properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + response.properties().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 index 0d560f1a0a57..28f5dffa2be9 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.scalingPlanPooledSchedules() - .deleteWithResponse("iul", "gniiprglvaw", "wzdufypivlsbb", com.azure.core.util.Context.NONE); + .deleteWithResponse("mlyotg", "wsxnsrqor", "genmvceb", 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 index f299cd2fe689..01bd3b69cfe5 100644 --- 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 @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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.ScalingMethodType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; @@ -24,42 +25,48 @@ 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\"}"; + = "{\"properties\":{\"name\":\"tooxrpog\",\"daysOfWeek\":[\"Friday\",\"Friday\",\"Saturday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":2053082943,\"rampUpMinimumHostPoolSize\":858805676,\"rampDownMaximumHostPoolSize\":394984706,\"rampDownMinimumHostPoolSize\":293639092},\"rampUpStartTime\":{\"hour\":783076282,\"minute\":1114566909},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":661764702,\"rampUpCapacityThresholdPct\":1206686909,\"peakStartTime\":{\"hour\":765639716,\"minute\":360128314},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":243497184,\"minute\":1637002946},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":2049760950,\"rampDownCapacityThresholdPct\":860960860,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":93845829,\"rampDownNotificationMessage\":\"jzwxuqgovsxpwwz\",\"offPeakStartTime\":{\"hour\":993283895,\"minute\":933500866},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"tgfredmlscgrllc\",\"name\":\"na\",\"type\":\"vjowazhpabac\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ScalingPlanPooledSchedule response = manager.scalingPlanPooledSchedules() - .getWithResponse("ixkykxd", "sj", "emmucfxh", com.azure.core.util.Context.NONE) + .getWithResponse("ipfdvhaxdvwzaehp", "hthdklmvetatlakf", "oixwgiksb", 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(DayOfWeek.FRIDAY, response.properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, response.properties().scalingMethod()); + Assertions.assertEquals(2053082943, response.properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(858805676, response.properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(394984706, response.properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(293639092, response.properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(783076282, response.properties().rampUpStartTime().hour()); + Assertions.assertEquals(1114566909, response.properties().rampUpStartTime().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()); + response.properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(661764702, response.properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(1206686909, response.properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(765639716, response.properties().peakStartTime().hour()); + Assertions.assertEquals(360128314, response.properties().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(243497184, response.properties().rampDownStartTime().hour()); + Assertions.assertEquals(1637002946, response.properties().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(2049760950, response.properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(860960860, response.properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(response.properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.properties().rampDownStopHostsWhen()); + Assertions.assertEquals(93845829, response.properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("jzwxuqgovsxpwwz", response.properties().rampDownNotificationMessage()); + Assertions.assertEquals(993283895, response.properties().offPeakStartTime().hour()); + Assertions.assertEquals(933500866, response.properties().offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.offPeakLoadBalancingAlgorithm()); + response.properties().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 index 31117e249258..f617a44ec729 100644 --- 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; 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.ScalingMethodType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; @@ -25,42 +26,53 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"name\":\"vvxwjong\",\"daysOfWeek\":[\"Thursday\",\"Saturday\",\"Thursday\"],\"scalingMethod\":\"PowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":440777762,\"rampUpMinimumHostPoolSize\":1311581652,\"rampDownMaximumHostPoolSize\":1388232856,\"rampDownMinimumHostPoolSize\":279754327},\"rampUpStartTime\":{\"hour\":470051968,\"minute\":1308841925},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":120311950,\"rampUpCapacityThresholdPct\":1527475680,\"peakStartTime\":{\"hour\":270901573,\"minute\":1346312229},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1736888990,\"minute\":520557034},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1781103548,\"rampDownCapacityThresholdPct\":1652546026,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1366739404,\"rampDownNotificationMessage\":\"zhxly\",\"offPeakStartTime\":{\"hour\":1174849627,\"minute\":77627949},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"tvrjeqmtz\",\"name\":\"beqrztrx\",\"type\":\"lxrdhabsrwrsn\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.scalingPlanPooledSchedules() - .list("pmcubkmifoxxkub", "phavpmhbrb", 1491297661, true, 215978587, com.azure.core.util.Context.NONE); + .list("eetqujxcxxq", "dcqjkedwqurc", 1630977545, true, 1688663099, 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(DayOfWeek.THURSDAY, response.iterator().next().properties().daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.POWER_MANAGE, + response.iterator().next().properties().scalingMethod()); + Assertions.assertEquals(440777762, + response.iterator().next().properties().createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1311581652, + response.iterator().next().properties().createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1388232856, + response.iterator().next().properties().createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(279754327, + response.iterator().next().properties().createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(470051968, response.iterator().next().properties().rampUpStartTime().hour()); + Assertions.assertEquals(1308841925, response.iterator().next().properties().rampUpStartTime().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()); + response.iterator().next().properties().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(120311950, response.iterator().next().properties().rampUpMinimumHostsPct()); + Assertions.assertEquals(1527475680, response.iterator().next().properties().rampUpCapacityThresholdPct()); + Assertions.assertEquals(270901573, response.iterator().next().properties().peakStartTime().hour()); + Assertions.assertEquals(1346312229, response.iterator().next().properties().peakStartTime().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()); + response.iterator().next().properties().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1736888990, response.iterator().next().properties().rampDownStartTime().hour()); + Assertions.assertEquals(520557034, response.iterator().next().properties().rampDownStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().offPeakLoadBalancingAlgorithm()); + response.iterator().next().properties().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1781103548, response.iterator().next().properties().rampDownMinimumHostsPct()); + Assertions.assertEquals(1652546026, response.iterator().next().properties().rampDownCapacityThresholdPct()); + Assertions.assertFalse(response.iterator().next().properties().rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, + response.iterator().next().properties().rampDownStopHostsWhen()); + Assertions.assertEquals(1366739404, response.iterator().next().properties().rampDownWaitTimeMinutes()); + Assertions.assertEquals("zhxly", response.iterator().next().properties().rampDownNotificationMessage()); + Assertions.assertEquals(1174849627, response.iterator().next().properties().offPeakStartTime().hour()); + Assertions.assertEquals(77627949, response.iterator().next().properties().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + response.iterator().next().properties().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 index 29b4053f0f84..d3ed502f3485 100644 --- 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 @@ -1,15 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.CreateDeleteProperties; +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.ScalingMethodType; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanProperties; 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; @@ -20,144 +22,121 @@ 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}]}") + "{\"objectId\":\"rhneuyowq\",\"description\":\"wyt\",\"friendlyName\":\"ib\",\"timeZone\":\"rcgp\",\"hostPoolType\":\"Personal\",\"exclusionTag\":\"imejzanl\",\"schedules\":[{\"name\":\"av\",\"daysOfWeek\":[\"Friday\",\"Wednesday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":1961298292,\"rampUpMinimumHostPoolSize\":485732763,\"rampDownMaximumHostPoolSize\":1432241544,\"rampDownMinimumHostPoolSize\":749799353},\"rampUpStartTime\":{\"hour\":1507022412,\"minute\":2101008571},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1689158951,\"rampUpCapacityThresholdPct\":1438056618,\"peakStartTime\":{\"hour\":289139579,\"minute\":1822187571},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":409653705,\"minute\":1723984044},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":369486551,\"rampDownCapacityThresholdPct\":941939967,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1832307115,\"rampDownNotificationMessage\":\"flsjc\",\"offPeakStartTime\":{\"hour\":1421362478,\"minute\":402907816},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"gofel\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"qmqhldvriii\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"lg\",\"scalingPlanEnabled\":true},{\"hostPoolArmPath\":\"tvsexsowuel\",\"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("wyt", model.description()); + Assertions.assertEquals("ib", model.friendlyName()); + Assertions.assertEquals("rcgp", model.timeZone()); + Assertions.assertEquals(ScalingHostPoolType.PERSONAL, model.hostPoolType()); + Assertions.assertEquals("imejzanl", model.exclusionTag()); + Assertions.assertEquals("av", model.schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.schedules().get(0).scalingMethod()); + Assertions.assertEquals(1961298292, model.schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(485732763, model.schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1432241544, model.schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(749799353, model.schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1507022412, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(2101008571, 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(1689158951, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(1438056618, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(289139579, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1822187571, 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, + Assertions.assertEquals(409653705, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1723984044, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_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, + Assertions.assertEquals(369486551, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(941939967, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(1832307115, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("flsjc", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(1421362478, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(402907816, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("qagnbuyn", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals("gofel", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertTrue(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))); + ScalingPlanProperties model = new ScalingPlanProperties().withDescription("wyt") + .withFriendlyName("ib") + .withTimeZone("rcgp") + .withHostPoolType(ScalingHostPoolType.PERSONAL) + .withExclusionTag("imejzanl") + .withSchedules(Arrays.asList(new ScalingSchedule().withName("av") + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(1961298292) + .withRampUpMinimumHostPoolSize(485732763) + .withRampDownMaximumHostPoolSize(1432241544) + .withRampDownMinimumHostPoolSize(749799353)) + .withRampUpStartTime(new Time().withHour(1507022412).withMinute(2101008571)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1689158951) + .withRampUpCapacityThresholdPct(1438056618) + .withPeakStartTime(new Time().withHour(289139579).withMinute(1822187571)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(409653705).withMinute(1723984044)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(369486551) + .withRampDownCapacityThresholdPct(941939967) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1832307115) + .withRampDownNotificationMessage("flsjc") + .withOffPeakStartTime(new Time().withHour(1421362478).withMinute(402907816)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences( + Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath("gofel").withScalingPlanEnabled(true), + new ScalingHostPoolReference().withHostPoolArmPath("qmqhldvriii").withScalingPlanEnabled(true), + new ScalingHostPoolReference().withHostPoolArmPath("lg").withScalingPlanEnabled(true), + new ScalingHostPoolReference().withHostPoolArmPath("tvsexsowuel").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("wyt", model.description()); + Assertions.assertEquals("ib", model.friendlyName()); + Assertions.assertEquals("rcgp", model.timeZone()); + Assertions.assertEquals(ScalingHostPoolType.PERSONAL, model.hostPoolType()); + Assertions.assertEquals("imejzanl", model.exclusionTag()); + Assertions.assertEquals("av", model.schedules().get(0).name()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.schedules().get(0).scalingMethod()); + Assertions.assertEquals(1961298292, model.schedules().get(0).createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(485732763, model.schedules().get(0).createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(1432241544, model.schedules().get(0).createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(749799353, model.schedules().get(0).createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1507022412, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(2101008571, 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(1689158951, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(1438056618, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(289139579, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1822187571, 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, + Assertions.assertEquals(409653705, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1723984044, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_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, + Assertions.assertEquals(369486551, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(941939967, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertFalse(model.schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(1832307115, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("flsjc", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(1421362478, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(402907816, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("qagnbuyn", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals("gofel", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertTrue(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 index e0041f4c6d76..814251a0b673 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.scalingPlans().deleteByResourceGroupWithResponse("op", "hbzxli", com.azure.core.util.Context.NONE); + manager.scalingPlans() + .deleteByResourceGroupWithResponse("hycvdimwrzre", "zgyufutrwp", 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 index b55240c79fcf..78a543f3c6e1 100644 --- 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 @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CreateDeleteProperties; +import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; +import com.azure.resourcemanager.desktopvirtualization.models.ScalingMethodType; 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; @@ -17,78 +19,89 @@ 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\"}") + "{\"name\":\"ahhxvrh\",\"daysOfWeek\":[\"Monday\",\"Monday\",\"Monday\",\"Friday\"],\"scalingMethod\":\"CreateDeletePowerManage\",\"createDelete\":{\"rampUpMaximumHostPoolSize\":2038816187,\"rampUpMinimumHostPoolSize\":1806327837,\"rampDownMaximumHostPoolSize\":665016103,\"rampDownMinimumHostPoolSize\":1926831328},\"rampUpStartTime\":{\"hour\":1227202155,\"minute\":757221546},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":318834407,\"rampUpCapacityThresholdPct\":649615996,\"peakStartTime\":{\"hour\":1485711526,\"minute\":1615725858},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1490533084,\"minute\":1889807539},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1040551397,\"rampDownCapacityThresholdPct\":1159016951,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":528928075,\"rampDownNotificationMessage\":\"hwhbotzingamv\",\"offPeakStartTime\":{\"hour\":313573135,\"minute\":104730978},\"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("ahhxvrh", model.name()); + Assertions.assertEquals(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(2038816187, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1806327837, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(665016103, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1926831328, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1227202155, model.rampUpStartTime().hour()); + Assertions.assertEquals(757221546, 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(318834407, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(649615996, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1485711526, model.peakStartTime().hour()); + Assertions.assertEquals(1615725858, 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(1490533084, model.rampDownStartTime().hour()); + Assertions.assertEquals(1889807539, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1040551397, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1159016951, model.rampDownCapacityThresholdPct()); + Assertions.assertFalse(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(528928075, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("hwhbotzingamv", model.rampDownNotificationMessage()); + Assertions.assertEquals(313573135, model.offPeakStartTime().hour()); + Assertions.assertEquals(104730978, 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)) + ScalingSchedule model = new ScalingSchedule().withName("ahhxvrh") + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.MONDAY, DayOfWeek.MONDAY, DayOfWeek.FRIDAY)) + .withScalingMethod(ScalingMethodType.CREATE_DELETE_POWER_MANAGE) + .withCreateDelete(new CreateDeleteProperties().withRampUpMaximumHostPoolSize(2038816187) + .withRampUpMinimumHostPoolSize(1806327837) + .withRampDownMaximumHostPoolSize(665016103) + .withRampDownMinimumHostPoolSize(1926831328)) + .withRampUpStartTime(new Time().withHour(1227202155).withMinute(757221546)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(840461055) - .withRampUpCapacityThresholdPct(18555434) - .withPeakStartTime(new Time().withHour(480744947).withMinute(1899471786)) + .withRampUpMinimumHostsPct(318834407) + .withRampUpCapacityThresholdPct(649615996) + .withPeakStartTime(new Time().withHour(1485711526).withMinute(1615725858)) .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(79339755).withMinute(1474388654)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1850668583) - .withRampDownCapacityThresholdPct(1795094625) + .withRampDownStartTime(new Time().withHour(1490533084).withMinute(1889807539)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(1040551397) + .withRampDownCapacityThresholdPct(1159016951) .withRampDownForceLogoffUsers(false) .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1074926668) - .withRampDownNotificationMessage("tkcxywnytnrsy") - .withOffPeakStartTime(new Time().withHour(1857239406).withMinute(123803740)) + .withRampDownWaitTimeMinutes(528928075) + .withRampDownNotificationMessage("hwhbotzingamv") + .withOffPeakStartTime(new Time().withHour(313573135).withMinute(104730978)) .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("ahhxvrh", model.name()); + Assertions.assertEquals(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(ScalingMethodType.CREATE_DELETE_POWER_MANAGE, model.scalingMethod()); + Assertions.assertEquals(2038816187, model.createDelete().rampUpMaximumHostPoolSize()); + Assertions.assertEquals(1806327837, model.createDelete().rampUpMinimumHostPoolSize()); + Assertions.assertEquals(665016103, model.createDelete().rampDownMaximumHostPoolSize()); + Assertions.assertEquals(1926831328, model.createDelete().rampDownMinimumHostPoolSize()); + Assertions.assertEquals(1227202155, model.rampUpStartTime().hour()); + Assertions.assertEquals(757221546, 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(318834407, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(649615996, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1485711526, model.peakStartTime().hour()); + Assertions.assertEquals(1615725858, 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(1490533084, model.rampDownStartTime().hour()); + Assertions.assertEquals(1889807539, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1040551397, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1159016951, model.rampDownCapacityThresholdPct()); + Assertions.assertFalse(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(528928075, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("hwhbotzingamv", model.rampDownNotificationMessage()); + Assertions.assertEquals(313573135, model.offPeakStartTime().hour()); + Assertions.assertEquals(104730978, 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/ScopedRegistrationTokenPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScopedRegistrationTokenPropertiesTests.java new file mode 100644 index 000000000000..62249d8d68b4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScopedRegistrationTokenPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.ScopedRegistrationTokenProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ScopedRegistrationTokenPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ScopedRegistrationTokenProperties model + = BinaryData.fromString("{\"expirationTimeInUtc\":\"2021-05-04T02:40:34Z\"}") + .toObject(ScopedRegistrationTokenProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T02:40:34Z"), model.expirationTimeInUtc()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ScopedRegistrationTokenProperties model = new ScopedRegistrationTokenProperties() + .withExpirationTimeInUtc(OffsetDateTime.parse("2021-05-04T02:40:34Z")); + model = BinaryData.fromObject(model).toObject(ScopedRegistrationTokenProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T02:40:34Z"), model.expirationTimeInUtc()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPatchPropertiesTests.java new file mode 100644 index 000000000000..f9544347f4b0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPatchPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import org.junit.jupiter.api.Assertions; + +public final class SecurityInfoPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SecurityInfoPatchProperties model + = BinaryData.fromString("{\"type\":\"ConfidentialVM\",\"secureBootEnabled\":true,\"vTpmEnabled\":true}") + .toObject(SecurityInfoPatchProperties.class); + Assertions.assertEquals(VirtualMachineSecurityType.CONFIDENTIAL_VM, model.type()); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertTrue(model.vTpmEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SecurityInfoPatchProperties model + = new SecurityInfoPatchProperties().withType(VirtualMachineSecurityType.CONFIDENTIAL_VM) + .withSecureBootEnabled(true) + .withVTpmEnabled(true); + model = BinaryData.fromObject(model).toObject(SecurityInfoPatchProperties.class); + Assertions.assertEquals(VirtualMachineSecurityType.CONFIDENTIAL_VM, model.type()); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertTrue(model.vTpmEnabled()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPropertiesTests.java new file mode 100644 index 000000000000..08f9a51ac453 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SecurityInfoPropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.SecurityInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.VirtualMachineSecurityType; +import org.junit.jupiter.api.Assertions; + +public final class SecurityInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SecurityInfoProperties model + = BinaryData.fromString("{\"type\":\"ConfidentialVM\",\"secureBootEnabled\":true,\"vTpmEnabled\":false}") + .toObject(SecurityInfoProperties.class); + Assertions.assertEquals(VirtualMachineSecurityType.CONFIDENTIAL_VM, model.type()); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SecurityInfoProperties model = new SecurityInfoProperties().withType(VirtualMachineSecurityType.CONFIDENTIAL_VM) + .withSecureBootEnabled(true) + .withVTpmEnabled(false); + model = BinaryData.fromObject(model).toObject(SecurityInfoProperties.class); + Assertions.assertEquals(VirtualMachineSecurityType.CONFIDENTIAL_VM, model.type()); + Assertions.assertTrue(model.secureBootEnabled()); + Assertions.assertFalse(model.vTpmEnabled()); + } +} 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 index 369ac59ab138..91775694591b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,17 +11,17 @@ public final class SendMessageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SendMessage model = BinaryData.fromString("{\"messageTitle\":\"zrxcczurt\",\"messageBody\":\"ipqxbkwvzgnzv\"}") + SendMessage model = BinaryData.fromString("{\"messageTitle\":\"p\",\"messageBody\":\"lxveabfqx\"}") .toObject(SendMessage.class); - Assertions.assertEquals("zrxcczurt", model.messageTitle()); - Assertions.assertEquals("ipqxbkwvzgnzv", model.messageBody()); + Assertions.assertEquals("p", model.messageTitle()); + Assertions.assertEquals("lxveabfqx", model.messageBody()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SendMessage model = new SendMessage().withMessageTitle("zrxcczurt").withMessageBody("ipqxbkwvzgnzv"); + SendMessage model = new SendMessage().withMessageTitle("p").withMessageBody("lxveabfqx"); model = BinaryData.fromObject(model).toObject(SendMessage.class); - Assertions.assertEquals("zrxcczurt", model.messageTitle()); - Assertions.assertEquals("ipqxbkwvzgnzv", model.messageBody()); + Assertions.assertEquals("p", model.messageTitle()); + Assertions.assertEquals("lxveabfqx", 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 index b4ab4b2bd41d..524ca8980339 100644 --- 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 @@ -1,35 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}") + "{\"logSpecifications\":[{\"name\":\"hkryhtn\",\"displayName\":\"czwlokjyem\",\"blobDuration\":\"vnipjox\"},{\"name\":\"nchgej\",\"displayName\":\"odmailzyd\",\"blobDuration\":\"o\"}]}") .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()); + Assertions.assertEquals("hkryhtn", model.logSpecifications().get(0).name()); + Assertions.assertEquals("czwlokjyem", model.logSpecifications().get(0).displayName()); + Assertions.assertEquals("vnipjox", 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 index 3e96a4977cc6..e62196eb6d36 100644 --- 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 @@ -1,84 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostList; 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\"}") + "{\"value\":[{\"properties\":{\"activeSessions\":2027553854,\"disconnectedSessions\":1456659976,\"pendingSessions\":1517277198,\"objectId\":\"cvuzhyrmewipmve\",\"lastHeartBeat\":\"2021-08-31T14:00:37Z\",\"sessions\":1888237693,\"agentVersion\":\"qgsjjxun\",\"allowNewSession\":true,\"virtualMachineId\":\"etw\",\"resourceId\":\"hzjhf\",\"assignedUser\":\"hvvmuvgpmun\",\"friendlyName\":\"sx\",\"status\":\"Upgrading\",\"statusTimestamp\":\"2021-05-19T22:03:11Z\",\"osVersion\":\"zjyi\",\"sxSStackVersion\":\"as\",\"updateState\":\"Initial\",\"lastUpdateTime\":\"2021-02-11T17:22:49Z\",\"updateErrorMessage\":\"ohyuemslynsq\",\"lastSessionHostUpdateTime\":\"2021-11-05T17:04:19Z\",\"sessionHostConfiguration\":\"oobrlttyms\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"AppAttachHealthCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"WebRTCRedirectorCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"hnfhqlyvijouwi\",\"name\":\"kxoyzunbixxr\",\"type\":\"ikvcpwp\"},{\"properties\":{\"activeSessions\":473486179,\"disconnectedSessions\":1524414301,\"pendingSessions\":537948103,\"objectId\":\"oxfrkenxpmyyefr\",\"lastHeartBeat\":\"2021-03-28T22:38:24Z\",\"sessions\":898501663,\"agentVersion\":\"qskaw\",\"allowNewSession\":false,\"virtualMachineId\":\"mmbnpqfrtql\",\"resourceId\":\"megni\",\"assignedUser\":\"vkxlz\",\"friendlyName\":\"drf\",\"status\":\"DomainTrustRelationshipLost\",\"statusTimestamp\":\"2020-12-21T05:11:04Z\",\"osVersion\":\"zxwhcansymoyqhlw\",\"sxSStackVersion\":\"divb\",\"updateState\":\"Failed\",\"lastUpdateTime\":\"2021-08-21T17:47:06Z\",\"updateErrorMessage\":\"fajuwas\",\"lastSessionHostUpdateTime\":\"2021-11-11T15:30:01Z\",\"sessionHostConfiguration\":\"e\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"DomainTrustCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"MonitoringAgentCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}}]},\"id\":\"ezkgi\",\"name\":\"sidxasicdd\",\"type\":\"vvjskgfmocwahp\"},{\"properties\":{\"activeSessions\":789499857,\"disconnectedSessions\":474100011,\"pendingSessions\":187526121,\"objectId\":\"hvjhhnakzyb\",\"lastHeartBeat\":\"2021-11-17T05:23:09Z\",\"sessions\":371006756,\"agentVersion\":\"ksyxkyxvxevblbje\",\"allowNewSession\":true,\"virtualMachineId\":\"lageuaulxun\",\"resourceId\":\"jbnkpp\",\"assignedUser\":\"nenlsvxeizzg\",\"friendlyName\":\"lnsrmffe\",\"status\":\"DomainTrustRelationshipLost\",\"statusTimestamp\":\"2021-11-12T07:53:20Z\",\"osVersion\":\"piymerteea\",\"sxSStackVersion\":\"xqiekkkzddrtk\",\"updateState\":\"Initial\",\"lastUpdateTime\":\"2021-02-24T03:49:03Z\",\"updateErrorMessage\":\"xv\",\"lastSessionHostUpdateTime\":\"2021-02-28T00:16:23Z\",\"sessionHostConfiguration\":\"fdeesvecuijpxtx\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"SxSStackListenerCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"DomainTrustCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}}]},\"id\":\"jibabxvititvtze\",\"name\":\"xavo\",\"type\":\"tfgle\"},{\"properties\":{\"activeSessions\":1391311949,\"disconnectedSessions\":1527840088,\"pendingSessions\":219424992,\"objectId\":\"pqtgsfjac\",\"lastHeartBeat\":\"2021-12-08T10:07:16Z\",\"sessions\":797455663,\"agentVersion\":\"udbxv\",\"allowNewSession\":false,\"virtualMachineId\":\"nsiru\",\"resourceId\":\"z\",\"assignedUser\":\"es\",\"friendlyName\":\"dlpagzrcxfail\",\"status\":\"UpgradeFailed\",\"statusTimestamp\":\"2021-01-02T05:19:40Z\",\"osVersion\":\"boxdfgsftufq\",\"sxSStackVersion\":\"rjlnacgcck\",\"updateState\":\"Succeeded\",\"lastUpdateTime\":\"2021-11-17T08:02:17Z\",\"updateErrorMessage\":\"zvytnrzvuljraaer\",\"lastSessionHostUpdateTime\":\"2021-10-31T19:51:57Z\",\"sessionHostConfiguration\":\"qgukkjqnv\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"DomainJoinedCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}}]},\"id\":\"dosfjbjsvgjrw\",\"name\":\"r\",\"type\":\"vyc\"}],\"nextLink\":\"dclxgc\"}") .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()); + Assertions.assertTrue(model.value().get(0).properties().allowNewSession()); + Assertions.assertEquals("hvvmuvgpmun", model.value().get(0).properties().assignedUser()); + Assertions.assertEquals("sx", model.value().get(0).properties().friendlyName()); + Assertions.assertEquals("dclxgc", model.nextLink()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementInnerTests.java new file mode 100644 index 000000000000..a5deac3b7a1b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementInnerTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementInner model = BinaryData.fromString( + "{\"properties\":{\"scheduledDateTimeZone\":\"mozqv\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":1527191203,\"logOffDelayMinutes\":352304296,\"logOffMessage\":\"m\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":1081864935,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepNone\"},\"id\":\"ttaboidvmfqh\",\"name\":\"pubowsepdfg\",\"type\":\"mtdherngb\"}") + .toObject(SessionHostManagementInner.class); + Assertions.assertEquals("mozqv", model.properties().scheduledDateTimeZone()); + Assertions.assertTrue(model.properties().update().deleteOriginalVm()); + Assertions.assertEquals(1527191203, model.properties().update().maxVmsRemoved()); + Assertions.assertEquals(352304296, model.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("m", model.properties().update().logOffMessage()); + Assertions.assertFalse(model.properties().provisioning().setDrainMode()); + Assertions.assertEquals(1081864935, model.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, + model.properties().failedSessionHostCleanupPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostManagementInner model = new SessionHostManagementInner() + .withProperties(new SessionHostManagementProperties().withScheduledDateTimeZone("mozqv") + .withUpdate(new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(1527191203) + .withLogOffDelayMinutes(352304296) + .withLogOffMessage("m")) + .withProvisioning(new SessionHostProvisioningConfigurationProperties().withSetDrainMode(false) + .withInstanceCount(1081864935) + .withCanaryPolicy(CanaryPolicy.AUTO)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_NONE)); + model = BinaryData.fromObject(model).toObject(SessionHostManagementInner.class); + Assertions.assertEquals("mozqv", model.properties().scheduledDateTimeZone()); + Assertions.assertTrue(model.properties().update().deleteOriginalVm()); + Assertions.assertEquals(1527191203, model.properties().update().maxVmsRemoved()); + Assertions.assertEquals(352304296, model.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("m", model.properties().update().logOffMessage()); + Assertions.assertFalse(model.properties().provisioning().setDrainMode()); + Assertions.assertEquals(1081864935, model.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, + model.properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementListTests.java new file mode 100644 index 000000000000..4ae37a751e88 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementListTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.implementation.models.SessionHostManagementList; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"scheduledDateTimeZone\":\"cxlzhcoxovnekh\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":1211105711,\"logOffDelayMinutes\":178088005,\"logOffMessage\":\"nrd\"},\"provisioning\":{\"setDrainMode\":true,\"instanceCount\":199787583,\"canaryPolicy\":\"Never\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"vidttgepuslvyjt\",\"name\":\"vuwkasiziesfuugh\",\"type\":\"uqfecj\"},{\"properties\":{\"scheduledDateTimeZone\":\"ey\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":1069323908,\"logOffDelayMinutes\":420215863,\"logOffMessage\":\"ic\"},\"provisioning\":{\"setDrainMode\":true,\"instanceCount\":1244497957,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"xuzrhwpusxjba\",\"name\":\"ehgpdohzjqatu\",\"type\":\"o\"},{\"properties\":{\"scheduledDateTimeZone\":\"gebx\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":612007503,\"logOffDelayMinutes\":1297509585,\"logOffMessage\":\"pbnwgfmxjgcg\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":1945298143,\"canaryPolicy\":\"Never\"},\"failedSessionHostCleanupPolicy\":\"KeepOne\"},\"id\":\"snaquf\",\"name\":\"qbctqha\",\"type\":\"zjrwdkqze\"},{\"properties\":{\"scheduledDateTimeZone\":\"yjleziunjx\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":1729459550,\"logOffDelayMinutes\":1904404893,\"logOffMessage\":\"kwcegyamlbn\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":1101385669,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"guooqjagmdit\",\"name\":\"ueio\",\"type\":\"kjbsah\"}],\"nextLink\":\"dt\"}") + .toObject(SessionHostManagementList.class); + Assertions.assertEquals("cxlzhcoxovnekh", model.value().get(0).properties().scheduledDateTimeZone()); + Assertions.assertTrue(model.value().get(0).properties().update().deleteOriginalVm()); + Assertions.assertEquals(1211105711, model.value().get(0).properties().update().maxVmsRemoved()); + Assertions.assertEquals(178088005, model.value().get(0).properties().update().logOffDelayMinutes()); + Assertions.assertEquals("nrd", model.value().get(0).properties().update().logOffMessage()); + Assertions.assertTrue(model.value().get(0).properties().provisioning().setDrainMode()); + Assertions.assertEquals(199787583, model.value().get(0).properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.NEVER, model.value().get(0).properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ALL, + model.value().get(0).properties().failedSessionHostCleanupPolicy()); + Assertions.assertEquals("dt", model.nextLink()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementOperationProgressTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementOperationProgressTests.java new file mode 100644 index 000000000000..142921a0973c --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementOperationProgressTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementOperationProgress; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementOperationProgressTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementOperationProgress model = BinaryData.fromString( + "{\"executionStartTime\":\"2021-07-31T13:34:42Z\",\"totalSessionHosts\":614455249,\"sessionHostsInProgress\":593311439,\"sessionHostsCompleted\":661153299,\"sessionHostsRollbackFailed\":475806934}") + .toObject(SessionHostManagementOperationProgress.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T13:34:42Z"), model.executionStartTime()); + Assertions.assertEquals(614455249, model.totalSessionHosts()); + Assertions.assertEquals(593311439, model.sessionHostsInProgress()); + Assertions.assertEquals(661153299, model.sessionHostsCompleted()); + Assertions.assertEquals(475806934, model.sessionHostsRollbackFailed()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchPropertiesTests.java new file mode 100644 index 000000000000..67b7a4175cc8 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchPropertiesTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementPatchProperties model = BinaryData.fromString( + "{\"scheduledDateTimeZone\":\"mlmuowol\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":139700298,\"logOffDelayMinutes\":110888706,\"logOffMessage\":\"nszonwpngaj\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":850455603,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepNone\"}") + .toObject(SessionHostManagementPatchProperties.class); + Assertions.assertEquals("mlmuowol", model.scheduledDateTimeZone()); + Assertions.assertTrue(model.update().deleteOriginalVm()); + Assertions.assertEquals(139700298, model.update().maxVmsRemoved()); + Assertions.assertEquals(110888706, model.update().logOffDelayMinutes()); + Assertions.assertEquals("nszonwpngaj", model.update().logOffMessage()); + Assertions.assertFalse(model.provisioning().setDrainMode()); + Assertions.assertEquals(850455603, model.provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, model.failedSessionHostCleanupPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostManagementPatchProperties model + = new SessionHostManagementPatchProperties().withScheduledDateTimeZone("mlmuowol") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(139700298) + .withLogOffDelayMinutes(110888706) + .withLogOffMessage("nszonwpngaj")) + .withProvisioning(new SessionHostProvisioningConfigurationPatchProperties().withSetDrainMode(false) + .withInstanceCount(850455603) + .withCanaryPolicy(CanaryPolicy.AUTO)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_NONE); + model = BinaryData.fromObject(model).toObject(SessionHostManagementPatchProperties.class); + Assertions.assertEquals("mlmuowol", model.scheduledDateTimeZone()); + Assertions.assertTrue(model.update().deleteOriginalVm()); + Assertions.assertEquals(139700298, model.update().maxVmsRemoved()); + Assertions.assertEquals(110888706, model.update().logOffDelayMinutes()); + Assertions.assertEquals("nszonwpngaj", model.update().logOffMessage()); + Assertions.assertFalse(model.provisioning().setDrainMode()); + Assertions.assertEquals(850455603, model.provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, model.failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchTests.java new file mode 100644 index 000000000000..819ab99a2a46 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPatchTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementPatch model = BinaryData.fromString( + "{\"properties\":{\"scheduledDateTimeZone\":\"pdwrpqafgfugsn\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":1701232505,\"logOffDelayMinutes\":1268019829,\"logOffMessage\":\"pococtfjgt\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":868896591,\"canaryPolicy\":\"Always\"},\"failedSessionHostCleanupPolicy\":\"KeepOne\"}}") + .toObject(SessionHostManagementPatch.class); + Assertions.assertEquals("pdwrpqafgfugsn", model.properties().scheduledDateTimeZone()); + Assertions.assertFalse(model.properties().update().deleteOriginalVm()); + Assertions.assertEquals(1701232505, model.properties().update().maxVmsRemoved()); + Assertions.assertEquals(1268019829, model.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("pococtfjgt", model.properties().update().logOffMessage()); + Assertions.assertFalse(model.properties().provisioning().setDrainMode()); + Assertions.assertEquals(868896591, model.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.ALWAYS, model.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ONE, + model.properties().failedSessionHostCleanupPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostManagementPatch model = new SessionHostManagementPatch() + .withProperties(new SessionHostManagementPatchProperties().withScheduledDateTimeZone("pdwrpqafgfugsn") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(false) + .withMaxVmsRemoved(1701232505) + .withLogOffDelayMinutes(1268019829) + .withLogOffMessage("pococtfjgt")) + .withProvisioning(new SessionHostProvisioningConfigurationPatchProperties().withSetDrainMode(false) + .withInstanceCount(868896591) + .withCanaryPolicy(CanaryPolicy.ALWAYS)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_ONE)); + model = BinaryData.fromObject(model).toObject(SessionHostManagementPatch.class); + Assertions.assertEquals("pdwrpqafgfugsn", model.properties().scheduledDateTimeZone()); + Assertions.assertFalse(model.properties().update().deleteOriginalVm()); + Assertions.assertEquals(1701232505, model.properties().update().maxVmsRemoved()); + Assertions.assertEquals(1268019829, model.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("pococtfjgt", model.properties().update().logOffMessage()); + Assertions.assertFalse(model.properties().provisioning().setDrainMode()); + Assertions.assertEquals(868896591, model.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.ALWAYS, model.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ONE, + model.properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPropertiesTests.java new file mode 100644 index 000000000000..1a7ad8098d54 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementPropertiesTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementProperties model = BinaryData.fromString( + "{\"scheduledDateTimeZone\":\"c\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":812344780,\"logOffDelayMinutes\":1780706475,\"logOffMessage\":\"qtobkauxo\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":2026561686,\"canaryPolicy\":\"Always\"},\"failedSessionHostCleanupPolicy\":\"KeepOne\"}") + .toObject(SessionHostManagementProperties.class); + Assertions.assertEquals("c", model.scheduledDateTimeZone()); + Assertions.assertTrue(model.update().deleteOriginalVm()); + Assertions.assertEquals(812344780, model.update().maxVmsRemoved()); + Assertions.assertEquals(1780706475, model.update().logOffDelayMinutes()); + Assertions.assertEquals("qtobkauxo", model.update().logOffMessage()); + Assertions.assertFalse(model.provisioning().setDrainMode()); + Assertions.assertEquals(2026561686, model.provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.ALWAYS, model.provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ONE, model.failedSessionHostCleanupPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostManagementProperties model = new SessionHostManagementProperties().withScheduledDateTimeZone("c") + .withUpdate(new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(true) + .withMaxVmsRemoved(812344780) + .withLogOffDelayMinutes(1780706475) + .withLogOffMessage("qtobkauxo")) + .withProvisioning(new SessionHostProvisioningConfigurationProperties().withSetDrainMode(false) + .withInstanceCount(2026561686) + .withCanaryPolicy(CanaryPolicy.ALWAYS)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_ONE); + model = BinaryData.fromObject(model).toObject(SessionHostManagementProperties.class); + Assertions.assertEquals("c", model.scheduledDateTimeZone()); + Assertions.assertTrue(model.update().deleteOriginalVm()); + Assertions.assertEquals(812344780, model.update().maxVmsRemoved()); + Assertions.assertEquals(1780706475, model.update().logOffDelayMinutes()); + Assertions.assertEquals("qtobkauxo", model.update().logOffMessage()); + Assertions.assertFalse(model.provisioning().setDrainMode()); + Assertions.assertEquals(2026561686, model.provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.ALWAYS, model.provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ONE, model.failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningOperationProgressTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningOperationProgressTests.java new file mode 100644 index 000000000000..2d83b6b84589 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningOperationProgressTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProvisioningOperationProgress; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementProvisioningOperationProgressTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementProvisioningOperationProgress model = BinaryData.fromString( + "{\"executionStartTime\":\"2021-10-16T17:25:27Z\",\"sessionHostsInProgress\":1570920234,\"sessionHostsCompleted\":2098232558,\"finalSessionHostsCount\":834201327,\"initialSessionHostsCount\":1328512898}") + .toObject(SessionHostManagementProvisioningOperationProgress.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T17:25:27Z"), model.executionStartTime()); + Assertions.assertEquals(1570920234, model.sessionHostsInProgress()); + Assertions.assertEquals(2098232558, model.sessionHostsCompleted()); + Assertions.assertEquals(834201327, model.finalSessionHostsCount()); + Assertions.assertEquals(1328512898, model.initialSessionHostsCount()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusPropertiesInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusPropertiesInnerTests.java new file mode 100644 index 000000000000..d55b68cf8907 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementProvisioningStatusPropertiesInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementProvisioningStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementProvisioningStatusPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementProvisioningStatusPropertiesInner model = BinaryData.fromString( + "{\"correlationId\":\"c\",\"progress\":{\"executionStartTime\":\"2021-06-04T02:53:26Z\",\"sessionHostsInProgress\":1991575166,\"sessionHostsCompleted\":1115246881,\"finalSessionHostsCount\":2045094401,\"initialSessionHostsCount\":1928813132},\"scheduledDateTime\":\"2021-03-23T04:03:08Z\",\"sessionHostManagement\":{\"properties\":{\"scheduledDateTimeZone\":\"kcdxfzzzw\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":1254834753,\"logOffDelayMinutes\":1889277998,\"logOffMessage\":\"lhguyn\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":941663280,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"hmoz\",\"name\":\"sgzv\",\"type\":\"ns\"}}") + .toObject(SessionHostManagementProvisioningStatusPropertiesInner.class); + Assertions.assertEquals("c", model.correlationId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T02:53:26Z"), model.progress().executionStartTime()); + Assertions.assertEquals(1991575166, model.progress().sessionHostsInProgress()); + Assertions.assertEquals(1115246881, model.progress().sessionHostsCompleted()); + Assertions.assertEquals(2045094401, model.progress().finalSessionHostsCount()); + Assertions.assertEquals(1928813132, model.progress().initialSessionHostsCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T04:03:08Z"), model.scheduledDateTime()); + Assertions.assertEquals("kcdxfzzzw", model.sessionHostManagement().properties().scheduledDateTimeZone()); + Assertions.assertTrue(model.sessionHostManagement().properties().update().deleteOriginalVm()); + Assertions.assertEquals(1254834753, model.sessionHostManagement().properties().update().maxVmsRemoved()); + Assertions.assertEquals(1889277998, model.sessionHostManagement().properties().update().logOffDelayMinutes()); + Assertions.assertEquals("lhguyn", model.sessionHostManagement().properties().update().logOffMessage()); + Assertions.assertFalse(model.sessionHostManagement().properties().provisioning().setDrainMode()); + Assertions.assertEquals(941663280, model.sessionHostManagement().properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, + model.sessionHostManagement().properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ALL, + model.sessionHostManagement().properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementUpdateStatusPropertiesInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementUpdateStatusPropertiesInnerTests.java new file mode 100644 index 000000000000..9bbaacdc7e3d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementUpdateStatusPropertiesInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementUpdateStatusPropertiesInner; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostManagementUpdateStatusPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostManagementUpdateStatusPropertiesInner model = BinaryData.fromString( + "{\"correlationId\":\"fuzt\",\"progress\":{\"executionStartTime\":\"2021-09-08T11:30:17Z\",\"totalSessionHosts\":629434147,\"sessionHostsInProgress\":1490631232,\"sessionHostsCompleted\":1618970280,\"sessionHostsRollbackFailed\":964359974},\"scheduledDateTime\":\"2021-02-26T15:52:07Z\",\"sessionHostManagement\":{\"properties\":{\"scheduledDateTimeZone\":\"ukoveofi\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":635551767,\"logOffDelayMinutes\":27775403,\"logOffMessage\":\"mjm\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":609194014,\"canaryPolicy\":\"Never\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"jrllf\",\"name\":\"juid\",\"type\":\"puuyjucejik\"}}") + .toObject(SessionHostManagementUpdateStatusPropertiesInner.class); + Assertions.assertEquals("fuzt", model.correlationId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-08T11:30:17Z"), model.progress().executionStartTime()); + Assertions.assertEquals(629434147, model.progress().totalSessionHosts()); + Assertions.assertEquals(1490631232, model.progress().sessionHostsInProgress()); + Assertions.assertEquals(1618970280, model.progress().sessionHostsCompleted()); + Assertions.assertEquals(964359974, model.progress().sessionHostsRollbackFailed()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T15:52:07Z"), model.scheduledDateTime()); + Assertions.assertEquals("ukoveofi", model.sessionHostManagement().properties().scheduledDateTimeZone()); + Assertions.assertFalse(model.sessionHostManagement().properties().update().deleteOriginalVm()); + Assertions.assertEquals(635551767, model.sessionHostManagement().properties().update().maxVmsRemoved()); + Assertions.assertEquals(27775403, model.sessionHostManagement().properties().update().logOffDelayMinutes()); + Assertions.assertEquals("mjm", model.sessionHostManagement().properties().update().logOffMessage()); + Assertions.assertFalse(model.sessionHostManagement().properties().provisioning().setDrainMode()); + Assertions.assertEquals(609194014, model.sessionHostManagement().properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.NEVER, + model.sessionHostManagement().properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ALL, + model.sessionHostManagement().properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..21d6014ae287 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostManagementInner; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationProperties; +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 SessionHostManagementsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"scheduledDateTimeZone\":\"fhglhrfo\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":1353118149,\"logOffDelayMinutes\":1742146388,\"logOffMessage\":\"snhpcselqx\"},\"provisioning\":{\"setDrainMode\":true,\"instanceCount\":981924301,\"canaryPolicy\":\"Never\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"vzrlrmlcc\",\"name\":\"etjsczivfqbqna\",\"type\":\"dsyenzsieuscpl\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SessionHostManagement response + = manager.sessionHostManagements() + .createOrUpdateWithResponse("zfc", "fpfbodetres", + new SessionHostManagementInner().withProperties(new SessionHostManagementProperties() + .withScheduledDateTimeZone("gvtshu") + .withUpdate(new HostPoolUpdateConfigurationProperties().withDeleteOriginalVm(false) + .withMaxVmsRemoved(986832251) + .withLogOffDelayMinutes(294215525) + .withLogOffMessage("vmuqke")) + .withProvisioning(new SessionHostProvisioningConfigurationProperties().withSetDrainMode(true) + .withInstanceCount(1013348725) + .withCanaryPolicy(CanaryPolicy.NEVER)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_ALL)), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fhglhrfo", response.properties().scheduledDateTimeZone()); + Assertions.assertFalse(response.properties().update().deleteOriginalVm()); + Assertions.assertEquals(1353118149, response.properties().update().maxVmsRemoved()); + Assertions.assertEquals(1742146388, response.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("snhpcselqx", response.properties().update().logOffMessage()); + Assertions.assertTrue(response.properties().provisioning().setDrainMode()); + Assertions.assertEquals(981924301, response.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.NEVER, response.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ALL, + response.properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetWithResponseMockTests.java new file mode 100644 index 000000000000..2fa042a32cf2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsGetWithResponseMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +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 SessionHostManagementsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"scheduledDateTimeZone\":\"xprwpxs\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":903146962,\"logOffDelayMinutes\":1448998397,\"logOffMessage\":\"lcsklt\"},\"provisioning\":{\"setDrainMode\":true,\"instanceCount\":1224275689,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepNone\"},\"id\":\"grdcgubsrtmdy\",\"name\":\"perpi\",\"type\":\"ttjzg\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SessionHostManagement response = manager.sessionHostManagements() + .getWithResponse("kscvgllixdgbyf", "wewqkj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xprwpxs", response.properties().scheduledDateTimeZone()); + Assertions.assertFalse(response.properties().update().deleteOriginalVm()); + Assertions.assertEquals(903146962, response.properties().update().maxVmsRemoved()); + Assertions.assertEquals(1448998397, response.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("lcsklt", response.properties().update().logOffMessage()); + Assertions.assertTrue(response.properties().provisioning().setDrainMode()); + Assertions.assertEquals(1224275689, response.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, response.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, + response.properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolMockTests.java new file mode 100644 index 000000000000..7be1ead3c71f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsListByHostPoolMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +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 SessionHostManagementsListByHostPoolMockTests { + @Test + public void testListByHostPool() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"scheduledDateTimeZone\":\"i\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":1319725108,\"logOffDelayMinutes\":97978304,\"logOffMessage\":\"vgpomxpupdtsdfj\"},\"provisioning\":{\"setDrainMode\":true,\"instanceCount\":169484073,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepAll\"},\"id\":\"outmp\",\"name\":\"zgleofjsbg\",\"type\":\"wwzvdaj\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.sessionHostManagements().listByHostPool("mip", "mliqmvlb", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("i", response.iterator().next().properties().scheduledDateTimeZone()); + Assertions.assertFalse(response.iterator().next().properties().update().deleteOriginalVm()); + Assertions.assertEquals(1319725108, response.iterator().next().properties().update().maxVmsRemoved()); + Assertions.assertEquals(97978304, response.iterator().next().properties().update().logOffDelayMinutes()); + Assertions.assertEquals("vgpomxpupdtsdfj", response.iterator().next().properties().update().logOffMessage()); + Assertions.assertTrue(response.iterator().next().properties().provisioning().setDrainMode()); + Assertions.assertEquals(169484073, response.iterator().next().properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, + response.iterator().next().properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_ALL, + response.iterator().next().properties().failedSessionHostCleanupPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..e258f95deebf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostManagementsUpdateWithResponseMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.FailedSessionHostCleanupPolicySHC; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagement; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostManagementPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationPatchProperties; +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 SessionHostManagementsUpdateWithResponseMockTests { + @Test + public void testUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"scheduledDateTimeZone\":\"pztgazwyqejgaaok\",\"update\":{\"deleteOriginalVm\":true,\"maxVmsRemoved\":938160016,\"logOffDelayMinutes\":1939785764,\"logOffMessage\":\"gkqzkcyzmffngdyf\"},\"provisioning\":{\"setDrainMode\":false,\"instanceCount\":1846854403,\"canaryPolicy\":\"Auto\"},\"failedSessionHostCleanupPolicy\":\"KeepNone\"},\"id\":\"ejgoiutgwrmka\",\"name\":\"p\",\"type\":\"hazyntacihnco\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SessionHostManagement response = manager.sessionHostManagements() + .updateWithResponse("yvdgxlyzk", "itdshezsvkolru", + new SessionHostManagementPatch().withProperties(new SessionHostManagementPatchProperties() + .withScheduledDateTimeZone("vmozsayebrazwz") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(false) + .withMaxVmsRemoved(2073599698) + .withLogOffDelayMinutes(1554731453) + .withLogOffMessage("ykipfsdyepf")) + .withProvisioning(new SessionHostProvisioningConfigurationPatchProperties().withSetDrainMode(true) + .withInstanceCount(449538158) + .withCanaryPolicy(CanaryPolicy.AUTO)) + .withFailedSessionHostCleanupPolicy(FailedSessionHostCleanupPolicySHC.KEEP_ONE)), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pztgazwyqejgaaok", response.properties().scheduledDateTimeZone()); + Assertions.assertTrue(response.properties().update().deleteOriginalVm()); + Assertions.assertEquals(938160016, response.properties().update().maxVmsRemoved()); + Assertions.assertEquals(1939785764, response.properties().update().logOffDelayMinutes()); + Assertions.assertEquals("gkqzkcyzmffngdyf", response.properties().update().logOffMessage()); + Assertions.assertFalse(response.properties().provisioning().setDrainMode()); + Assertions.assertEquals(1846854403, response.properties().provisioning().instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, response.properties().provisioning().canaryPolicy()); + Assertions.assertEquals(FailedSessionHostCleanupPolicySHC.KEEP_NONE, + response.properties().failedSessionHostCleanupPolicy()); + } +} 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 index 98409aff3d61..c3c770901646 100644 --- 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 @@ -1,32 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.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\"}") + .fromString("{\"allowNewSession\":false,\"assignedUser\":\"gafcqu\",\"friendlyName\":\"dvetnws\"}") .toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(true, model.allowNewSession()); - Assertions.assertEquals("ccbdre", model.assignedUser()); - Assertions.assertEquals("hcexdrrvqa", model.friendlyName()); + Assertions.assertFalse(model.allowNewSession()); + Assertions.assertEquals("gafcqu", model.assignedUser()); + Assertions.assertEquals("dvetnws", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionHostPatchProperties model = new SessionHostPatchProperties().withAllowNewSession(true) - .withAssignedUser("ccbdre") - .withFriendlyName("hcexdrrvqa"); + SessionHostPatchProperties model = new SessionHostPatchProperties().withAllowNewSession(false) + .withAssignedUser("gafcqu") + .withFriendlyName("dvetnws"); model = BinaryData.fromObject(model).toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(true, model.allowNewSession()); - Assertions.assertEquals("ccbdre", model.assignedUser()); - Assertions.assertEquals("hcexdrrvqa", model.friendlyName()); + Assertions.assertFalse(model.allowNewSession()); + Assertions.assertEquals("gafcqu", model.assignedUser()); + Assertions.assertEquals("dvetnws", 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 index b5bc491b016a..53f244144bc8 100644 --- 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 @@ -1,32 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatchProperties; 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\"}") + "{\"properties\":{\"allowNewSession\":false,\"assignedUser\":\"wpijrajci\",\"friendlyName\":\"mghfcfiwrxgkne\"},\"id\":\"yinzqodfvpgs\",\"name\":\"oxgsgbpfgzdjtx\",\"type\":\"zflbqvg\"}") .toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zfbn", model.assignedUser()); - Assertions.assertEquals("mctlpdngitv", model.friendlyName()); + Assertions.assertFalse(model.properties().allowNewSession()); + Assertions.assertEquals("wpijrajci", model.properties().assignedUser()); + Assertions.assertEquals("mghfcfiwrxgkne", model.properties().friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionHostPatch model = new SessionHostPatch().withAllowNewSession(false) - .withAssignedUser("zfbn") - .withFriendlyName("mctlpdngitv"); + SessionHostPatch model + = new SessionHostPatch().withProperties(new SessionHostPatchProperties().withAllowNewSession(false) + .withAssignedUser("wpijrajci") + .withFriendlyName("mghfcfiwrxgkne")); model = BinaryData.fromObject(model).toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zfbn", model.assignedUser()); - Assertions.assertEquals("mctlpdngitv", model.friendlyName()); + Assertions.assertFalse(model.properties().allowNewSession()); + Assertions.assertEquals("wpijrajci", model.properties().assignedUser()); + Assertions.assertEquals("mghfcfiwrxgkne", model.properties().friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPatchPropertiesTests.java new file mode 100644 index 000000000000..b2c2e53a79bf --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPatchPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostProvisioningConfigurationPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostProvisioningConfigurationPatchProperties model + = BinaryData.fromString("{\"setDrainMode\":true,\"instanceCount\":1464196694,\"canaryPolicy\":\"Auto\"}") + .toObject(SessionHostProvisioningConfigurationPatchProperties.class); + Assertions.assertTrue(model.setDrainMode()); + Assertions.assertEquals(1464196694, model.instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.canaryPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostProvisioningConfigurationPatchProperties model + = new SessionHostProvisioningConfigurationPatchProperties().withSetDrainMode(true) + .withInstanceCount(1464196694) + .withCanaryPolicy(CanaryPolicy.AUTO); + model = BinaryData.fromObject(model).toObject(SessionHostProvisioningConfigurationPatchProperties.class); + Assertions.assertTrue(model.setDrainMode()); + Assertions.assertEquals(1464196694, model.instanceCount()); + Assertions.assertEquals(CanaryPolicy.AUTO, model.canaryPolicy()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPropertiesTests.java new file mode 100644 index 000000000000..ea970e6063df --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostProvisioningConfigurationPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.CanaryPolicy; +import com.azure.resourcemanager.desktopvirtualization.models.SessionHostProvisioningConfigurationProperties; +import org.junit.jupiter.api.Assertions; + +public final class SessionHostProvisioningConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionHostProvisioningConfigurationProperties model + = BinaryData.fromString("{\"setDrainMode\":true,\"instanceCount\":1835022726,\"canaryPolicy\":\"Never\"}") + .toObject(SessionHostProvisioningConfigurationProperties.class); + Assertions.assertTrue(model.setDrainMode()); + Assertions.assertEquals(1835022726, model.instanceCount()); + Assertions.assertEquals(CanaryPolicy.NEVER, model.canaryPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionHostProvisioningConfigurationProperties model + = new SessionHostProvisioningConfigurationProperties().withSetDrainMode(true) + .withInstanceCount(1835022726) + .withCanaryPolicy(CanaryPolicy.NEVER); + model = BinaryData.fromObject(model).toObject(SessionHostProvisioningConfigurationProperties.class); + Assertions.assertTrue(model.setDrainMode()); + Assertions.assertEquals(1835022726, model.instanceCount()); + Assertions.assertEquals(CanaryPolicy.NEVER, model.canaryPolicy()); + } +} 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 index 2a0686386954..45d79dd5e381 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.sessionHosts() - .deleteWithResponse("tbdrvcqgue", "zhomp", "eqdurelyujlfyoum", true, com.azure.core.util.Context.NONE); + .deleteWithResponse("sztekxby", "gmsfepxyi", "pqadagrhrdicxdwy", true, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningWithResponseMockTests.java new file mode 100644 index 000000000000..fe664b261a5d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsRetryProvisioningWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.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 SessionHostsRetryProvisioningWithResponseMockTests { + @Test + public void testRetryProvisioningWithResponse() 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.sessionHosts() + .retryProvisioningWithResponse("sfnim", "qywwwmhk", "uwaedrympmlqoi", 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 index f961df827faa..1954e1c7e5f8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -13,27 +13,27 @@ 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}") + "{\"name\":\"cwsvlxotog\",\"tier\":\"Standard\",\"size\":\"pqsxvnmicy\",\"family\":\"ceoveilovno\",\"capacity\":297433861}") .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()); + Assertions.assertEquals("cwsvlxotog", model.name()); + Assertions.assertEquals(SkuTier.STANDARD, model.tier()); + Assertions.assertEquals("pqsxvnmicy", model.size()); + Assertions.assertEquals("ceoveilovno", model.family()); + Assertions.assertEquals(297433861, 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); + Sku model = new Sku().withName("cwsvlxotog") + .withTier(SkuTier.STANDARD) + .withSize("pqsxvnmicy") + .withFamily("ceoveilovno") + .withCapacity(297433861); 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()); + Assertions.assertEquals("cwsvlxotog", model.name()); + Assertions.assertEquals(SkuTier.STANDARD, model.tier()); + Assertions.assertEquals("pqsxvnmicy", model.size()); + Assertions.assertEquals("ceoveilovno", model.family()); + Assertions.assertEquals(297433861, 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 index 52eb0b87a392..9701b5cd43c1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -12,27 +12,12 @@ 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\"}") + "{\"properties\":{\"appAlias\":\"jmwvvj\",\"filePath\":\"tcxsenhwlrs\",\"commandLineArguments\":\"rzpwvlqdqgbiq\",\"iconPath\":\"ihkaetcktvfc\",\"iconIndex\":533172139},\"id\":\"nkymuctqhjfbebrj\",\"name\":\"xerf\",\"type\":\"wutttxfvjrbi\"}") .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()); + Assertions.assertEquals("jmwvvj", model.properties().appAlias()); + Assertions.assertEquals("tcxsenhwlrs", model.properties().filePath()); + Assertions.assertEquals("rzpwvlqdqgbiq", model.properties().commandLineArguments()); + Assertions.assertEquals("ihkaetcktvfc", model.properties().iconPath()); + Assertions.assertEquals(533172139, model.properties().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 index 82997f6c189d..960deac6904f 100644 --- 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 @@ -1,41 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.implementation.models.StartMenuItemList; 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\"}") + "{\"value\":[{\"properties\":{\"appAlias\":\"izcdrqjsd\",\"filePath\":\"dnfyhxdeoejzicwi\",\"commandLineArguments\":\"jttgzf\",\"iconPath\":\"shcbkhajdeyeamdp\",\"iconIndex\":203407725},\"id\":\"lpbuxwgipwhonowk\",\"name\":\"shwankixzbinje\",\"type\":\"uttmrywnuzoqft\"},{\"properties\":{\"appAlias\":\"zrnkcqvyxlwh\",\"filePath\":\"sicohoqqnwvlry\",\"commandLineArguments\":\"w\",\"iconPath\":\"eun\",\"iconIndex\":1861834573},\"id\":\"gyxzk\",\"name\":\"noc\",\"type\":\"koklya\"}],\"nextLink\":\"conuqszfkbeype\"}") .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()); + Assertions.assertEquals("izcdrqjsd", model.value().get(0).properties().appAlias()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.value().get(0).properties().filePath()); + Assertions.assertEquals("jttgzf", model.value().get(0).properties().commandLineArguments()); + Assertions.assertEquals("shcbkhajdeyeamdp", model.value().get(0).properties().iconPath()); + Assertions.assertEquals(203407725, model.value().get(0).properties().iconIndex()); + Assertions.assertEquals("conuqszfkbeype", model.nextLink()); } } 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 index c4d1c22cb8c6..57766db751c7 100644 --- 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 @@ -1,38 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemProperties; +import com.azure.resourcemanager.desktopvirtualization.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}") + "{\"appAlias\":\"hxepcyvahfnlj\",\"filePath\":\"qxj\",\"commandLineArguments\":\"ujqgidok\",\"iconPath\":\"ljyoxgvcltb\",\"iconIndex\":1745548413}") .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()); + Assertions.assertEquals("hxepcyvahfnlj", model.appAlias()); + Assertions.assertEquals("qxj", model.filePath()); + Assertions.assertEquals("ujqgidok", model.commandLineArguments()); + Assertions.assertEquals("ljyoxgvcltb", model.iconPath()); + Assertions.assertEquals(1745548413, 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 index 6174a5ba6f7e..5d9b3db44751 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem; @@ -22,22 +22,22 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"appAlias\":\"uuuercta\",\"filePath\":\"yintqpbrlcy\",\"commandLineArguments\":\"uczkgofxyfsruc\",\"iconPath\":\"rrp\",\"iconIndex\":1322393455},\"id\":\"bstvje\",\"name\":\"qnrmvvfko\",\"type\":\"mlghktuidvrmazlp\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.startMenuItems() - .list("fkak", "oldtvevboclzhz", 909885231, false, 1517914791, com.azure.core.util.Context.NONE); + .list("irpiwrqofulopmj", "lexwhcbjp", 741046817, false, 151309152, 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()); + Assertions.assertEquals("uuuercta", response.iterator().next().properties().appAlias()); + Assertions.assertEquals("yintqpbrlcy", response.iterator().next().properties().filePath()); + Assertions.assertEquals("uczkgofxyfsruc", response.iterator().next().properties().commandLineArguments()); + Assertions.assertEquals("rrp", response.iterator().next().properties().iconPath()); + Assertions.assertEquals(1322393455, response.iterator().next().properties().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 index 7cf40600078d..7d780bfb8367 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -11,16 +11,16 @@ 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()); + Time model = BinaryData.fromString("{\"hour\":1068836861,\"minute\":1375292829}").toObject(Time.class); + Assertions.assertEquals(1068836861, model.hour()); + Assertions.assertEquals(1375292829, model.minute()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Time model = new Time().withHour(525052628).withMinute(2063322926); + Time model = new Time().withHour(1068836861).withMinute(1375292829); model = BinaryData.fromObject(model).toObject(Time.class); - Assertions.assertEquals(525052628, model.hour()); - Assertions.assertEquals(2063322926, model.minute()); + Assertions.assertEquals(1068836861, model.hour()); + Assertions.assertEquals(1375292829, model.minute()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UpdateSessionHostsRequestBodyTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UpdateSessionHostsRequestBodyTests.java new file mode 100644 index 000000000000..c643b4124ffc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UpdateSessionHostsRequestBodyTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.UpdateSessionHostsRequestBody; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UpdateSessionHostsRequestBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateSessionHostsRequestBody model = BinaryData.fromString( + "{\"scheduledDateTime\":\"2021-05-18T22:00:53Z\",\"scheduledDateTimeZone\":\"foiyjwpfilk\",\"update\":{\"deleteOriginalVm\":false,\"maxVmsRemoved\":59722653,\"logOffDelayMinutes\":272074002,\"logOffMessage\":\"dviauogp\"}}") + .toObject(UpdateSessionHostsRequestBody.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T22:00:53Z"), model.scheduledDateTime()); + Assertions.assertEquals("foiyjwpfilk", model.scheduledDateTimeZone()); + Assertions.assertFalse(model.update().deleteOriginalVm()); + Assertions.assertEquals(59722653, model.update().maxVmsRemoved()); + Assertions.assertEquals(272074002, model.update().logOffDelayMinutes()); + Assertions.assertEquals("dviauogp", model.update().logOffMessage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateSessionHostsRequestBody model + = new UpdateSessionHostsRequestBody().withScheduledDateTime(OffsetDateTime.parse("2021-05-18T22:00:53Z")) + .withScheduledDateTimeZone("foiyjwpfilk") + .withUpdate(new HostPoolUpdateConfigurationPatchProperties().withDeleteOriginalVm(false) + .withMaxVmsRemoved(59722653) + .withLogOffDelayMinutes(272074002) + .withLogOffMessage("dviauogp")); + model = BinaryData.fromObject(model).toObject(UpdateSessionHostsRequestBody.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T22:00:53Z"), model.scheduledDateTime()); + Assertions.assertEquals("foiyjwpfilk", model.scheduledDateTimeZone()); + Assertions.assertFalse(model.update().deleteOriginalVm()); + Assertions.assertEquals(59722653, model.update().maxVmsRemoved()); + Assertions.assertEquals(272074002, model.update().logOffDelayMinutes()); + Assertions.assertEquals("dviauogp", model.update().logOffMessage()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserAssignedIdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..a5755f4b5a13 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserAssignedIdentityTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model + = BinaryData.fromString("{\"principalId\":\"uebbaumnyqup\",\"clientId\":\"eojnabc\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/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 index d13430e25a2c..71249c0f3749 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.desktopvirtualization.generated; @@ -15,27 +15,12 @@ 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\"}") + "{\"properties\":{\"objectId\":\"nwm\",\"userPrincipalName\":\"mvpdvjdhttzaef\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Unknown\",\"activeDirectoryUserName\":\"hrphkmcrjdqn\",\"createTime\":\"2021-07-03T12:37:43Z\"},\"id\":\"pbgtgkylkdghrj\",\"name\":\"uutlwxezwzhok\",\"type\":\"bwnhhtql\"}") .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()); + Assertions.assertEquals("mvpdvjdhttzaef", model.properties().userPrincipalName()); + Assertions.assertEquals(ApplicationType.REMOTE_APP, model.properties().applicationType()); + Assertions.assertEquals(SessionState.UNKNOWN, model.properties().sessionState()); + Assertions.assertEquals("hrphkmcrjdqn", model.properties().activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T12:37:43Z"), model.properties().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 index 4c1477565b7f..bb3fcd71613c 100644 --- 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 @@ -1,44 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.UserSessionList; 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\"}") + "{\"value\":[{\"properties\":{\"objectId\":\"xfkfwegprhptill\",\"userPrincipalName\":\"biqtgdq\",\"applicationType\":\"Desktop\",\"sessionState\":\"Unknown\",\"activeDirectoryUserName\":\"ldrizetpwbra\",\"createTime\":\"2021-09-22T07:04:47Z\"},\"id\":\"bphbqzmizakakank\",\"name\":\"p\",\"type\":\"n\"},{\"properties\":{\"objectId\":\"ajoylhjl\",\"userPrincipalName\":\"oyxprimr\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Pending\",\"activeDirectoryUserName\":\"cjmeislstvasy\",\"createTime\":\"2021-07-26T16:54:44Z\"},\"id\":\"zaum\",\"name\":\"eoohguufuzboyj\",\"type\":\"thwtzol\"}],\"nextLink\":\"emwmdxmebwjs\"}") .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()); + Assertions.assertEquals("biqtgdq", model.value().get(0).properties().userPrincipalName()); + Assertions.assertEquals(ApplicationType.DESKTOP, model.value().get(0).properties().applicationType()); + Assertions.assertEquals(SessionState.UNKNOWN, model.value().get(0).properties().sessionState()); + Assertions.assertEquals("ldrizetpwbra", model.value().get(0).properties().activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T07:04:47Z"), + model.value().get(0).properties().createTime()); + Assertions.assertEquals("emwmdxmebwjs", model.nextLink()); } } 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 index 38088db99efe..40b497b05765 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.UserSessionProperties; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -15,27 +15,12 @@ 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\"}") + "{\"objectId\":\"hgppipifhpfeoa\",\"userPrincipalName\":\"gcxtxj\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"idltugsresmkss\",\"createTime\":\"2021-02-08T16:58:29Z\"}") .toObject(UserSessionProperties.class); - Assertions.assertEquals("tzingamvpph", model.userPrincipalName()); + Assertions.assertEquals("gcxtxj", 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()); + Assertions.assertEquals("idltugsresmkss", model.activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T16:58:29Z"), 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 index b1378fb75ed3..81da12591f07 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.userSessions() - .deleteWithResponse("mdgglmepjpfs", "ykgsangpszng", "fpgylkve", "jujcngoad", true, - com.azure.core.util.Context.NONE); + .deleteWithResponse("rcvuqbsgzlrqhb", "nq", "gdxwbsfpyxx", "jlf", 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 index 2296bcd98ed2..b06cb50edb60 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testDisconnectWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.userSessions() - .disconnectWithResponse("csjml", "e", "yeji", "iuxegth", com.azure.core.util.Context.NONE); + .disconnectWithResponse("enygnxcgjtfrnquk", "rf", "s", "nlrxsmyltrwntfmt", + 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 index d0f2d1acf218..deb555eae9fe 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; @@ -23,23 +23,24 @@ 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\"}"; + = "{\"properties\":{\"objectId\":\"qypzqzufgs\",\"userPrincipalName\":\"ej\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Unknown\",\"activeDirectoryUserName\":\"xptpqaya\",\"createTime\":\"2021-12-10T22:11:30Z\"},\"id\":\"fgybmxs\",\"name\":\"xocuullojkpoyhgw\",\"type\":\"djuxdbdljzgd\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); UserSession response = manager.userSessions() - .getWithResponse("yildudxjascow", "f", "jkpdxphlkksnm", "zvyfijdkzuqnwsi", com.azure.core.util.Context.NONE) + .getWithResponse("rpejp", "ssanbtttkgsuxun", "swgkpjhboyikebh", "hkslgwlokhueoij", + 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()); + Assertions.assertEquals("ej", response.properties().userPrincipalName()); + Assertions.assertEquals(ApplicationType.REMOTE_APP, response.properties().applicationType()); + Assertions.assertEquals(SessionState.UNKNOWN, response.properties().sessionState()); + Assertions.assertEquals("xptpqaya", response.properties().activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T22:11:30Z"), response.properties().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 index 7fd36cf95c81..b21c93fea470 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; @@ -24,22 +24,24 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"objectId\":\"scyvaifppuacvf\",\"userPrincipalName\":\"owpsfxt\",\"applicationType\":\"Desktop\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"mhpv\",\"createTime\":\"2021-06-19T02:16:26Z\"},\"id\":\"ttehdp\",\"name\":\"ou\",\"type\":\"stkfvvdshxcdeds\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.userSessions() - .listByHostPool("fexl", "xn", "akizvoaikna", 2097899264, true, 427869575, com.azure.core.util.Context.NONE); + .listByHostPool("lefksxq", "eazfpxgnmqvzvlu", "q", 1309527397, false, 2047778893, + 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()); + Assertions.assertEquals("owpsfxt", response.iterator().next().properties().userPrincipalName()); + Assertions.assertEquals(ApplicationType.DESKTOP, response.iterator().next().properties().applicationType()); + Assertions.assertEquals(SessionState.LOG_OFF, response.iterator().next().properties().sessionState()); + Assertions.assertEquals("mhpv", response.iterator().next().properties().activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-19T02:16:26Z"), + response.iterator().next().properties().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 index d91fef7b7137..3477852edacf 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; @@ -24,22 +24,23 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"objectId\":\"qloto\",\"userPrincipalName\":\"tvwt\",\"applicationType\":\"Desktop\",\"sessionState\":\"Unknown\",\"activeDirectoryUserName\":\"wwxwjyofgw\",\"createTime\":\"2021-11-17T00:31:01Z\"},\"id\":\"tlwljssmcts\",\"name\":\"ldkpwolgisu\",\"type\":\"xbteogfgfiijryk\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.userSessions() - .list("dm", "rgjfoknubnoi", "pkpztrg", 382465235, false, 1781830307, com.azure.core.util.Context.NONE); + .list("cominxojjluxx", "hilzzdzzq", "mueza", 1574150340, true, 326247810, 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()); + Assertions.assertEquals("tvwt", response.iterator().next().properties().userPrincipalName()); + Assertions.assertEquals(ApplicationType.DESKTOP, response.iterator().next().properties().applicationType()); + Assertions.assertEquals(SessionState.UNKNOWN, response.iterator().next().properties().sessionState()); + Assertions.assertEquals("wwxwjyofgw", response.iterator().next().properties().activeDirectoryUserName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T00:31:01Z"), + response.iterator().next().properties().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 index 03ab772c1053..2de6e8b547ec 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; @@ -26,11 +26,11 @@ public void testSendMessageWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.userSessions() - .sendMessageWithResponse("rtudawlpjfel", "erppt", "bgqnz", "nhii", - new SendMessage().withMessageTitle("alwcjgckbb").withMessageBody("cgzpraoxnyu"), + .sendMessageWithResponse("g", "jdxwnazkurrdre", "zjwhsetwwjwz", "qseuzuukykcyqhy", + new SendMessage().withMessageTitle("zzdcykeys").withMessageBody("wfopazdazg"), 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 index a93fe12c3fb0..b5b7af0a352d 100644 --- 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 @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,24 +14,24 @@ 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\"}") + "{\"description\":\"nb\",\"friendlyName\":\"rxgibbd\",\"applicationGroupReferences\":[\"onfo\",\"auorsukokw\",\"qplhlvnu\"],\"publicNetworkAccess\":\"Enabled\"}") .toObject(WorkspacePatchProperties.class); - Assertions.assertEquals("sycbkbfk", model.description()); - Assertions.assertEquals("kdkexxp", model.friendlyName()); - Assertions.assertEquals("mxaxc", model.applicationGroupReferences().get(0)); + Assertions.assertEquals("nb", model.description()); + Assertions.assertEquals("rxgibbd", model.friendlyName()); + Assertions.assertEquals("onfo", 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")) + WorkspacePatchProperties model = new WorkspacePatchProperties().withDescription("nb") + .withFriendlyName("rxgibbd") + .withApplicationGroupReferences(Arrays.asList("onfo", "auorsukokw", "qplhlvnu")) .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("nb", model.description()); + Assertions.assertEquals("rxgibbd", model.friendlyName()); + Assertions.assertEquals("onfo", 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 index 6a6ed30f264d..ef5d04fe8773 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatchProperties; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,28 +17,28 @@ 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\"}}") + "{\"tags\":{\"nrdsutujbazpjuoh\":\"slqubkwdl\"},\"properties\":{\"description\":\"yfln\",\"friendlyName\":\"wmd\",\"applicationGroupReferences\":[\"pklvxw\",\"ygdxpgpqchis\"],\"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()); + Assertions.assertEquals("slqubkwdl", model.tags().get("nrdsutujbazpjuoh")); + Assertions.assertEquals("yfln", model.properties().description()); + Assertions.assertEquals("wmd", model.properties().friendlyName()); + Assertions.assertEquals("pklvxw", model.properties().applicationGroupReferences().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().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); + WorkspacePatch model = new WorkspacePatch().withTags(mapOf("nrdsutujbazpjuoh", "slqubkwdl")) + .withProperties(new WorkspacePatchProperties().withDescription("yfln") + .withFriendlyName("wmd") + .withApplicationGroupReferences(Arrays.asList("pklvxw", "ygdxpgpqchis")) + .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()); + Assertions.assertEquals("slqubkwdl", model.tags().get("nrdsutujbazpjuoh")); + Assertions.assertEquals("yfln", model.properties().description()); + Assertions.assertEquals("wmd", model.properties().friendlyName()); + Assertions.assertEquals("pklvxw", model.properties().applicationGroupReferences().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); } // Use "Map.of" if available 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 index d510d1d2180b..be6c9adf68e7 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DeploymentScope; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.WorkspaceProperties; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,24 +15,31 @@ 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\"}]}") + "{\"objectId\":\"maehvbbxurip\",\"description\":\"fnhtbaxkgxyw\",\"friendlyName\":\"kpyklyhp\",\"applicationGroupReferences\":[\"dpvruud\",\"gzibthostgktstv\",\"xeclzedqbcvhzlhp\",\"odqkdlwwqfb\"],\"cloudPcResource\":false,\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"smlmbtxhwgfwsrta\",\"coezbrhubskh\",\"dyg\",\"ookk\"],\"privateEndpoint\":{\"id\":\"jb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"rfmluiqtq\",\"actionsRequired\":\"avyvnqqyba\"},\"provisioningState\":\"Failed\"},\"id\":\"ayjkqa\",\"name\":\"qgzsles\",\"type\":\"cbhernntiewdj\"},{\"properties\":{\"groupIds\":[\"uwrbehwagoh\",\"uffkmrqemvvh\",\"xtdr\"],\"privateEndpoint\":{\"id\":\"tac\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"vewzcj\",\"actionsRequired\":\"m\"},\"provisioningState\":\"Failed\"},\"id\":\"guaadraufactkahz\",\"name\":\"v\",\"type\":\"jjziuxxpsh\"}],\"oboTenantId\":\"e\",\"deploymentScope\":\"Geographical\"}") .toObject(WorkspaceProperties.class); - Assertions.assertEquals("evcciqihnhun", model.description()); - Assertions.assertEquals("wjzrnfygxgisp", model.friendlyName()); - Assertions.assertEquals("tzfkufubl", model.applicationGroupReferences().get(0)); + Assertions.assertEquals("fnhtbaxkgxyw", model.description()); + Assertions.assertEquals("kpyklyhp", model.friendlyName()); + Assertions.assertEquals("dpvruud", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + Assertions.assertEquals("e", model.oboTenantId()); + Assertions.assertEquals(DeploymentScope.GEOGRAPHICAL, model.deploymentScope()); } @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); + WorkspaceProperties model = new WorkspaceProperties().withDescription("fnhtbaxkgxyw") + .withFriendlyName("kpyklyhp") + .withApplicationGroupReferences( + Arrays.asList("dpvruud", "gzibthostgktstv", "xeclzedqbcvhzlhp", "odqkdlwwqfb")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withOboTenantId("e") + .withDeploymentScope(DeploymentScope.GEOGRAPHICAL); 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("fnhtbaxkgxyw", model.description()); + Assertions.assertEquals("kpyklyhp", model.friendlyName()); + Assertions.assertEquals("dpvruud", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + Assertions.assertEquals("e", model.oboTenantId()); + Assertions.assertEquals(DeploymentScope.GEOGRAPHICAL, model.deploymentScope()); } } 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 index ea3ab3ab46a8..4b3dbb4bd3bd 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workspaces() - .deleteByResourceGroupWithResponse("phai", "mxyasflvgsgzw", com.azure.core.util.Context.NONE); + manager.workspaces().deleteByResourceGroupWithResponse("mj", "ajcxnyqgxhl", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/tsp-location.yaml b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/tsp-location.yaml new file mode 100644 index 000000000000..22fd106d7dd9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/DesktopVirtualization +commit: 786bc3d8ec7c9e1297c12bd105be365ae2642ae8 +repo: Azure/azure-rest-api-specs +additionalDirectories: