Model/PictureType.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

idIfBuiltIn or base64IfCustom are mandatory based on PictureKind

.PARAMETER Kind
No description available.
.PARAMETER IdIfBuiltIn
No description available.
.PARAMETER Base64IfCustom
No description available.
.OUTPUTS

PictureType<PSCustomObject>
#>


function Initialize-SS6PictureType {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Kind},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${IdIfBuiltIn},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Base64IfCustom}
    )

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


        $PSO = [PSCustomObject]@{
            "kind" = ${Kind}
            "idIfBuiltIn" = ${IdIfBuiltIn}
            "base64IfCustom" = ${Base64IfCustom}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to PictureType<PSCustomObject>

.DESCRIPTION

Convert from JSON to PictureType<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

PictureType<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SS6PictureType
        $AllProperties = ("kind", "idIfBuiltIn", "base64IfCustom")
        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 "kind"))) { #optional property not found
            $Kind = $null
        } else {
            $Kind = $JsonParameters.PSobject.Properties["kind"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "kind" = ${Kind}
            "idIfBuiltIn" = ${IdIfBuiltIn}
            "base64IfCustom" = ${Base64IfCustom}
        }

        return $PSO
    }

}