Model/ClusterMetricsExportDataInner.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 Id Unique identifier for this metric object, for instance 'node/<nodename>' or 'qemu/<vmid>'. .PARAMETER Metric Name of the metric. .PARAMETER Timestamp Time at which this metric was observed .PARAMETER Type Type of the metric. .PARAMETER Value Metric value. .OUTPUTS ClusterMetricsExportDataInner<PSCustomObject> #> function Initialize-PVEClusterMetricsExportDataInner { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Metric}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Timestamp}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("gauge", "counter", "derive")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Decimal]] ${Value} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEClusterMetricsExportDataInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $DisplayNameMapping =@{ "Id"="id"; "Metric"="metric"; "Timestamp"="timestamp"; "Type"="type"; "Value"="value" } $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 ClusterMetricsExportDataInner<PSCustomObject> .DESCRIPTION Convert from JSON to ClusterMetricsExportDataInner<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ClusterMetricsExportDataInner<PSCustomObject> #> function ConvertFrom-PVEJsonToClusterMetricsExportDataInner { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEClusterMetricsExportDataInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEClusterMetricsExportDataInner $AllProperties = ("id", "metric", "timestamp", "type", "value") 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 "id"))) { #optional property not found $Id = $null } else { $Id = $JsonParameters.PSobject.Properties["id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "metric"))) { #optional property not found $Metric = $null } else { $Metric = $JsonParameters.PSobject.Properties["metric"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "timestamp"))) { #optional property not found $Timestamp = $null } else { $Timestamp = $JsonParameters.PSobject.Properties["timestamp"].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 "value"))) { #optional property not found $Value = $null } else { $Value = $JsonParameters.PSobject.Properties["value"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "metric" = ${Metric} "timestamp" = ${Timestamp} "type" = ${Type} "value" = ${Value} } return $PSO } } |