Model/POSTAccessTfaRB.ps1
# # Proxmox VE # Generated module to access all Proxmox VE Api Endpoints # Version: 0.3 # Contact: amna.wolf@gmail.com # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Password No description available. .PARAMETER Type No description available. .PARAMETER Challenge No description available. .PARAMETER Description No description available. .PARAMETER Value No description available. .PARAMETER Userid No description available. .PARAMETER Totp No description available. .OUTPUTS POSTAccessTfaRB<PSCustomObject> #> function Initialize-PVEPOSTAccessTfaRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Password}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("totp", "u2f", "webauthn", "recovery", "yubico")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Challenge}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Description}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Value}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Userid}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Totp} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPOSTAccessTfaRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Password -and $Password.length -gt 64) { throw "invalid value for 'Password', the character length must be smaller than or equal to 64." } if (!$Password -and $Password.length -lt 5) { throw "invalid value for 'Password', the character length must be great than or equal to 5." } if (!$Description -and $Description.length -gt 255) { throw "invalid value for 'Description', the character length must be smaller than or equal to 255." } if (!$Userid -and $Userid.length -gt 64) { throw "invalid value for 'Userid', the character length must be smaller than or equal to 64." } $DisplayNameMapping =@{ "Password"="password"; "Type"="type"; "Challenge"="challenge"; "Description"="description"; "Value"="value"; "Userid"="userid"; "Totp"="totp" } $OBJ = @{} foreach($parameter in $PSBoundParameters.Keys){ #If Specifield map the Display name back $OBJ.($DisplayNameMapping.($parameter)) = "$PSBoundParameters.$parameter" } $PSO = [PSCustomObject]$OBJ return $PSO } } <# .SYNOPSIS Convert from JSON to POSTAccessTfaRB<PSCustomObject> .DESCRIPTION Convert from JSON to POSTAccessTfaRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS POSTAccessTfaRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPOSTAccessTfaRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPOSTAccessTfaRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPOSTAccessTfaRB $AllProperties = ("password", "type", "challenge", "description", "value", "userid", "totp") 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 "password"))) { #optional property not found $Password = $null } else { $Password = $JsonParameters.PSobject.Properties["password"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found $Type = $null } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "challenge"))) { #optional property not found $Challenge = $null } else { $Challenge = $JsonParameters.PSobject.Properties["challenge"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "description"))) { #optional property not found $Description = $null } else { $Description = $JsonParameters.PSobject.Properties["description"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "value"))) { #optional property not found $Value = $null } else { $Value = $JsonParameters.PSobject.Properties["value"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "userid"))) { #optional property not found $Userid = $null } else { $Userid = $JsonParameters.PSobject.Properties["userid"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "totp"))) { #optional property not found $Totp = $null } else { $Totp = $JsonParameters.PSobject.Properties["totp"].value } $PSO = [PSCustomObject]@{ "password" = ${Password} "type" = ${Type} "challenge" = ${Challenge} "description" = ${Description} "value" = ${Value} "userid" = ${Userid} "totp" = ${Totp} } return $PSO } } |