Model/SSHConfig.ps1

#
# SMServer V6
# Syncplify Server! REST API
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

The fields 'softwareId', 'sftpVer', 'auth', 'kex', 'mac', 'crypto' are required

.PARAMETER SoftwareId
If will be automatically set to 'Syncplify_me_Server-<version>'. Cannot be empty
.PARAMETER Greeting
optional login banner
.PARAMETER ZCompress
No description available.
.PARAMETER UseAllocator
No description available.
.PARAMETER AssumeUtf8
No description available.
.PARAMETER OverrideTimeout
No description available.
.PARAMETER AllowForwardingTo
No description available.
.PARAMETER SftpVer
No description available.
.PARAMETER Auth
No description available.
.PARAMETER Kex
No description available.
.PARAMETER Mac
No description available.
.PARAMETER Crypto
No description available.
.OUTPUTS

SSHConfig<PSCustomObject>
#>


function Initialize-SS6SSHConfig {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SoftwareId},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Greeting},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ZCompress},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${UseAllocator},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AssumeUtf8},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${OverrideTimeout},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${AllowForwardingTo},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${SftpVer},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Auth},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Kex},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Mac},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Crypto}
    )

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


        $PSO = [PSCustomObject]@{
            "softwareId" = ${SoftwareId}
            "greeting" = ${Greeting}
            "zCompress" = ${ZCompress}
            "useAllocator" = ${UseAllocator}
            "assumeUtf8" = ${AssumeUtf8}
            "overrideTimeout" = ${OverrideTimeout}
            "allowForwardingTo" = ${AllowForwardingTo}
            "sftpVer" = ${SftpVer}
            "auth" = ${Auth}
            "kex" = ${Kex}
            "mac" = ${Mac}
            "crypto" = ${Crypto}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SSHConfig<PSCustomObject>

.DESCRIPTION

Convert from JSON to SSHConfig<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SSHConfig<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SS6SSHConfig
        $AllProperties = ("softwareId", "greeting", "zCompress", "useAllocator", "assumeUtf8", "overrideTimeout", "allowForwardingTo", "sftpVer", "auth", "kex", "mac", "crypto")
        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 "softwareId"))) { #optional property not found
            $SoftwareId = $null
        } else {
            $SoftwareId = $JsonParameters.PSobject.Properties["softwareId"].value
        }

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "softwareId" = ${SoftwareId}
            "greeting" = ${Greeting}
            "zCompress" = ${ZCompress}
            "useAllocator" = ${UseAllocator}
            "assumeUtf8" = ${AssumeUtf8}
            "overrideTimeout" = ${OverrideTimeout}
            "allowForwardingTo" = ${AllowForwardingTo}
            "sftpVer" = ${SftpVer}
            "auth" = ${Auth}
            "kex" = ${Kex}
            "mac" = ${Mac}
            "crypto" = ${Crypto}
        }

        return $PSO
    }

}