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