exports/New-NmeDynamicPoolConfigurationModel.ps1


# ----------------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.8, generator: @autorest/powershell@4.0.752)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Create an in-memory object for DynamicPoolConfiguration.
.Description
Create an in-memory object for DynamicPoolConfiguration.

#>

function New-NmeDynamicPoolConfigurationModel {
[OutputType([NmePowershell.Models.DynamicPoolConfiguration])]
[CmdletBinding(PositionalBinding=$false)]
param(
    [Parameter(Mandatory)]
    [NmePowershell.PSArgumentCompleterAttribute("Running", "AvailableForConnection")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ActiveHostType},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${AutoHealEnable},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${BurstCapacity},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${HostPoolCapacity},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${IsEnabled},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${IsSingleUserDesktop},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${MinActiveHostsCount},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${PreStageHostEnable},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ReImageUsedHosts},

    [Parameter(Mandatory)]
    [NmePowershell.PSArgumentCompleterAttribute("Disabled", "Always", "OnlyWhenScaleInIsAllowed")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ReImageUsedHostsMode},

    [Parameter(Mandatory)]
    [NmePowershell.PSArgumentCompleterAttribute("High", "Medium", "Low")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ScaleInAggressiveness},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ScaleInRestrictionEnable},

    [Parameter(Mandatory)]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ScaleInRestrictionPutToDrainMode},

    [Parameter(Mandatory)]
    [NmePowershell.PSArgumentCompleterAttribute("Default", "WorkingHours", "UserDriven")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ScalingMode},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ActiveSessionsScaleCriteriaScaleInHostChangeCount},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Single]
    ${ActiveSessionsScaleCriteriaScaleInValue},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ActiveSessionsScaleCriteriaScaleOutHostChangeCount},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Single]
    ${ActiveSessionsScaleCriteriaScaleOutValue},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String[]]
    ${AdditionalNetworks},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IAutoHealConfigurationItem[]]
    #
    ${AutoHealConfigs},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("CPUUsage", "RAMUsage", "AvgActiveSessions", "AvailableUserSessionSingle", "AvailableUserSessions", "UserDriven", "PersonalAutoGrow", "PersonalAutoShrink")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${AutoScaleCriteria},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${AutoScaleInterval},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IDynamicPoolTriggerInfo[]]
    #
    ${AutoScaleTriggers},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("Always", "DuringWorkHours")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${AvailableUserSessionScaleCriterionAvailableSessionRestriction},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${AvailableUserSessionScaleCriterionEndWorkHours},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${AvailableUserSessionScaleCriterionMaxAvailableUserSessions},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${AvailableUserSessionScaleCriterionMinAvailableUserSessions},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${AvailableUserSessionScaleCriterionOutsideWorkHoursSessions},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IAutoHealAction[]]
    #
    ${ConfigActions},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("0", "1", "2", "3", "4", "5", "6")]
    [NmePowershell.Category('Body')]
    [System.Int32[]]
    ${ConfigDays},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ConfigHostsToBeReady},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("Count", "Percent")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigHostsToBeReadyMeasureType},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigNetworkId},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ConfigPreStageDiskType},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ConfigPreStageUnassigned},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ConfigPreStageUnassignedHosts},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigPrefix},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigResourceGroupId},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("WithoutSessions", "WithoutActive", "WithActive")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigSessionCriteria},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ConfigStaleHeartbeatMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ConfigSubnet},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ConfigWaitMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ConfigWaitMinutesBeforeFirstAction},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("Available", "Unavailable", "Shutdown", "Disconnected", "Upgrading", "UpgradeFailed", "NoHeartbeat", "NotJoinedToDomain", "DomainTrustRelationshipLost", "SxSStackListenerNotReady", "FSLogixNotHealthy", "NeedsAssistance")]
    [NmePowershell.Category('Body')]
    [System.String[]]
    ${ConfigWvdStatuses},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("BreadthFirst", "DepthFirst", "Persistent", "MultiplePersistent")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${ExtensionLoadBalancing},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ExtensionMaxSessionsPerHost},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${ExtensionStartVMOnConnect},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${HostUsageScaleCriteriaScaleInHostChangeCount},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Single]
    ${HostUsageScaleCriteriaScaleInValue},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${HostUsageScaleCriteriaScaleOutHostChangeCount},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Single]
    ${HostUsageScaleCriteriaScaleOutValue},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("DepthFirst", "BreadthFirst")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${NetworkDistributionStrategy},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IPreStageHostsConfigurationItem[]]
    #
    ${PreStageHostConfigs},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("Hybrid", "Automated")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${PreStageHostIntelligentPrestageMode},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${PreStageHostIsMultipleConfigsMode},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${RemoveMessagingMessage},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${RemoveMessagingMinutesBeforeRemove},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${RollingDrainModeIsEnabled},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IRollingDrainModeWindow[]]
    #
    ${RollingDrainModeWindows},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ScaleInAverageTimeRangeInMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${ScaleOutAverageTimeRangeInMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${SecondaryRegionEnabled},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${StartWorkDuration},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${StartWorkHour},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${StartWorkMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${StoppedDiskType},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${TimeRangeEndHour},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${TimeRangeEndMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${TimeRangeStartHour},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${TimeRangeStartMinutes},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${TimezoneId},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${UserDrivenBypassDrainMode},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${UserDrivenMinAvailableSessions},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [NmePowershell.Models.IUserDrivenPreStageHostsConfigurationItem[]]
    #
    ${UserDrivenPreStageHostConfigs},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${UserDrivenPreStageHostEnable},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${UserDrivenPreStageHostPreStageIfUnassigned},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${UserDrivenStopDelayMinutes},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("Standard", "Reuse", "Unique")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMNamingMode},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateDiskPerformanceTier},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${VMTemplateDiskSize},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("CacheDisk", "ResourceDisk", "NvmeDisk")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateEphemeralOsdiskPlacement},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.Boolean]
    ${VMTemplateHasEphemeralOsdisk},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateImage},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateNetworkId},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplatePrefix},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateResourceGroupId},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateSize},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateStorageType},

    [Parameter()]
    [NmePowershell.Category('Body')]
    [System.String]
    ${VMTemplateSubnet},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("OneTime", "Continuously", "Never")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${WorkingHoursScaleInBehavior},

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("OneTime", "Continuously", "Never")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${WorkingHoursScaleOutBehavior}
)

begin {
    try {
        $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
            $PSBoundParameters['OutBuffer'] = 1
        }
        $parameterSet = $PSCmdlet.ParameterSetName
        
        $testPlayback = $false
        $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('NmePowershell.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }

        $mapping = @{
            __AllParameterSets = 'NerdioManagerPowerShell.custom\New-NmeDynamicPoolConfigurationModel';
        }
        $cmdInfo = Get-Command -Name $mapping[$parameterSet]
        [NmePowershell.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
        [NmePowershell.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
        if ($wrappedCmd -eq $null) {
            $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
        }
        $scriptCmd = {& $wrappedCmd @PSBoundParameters}
        $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
        $steppablePipeline.Begin($PSCmdlet)
    } catch {

        throw
    }
}

process {
    try {
        $steppablePipeline.Process($_)
    } catch {

        throw
    }

}
end {
    try {
        $steppablePipeline.End()

    } catch {

        throw
    }
} 
}