diff --git a/src/psm_parser.py b/src/psm_parser.py index 148b8f5..ebc0f41 100644 --- a/src/psm_parser.py +++ b/src/psm_parser.py @@ -10,17 +10,12 @@ function Get-AllCodeServerPages!NAME! { param ( [Parameter(Mandatory=$true)] [string]$Resource, - [Parameter(Mandatory=$true)] [string]$RootProperty, - [Parameter(Mandatory=$false)] [string]$CacheKeyProperty = "conceptCodeId", - [Parameter(Mandatory=$false)] [ScriptBlock]$Converter = ${function:ConvertFrom-CodeServerObject!NAME!}, - - [Parameter(Mandatory=$false)] [int]$PageSize = 500 ) @@ -32,7 +27,6 @@ function Get-AllCodeServerPages!NAME! { $cacheKey = $Resource.GetHashCode() $cache[$cacheKey] = @{} } - process { $currentPage = 0; $Global:debugOut = @() @@ -56,16 +50,12 @@ function Get-AllCodeServerPages!NAME! { $Global:cache[$cacheKey].Add($key, $codeObject.attributes) } } - } } - - write-output $cache[$cacheKey].Values - + write-output $cache[$cacheKey].Values } - + end { - } } """ @@ -76,42 +66,33 @@ function Get-CodeServerObject!NAME! { param ( [Parameter(Mandatory=$true)] [string]$conceptCodeId, - [Parameter(Mandatory=$true)] [string]$Resource, - [Parameter(Mandatory=$true)] [string]$RootProperty, - [Parameter(Mandatory=$false)] [string]$CacheKeyProperty = "conceptCodeId" ) begin { - if ($null -eq $Global:cache) { $params = @{ Resource = $Resource; RootProperty = $RootProperty; } - if ($PSBoundParameters.ContainsKey("CacheKeyProperty")) { $params.Add("CacheKeyProperty", $CacheKeyProperty) } - [void](Get-AllCodeServerPages!NAME! @params) } - $cacheKey = $Resource.GetHashCode() } - + process { Write-Debug $cacheKey Write-Output $cache[$cacheKey][$conceptCodeId] } - end { - } } """ @@ -151,9 +132,7 @@ class CodeServer!NAME! { } -Export-ModuleMember ConvertFrom-CodeServerObject!NAME! -Export-ModuleMember Get-AllCodeServerPages!NAME! -Export-ModuleMember Get-CodeServerObject!NAME! +Export-ModuleMember ConvertFrom-CodeServerObject!NAME!, Get-AllCodeServerPages!NAME!,Get-CodeServerObject!NAME! """ def define_maps(items: list[str]) -> str: