lib/Classes/Public/TMActionParameters.ps1
class TMActionParameters { [String]$type # 'should be a class of it's own [String]$paramName [String]$description [String]$context [String]$fieldName [String]$fieldLabel [object]$value [Int]$order [bool]$required [bool]$encoded [bool]$invalid [bool]$readonly # [bool]$Prompt TMActionParameters() {} TMActionParameters([String]$_json) { $this.paramName = ($_json | ConvertFrom-Json).paramName } TMActionParameters([PsCustomObject]$_item) { $this.paramName = $_item.paramName $this.context = $_item.context $this.description = $_item.description ?? $_item.desc $this.type = $_item.type ?? 'string' $this.fieldName = $_item.fieldName ?? '' $this.fieldLabel = $_item.fieldLabel ?? '' $this.order = $_item.order ?? 0 $this.readonly = $_item.readonly ?? $true $this.required = $_item.required ?? $true $this.value = $_item.value ?? '' $this.encoded = $_item.encoded ?? $false $this.invalid = $_item.invalid ?? $false # $this.prompt = $this.prompt ?? ($_item.paramName -like 'get_') } } |