Model/ClusterSdnFabricsNodeInner.ps1
# # Proxmox PowerShell VE # Generated module to access all Proxmox VE Api Endpoints. This module has been generated from the proxmox api description v. 9.0.8 # Version: 9.0.8 # Contact: mail@timo-wolf.de # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Protocol No description available. .PARAMETER Ip6 No description available. .PARAMETER Ip No description available. .PARAMETER LockToken No description available. .PARAMETER NodeId No description available. .PARAMETER FabricId No description available. .PARAMETER Digest No description available. .PARAMETER Interfaces No description available. .OUTPUTS ClusterSdnFabricsNodeInner<PSCustomObject> #> function Initialize-PVEClusterSdnFabricsNodeInner { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("openfabric", "ospf")] [String] ${Protocol}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Ip6}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Ip}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${LockToken}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${NodeId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${FabricId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Digest}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Interfaces} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEClusterSdnFabricsNodeInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Digest -and $Digest.length -gt 64) { throw "invalid value for 'Digest', the character length must be smaller than or equal to 64." } $DisplayNameMapping =@{ "Protocol"="protocol"; "Ip6"="ip6"; "Ip"="ip"; "LockToken"="lock-token"; "NodeId"="node_id"; "FabricId"="fabric_id"; "Digest"="digest"; "Interfaces"="interfaces" } $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 ClusterSdnFabricsNodeInner<PSCustomObject> .DESCRIPTION Convert from JSON to ClusterSdnFabricsNodeInner<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ClusterSdnFabricsNodeInner<PSCustomObject> #> function ConvertFrom-PVEJsonToClusterSdnFabricsNodeInner { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEClusterSdnFabricsNodeInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEClusterSdnFabricsNodeInner $AllProperties = ("protocol", "ip6", "ip", "lock-token", "node_id", "fabric_id", "digest", "interfaces") 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 "protocol"))) { #optional property not found $Protocol = $null } else { $Protocol = $JsonParameters.PSobject.Properties["protocol"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ip6"))) { #optional property not found $Ip6 = $null } else { $Ip6 = $JsonParameters.PSobject.Properties["ip6"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ip"))) { #optional property not found $Ip = $null } else { $Ip = $JsonParameters.PSobject.Properties["ip"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "lock-token"))) { #optional property not found $LockToken = $null } else { $LockToken = $JsonParameters.PSobject.Properties["lock-token"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "node_id"))) { #optional property not found $NodeId = $null } else { $NodeId = $JsonParameters.PSobject.Properties["node_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "fabric_id"))) { #optional property not found $FabricId = $null } else { $FabricId = $JsonParameters.PSobject.Properties["fabric_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "digest"))) { #optional property not found $Digest = $null } else { $Digest = $JsonParameters.PSobject.Properties["digest"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "interfaces"))) { #optional property not found $Interfaces = $null } else { $Interfaces = $JsonParameters.PSobject.Properties["interfaces"].value } $PSO = [PSCustomObject]@{ "protocol" = ${Protocol} "ip6" = ${Ip6} "ip" = ${Ip} "lock-token" = ${LockToken} "node_id" = ${NodeId} "fabric_id" = ${FabricId} "digest" = ${Digest} "interfaces" = ${Interfaces} } return $PSO } } |