Model/EventHandler.ps1
# # SMServer V6 # Syncplify Server! REST API # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER VarEvent No description available. .PARAMETER Script reference to a valid Script. This field is required .PARAMETER Priority No description available. .PARAMETER ExecTimeoutSecs No description available. .OUTPUTS EventHandler<PSCustomObject> #> function Initialize-SS6EventHandler { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${VarEvent}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [String] ${Script}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Priority}, [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${ExecTimeoutSecs} ) Process { 'Creating PSCustomObject: SS6AdminModule => SS6EventHandler' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "event" = ${VarEvent} "script" = ${Script} "priority" = ${Priority} "execTimeoutSecs" = ${ExecTimeoutSecs} } return $PSO } } <# .SYNOPSIS Convert from JSON to EventHandler<PSCustomObject> .DESCRIPTION Convert from JSON to EventHandler<PSCustomObject> .PARAMETER Json Json object .OUTPUTS EventHandler<PSCustomObject> #> function ConvertFrom-SS6JsonToEventHandler { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: SS6AdminModule => SS6EventHandler' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in SS6EventHandler $AllProperties = ("event", "script", "priority", "execTimeoutSecs") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } if (!([bool]($JsonParameters.PSobject.Properties.name -match "event"))) { #optional property not found $VarEvent = $null } else { $VarEvent = $JsonParameters.PSobject.Properties["event"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "script"))) { #optional property not found $Script = $null } else { $Script = $JsonParameters.PSobject.Properties["script"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "priority"))) { #optional property not found $Priority = $null } else { $Priority = $JsonParameters.PSobject.Properties["priority"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "execTimeoutSecs"))) { #optional property not found $ExecTimeoutSecs = $null } else { $ExecTimeoutSecs = $JsonParameters.PSobject.Properties["execTimeoutSecs"].value } $PSO = [PSCustomObject]@{ "event" = ${VarEvent} "script" = ${Script} "priority" = ${Priority} "execTimeoutSecs" = ${ExecTimeoutSecs} } return $PSO } } |