Model/VersionInfo.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 Name No description available. .PARAMETER Version No description available. .PARAMETER BuildDate No description available. .OUTPUTS VersionInfo<PSCustomObject> #> function Initialize-SS6VersionInfo { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [String] ${Version}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] [String] ${BuildDate} ) Process { 'Creating PSCustomObject: SS6AdminModule => SS6VersionInfo' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "name" = ${Name} "version" = ${Version} "build_date" = ${BuildDate} } return $PSO } } <# .SYNOPSIS Convert from JSON to VersionInfo<PSCustomObject> .DESCRIPTION Convert from JSON to VersionInfo<PSCustomObject> .PARAMETER Json Json object .OUTPUTS VersionInfo<PSCustomObject> #> function ConvertFrom-SS6JsonToVersionInfo { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: SS6AdminModule => SS6VersionInfo' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in SS6VersionInfo $AllProperties = ("name", "version", "build_date") 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 "name"))) { #optional property not found $Name = $null } else { $Name = $JsonParameters.PSobject.Properties["name"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "version"))) { #optional property not found $Version = $null } else { $Version = $JsonParameters.PSobject.Properties["version"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "build_date"))) { #optional property not found $BuildDate = $null } else { $BuildDate = $JsonParameters.PSobject.Properties["build_date"].value } $PSO = [PSCustomObject]@{ "name" = ${Name} "version" = ${Version} "build_date" = ${BuildDate} } return $PSO } } |