exports/New-NmeDynamicPoolTriggerInfoModel.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 DynamicPoolTriggerInfo.
.Description
Create an in-memory object for DynamicPoolTriggerInfo.

#>

function New-NmeDynamicPoolTriggerInfoModel {
[OutputType([NmePowershell.Models.DynamicPoolTriggerInfo])]
[CmdletBinding(PositionalBinding=$false)]
param(
    [Parameter(Mandatory)]
    [NmePowershell.PSArgumentCompleterAttribute("CPUUsage", "RAMUsage", "AvgActiveSessions", "AvailableUserSessionSingle", "AvailableUserSessions", "UserDriven", "PersonalAutoGrow", "PersonalAutoShrink")]
    [NmePowershell.Category('Body')]
    [System.String]
    ${TriggerType},

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    [Parameter()]
    [NmePowershell.PSArgumentCompleterAttribute("0", "1")]
    [NmePowershell.Category('Body')]
    [System.Int32]
    ${PersonalAutoGrowUnit},

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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-NmeDynamicPoolTriggerInfoModel';
        }
        $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
    }
} 
}