Model/SpeedLimit.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 Source IPv4/6 address or Network to which this limit applies. This field is required .PARAMETER UpKbps Upload speed limit in KB/s. If omitted 0 is assumed. 0 means unlimited .PARAMETER DnKbps Download speed limit in KB/s. If omitted 0 is assumed. 0 means unlimited .OUTPUTS SpeedLimit<PSCustomObject> #> function Initialize-SS6SpeedLimit { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [String] ${Source}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${UpKbps}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${DnKbps} ) Process { 'Creating PSCustomObject: SS6AdminModule => SS6SpeedLimit' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "source" = ${Source} "upKbps" = ${UpKbps} "dnKbps" = ${DnKbps} } return $PSO } } <# .SYNOPSIS Convert from JSON to SpeedLimit<PSCustomObject> .DESCRIPTION Convert from JSON to SpeedLimit<PSCustomObject> .PARAMETER Json Json object .OUTPUTS SpeedLimit<PSCustomObject> #> function ConvertFrom-SS6JsonToSpeedLimit { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: SS6AdminModule => SS6SpeedLimit' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in SS6SpeedLimit $AllProperties = ("source", "upKbps", "dnKbps") 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 "source"))) { #optional property not found $Source = $null } else { $Source = $JsonParameters.PSobject.Properties["source"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "upKbps"))) { #optional property not found $UpKbps = $null } else { $UpKbps = $JsonParameters.PSobject.Properties["upKbps"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "dnKbps"))) { #optional property not found $DnKbps = $null } else { $DnKbps = $JsonParameters.PSobject.Properties["dnKbps"].value } $PSO = [PSCustomObject]@{ "source" = ${Source} "upKbps" = ${UpKbps} "dnKbps" = ${DnKbps} } return $PSO } } |