Model/StatsContainer.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 Started
No description available.
.PARAMETER SessSshShell
No description available.
.PARAMETER SessSshScp
No description available.
.PARAMETER SessSshSftp
No description available.
.PARAMETER SessFtp
No description available.
.PARAMETER SessFtps
No description available.
.PARAMETER SessFtpes
No description available.
.PARAMETER SessWebClient
No description available.
.PARAMETER SessWebClientShare
No description available.
.PARAMETER RejectedConns
No description available.
.PARAMETER AddedToBl
No description available.
.PARAMETER AddedByHammering
No description available.
.PARAMETER AddedByAuth
No description available.
.PARAMETER AddedByProtocol
No description available.
.PARAMETER AddedByAdmin
No description available.
.PARAMETER AddedByScript
No description available.
.PARAMETER HitsOnBl
No description available.
.PARAMETER HitsOnBlCache
No description available.
.PARAMETER FileUp
No description available.
.PARAMETER FileDn
No description available.
.PARAMETER FileUpFail
No description available.
.PARAMETER FileDnFail
No description available.
.PARAMETER TransferUpMb
No description available.
.PARAMETER TransferDnMb
No description available.
.PARAMETER ScriptsRun
No description available.
.OUTPUTS

StatsContainer<PSCustomObject>
#>


function Initialize-SS6StatsContainer {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Started},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessSshShell},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessSshScp},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessSshSftp},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessFtp},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessFtps},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessFtpes},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessWebClient},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SessWebClientShare},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${RejectedConns},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedToBl},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedByHammering},
        [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedByAuth},
        [Parameter(Position = 13, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedByProtocol},
        [Parameter(Position = 14, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedByAdmin},
        [Parameter(Position = 15, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AddedByScript},
        [Parameter(Position = 16, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${HitsOnBl},
        [Parameter(Position = 17, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${HitsOnBlCache},
        [Parameter(Position = 18, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${FileUp},
        [Parameter(Position = 19, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${FileDn},
        [Parameter(Position = 20, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${FileUpFail},
        [Parameter(Position = 21, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${FileDnFail},
        [Parameter(Position = 22, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Double]]
        ${TransferUpMb},
        [Parameter(Position = 23, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Double]]
        ${TransferDnMb},
        [Parameter(Position = 24, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ScriptsRun}
    )

    Process {
        'Creating PSCustomObject: SS6AdminModule => SS6StatsContainer' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "started" = ${Started}
            "sessSshShell" = ${SessSshShell}
            "sessSshScp" = ${SessSshScp}
            "sessSshSftp" = ${SessSshSftp}
            "sessFtp" = ${SessFtp}
            "sessFtps" = ${SessFtps}
            "sessFtpes" = ${SessFtpes}
            "sessWebClient" = ${SessWebClient}
            "sessWebClientShare" = ${SessWebClientShare}
            "rejectedConns" = ${RejectedConns}
            "addedToBl" = ${AddedToBl}
            "addedByHammering" = ${AddedByHammering}
            "addedByAuth" = ${AddedByAuth}
            "addedByProtocol" = ${AddedByProtocol}
            "addedByAdmin" = ${AddedByAdmin}
            "addedByScript" = ${AddedByScript}
            "hitsOnBl" = ${HitsOnBl}
            "hitsOnBlCache" = ${HitsOnBlCache}
            "fileUp" = ${FileUp}
            "fileDn" = ${FileDn}
            "fileUpFail" = ${FileUpFail}
            "fileDnFail" = ${FileDnFail}
            "transferUpMb" = ${TransferUpMb}
            "transferDnMb" = ${TransferDnMb}
            "scriptsRun" = ${ScriptsRun}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to StatsContainer<PSCustomObject>

.DESCRIPTION

Convert from JSON to StatsContainer<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

StatsContainer<PSCustomObject>
#>

function ConvertFrom-SS6JsonToStatsContainer {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: SS6AdminModule => SS6StatsContainer' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SS6StatsContainer
        $AllProperties = ("started", "sessSshShell", "sessSshScp", "sessSshSftp", "sessFtp", "sessFtps", "sessFtpes", "sessWebClient", "sessWebClientShare", "rejectedConns", "addedToBl", "addedByHammering", "addedByAuth", "addedByProtocol", "addedByAdmin", "addedByScript", "hitsOnBl", "hitsOnBlCache", "fileUp", "fileDn", "fileUpFail", "fileDnFail", "transferUpMb", "transferDnMb", "scriptsRun")
        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 "started"))) { #optional property not found
            $Started = $null
        } else {
            $Started = $JsonParameters.PSobject.Properties["started"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessSshShell"))) { #optional property not found
            $SessSshShell = $null
        } else {
            $SessSshShell = $JsonParameters.PSobject.Properties["sessSshShell"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessSshScp"))) { #optional property not found
            $SessSshScp = $null
        } else {
            $SessSshScp = $JsonParameters.PSobject.Properties["sessSshScp"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessSshSftp"))) { #optional property not found
            $SessSshSftp = $null
        } else {
            $SessSshSftp = $JsonParameters.PSobject.Properties["sessSshSftp"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessFtp"))) { #optional property not found
            $SessFtp = $null
        } else {
            $SessFtp = $JsonParameters.PSobject.Properties["sessFtp"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessFtps"))) { #optional property not found
            $SessFtps = $null
        } else {
            $SessFtps = $JsonParameters.PSobject.Properties["sessFtps"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessFtpes"))) { #optional property not found
            $SessFtpes = $null
        } else {
            $SessFtpes = $JsonParameters.PSobject.Properties["sessFtpes"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessWebClient"))) { #optional property not found
            $SessWebClient = $null
        } else {
            $SessWebClient = $JsonParameters.PSobject.Properties["sessWebClient"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sessWebClientShare"))) { #optional property not found
            $SessWebClientShare = $null
        } else {
            $SessWebClientShare = $JsonParameters.PSobject.Properties["sessWebClientShare"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "rejectedConns"))) { #optional property not found
            $RejectedConns = $null
        } else {
            $RejectedConns = $JsonParameters.PSobject.Properties["rejectedConns"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedToBl"))) { #optional property not found
            $AddedToBl = $null
        } else {
            $AddedToBl = $JsonParameters.PSobject.Properties["addedToBl"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedByHammering"))) { #optional property not found
            $AddedByHammering = $null
        } else {
            $AddedByHammering = $JsonParameters.PSobject.Properties["addedByHammering"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedByAuth"))) { #optional property not found
            $AddedByAuth = $null
        } else {
            $AddedByAuth = $JsonParameters.PSobject.Properties["addedByAuth"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedByProtocol"))) { #optional property not found
            $AddedByProtocol = $null
        } else {
            $AddedByProtocol = $JsonParameters.PSobject.Properties["addedByProtocol"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedByAdmin"))) { #optional property not found
            $AddedByAdmin = $null
        } else {
            $AddedByAdmin = $JsonParameters.PSobject.Properties["addedByAdmin"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "addedByScript"))) { #optional property not found
            $AddedByScript = $null
        } else {
            $AddedByScript = $JsonParameters.PSobject.Properties["addedByScript"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "hitsOnBl"))) { #optional property not found
            $HitsOnBl = $null
        } else {
            $HitsOnBl = $JsonParameters.PSobject.Properties["hitsOnBl"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "hitsOnBlCache"))) { #optional property not found
            $HitsOnBlCache = $null
        } else {
            $HitsOnBlCache = $JsonParameters.PSobject.Properties["hitsOnBlCache"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "fileUp"))) { #optional property not found
            $FileUp = $null
        } else {
            $FileUp = $JsonParameters.PSobject.Properties["fileUp"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "fileDn"))) { #optional property not found
            $FileDn = $null
        } else {
            $FileDn = $JsonParameters.PSobject.Properties["fileDn"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "fileUpFail"))) { #optional property not found
            $FileUpFail = $null
        } else {
            $FileUpFail = $JsonParameters.PSobject.Properties["fileUpFail"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "fileDnFail"))) { #optional property not found
            $FileDnFail = $null
        } else {
            $FileDnFail = $JsonParameters.PSobject.Properties["fileDnFail"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "transferUpMb"))) { #optional property not found
            $TransferUpMb = $null
        } else {
            $TransferUpMb = $JsonParameters.PSobject.Properties["transferUpMb"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "transferDnMb"))) { #optional property not found
            $TransferDnMb = $null
        } else {
            $TransferDnMb = $JsonParameters.PSobject.Properties["transferDnMb"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "scriptsRun"))) { #optional property not found
            $ScriptsRun = $null
        } else {
            $ScriptsRun = $JsonParameters.PSobject.Properties["scriptsRun"].value
        }

        $PSO = [PSCustomObject]@{
            "started" = ${Started}
            "sessSshShell" = ${SessSshShell}
            "sessSshScp" = ${SessSshScp}
            "sessSshSftp" = ${SessSshSftp}
            "sessFtp" = ${SessFtp}
            "sessFtps" = ${SessFtps}
            "sessFtpes" = ${SessFtpes}
            "sessWebClient" = ${SessWebClient}
            "sessWebClientShare" = ${SessWebClientShare}
            "rejectedConns" = ${RejectedConns}
            "addedToBl" = ${AddedToBl}
            "addedByHammering" = ${AddedByHammering}
            "addedByAuth" = ${AddedByAuth}
            "addedByProtocol" = ${AddedByProtocol}
            "addedByAdmin" = ${AddedByAdmin}
            "addedByScript" = ${AddedByScript}
            "hitsOnBl" = ${HitsOnBl}
            "hitsOnBlCache" = ${HitsOnBlCache}
            "fileUp" = ${FileUp}
            "fileDn" = ${FileDn}
            "fileUpFail" = ${FileUpFail}
            "fileDnFail" = ${FileDnFail}
            "transferUpMb" = ${TransferUpMb}
            "transferDnMb" = ${TransferDnMb}
            "scriptsRun" = ${ScriptsRun}
        }

        return $PSO
    }

}