Model/ProfileCheckAction.ps1
|
# # NERM API # The NERM API accesss and modifies resources in your environment. # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER WorkflowId The workflow the workflow action belongs to. .PARAMETER Description The description of the workflow action. .PARAMETER Archived If the workflow action is archived or not. .PARAMETER NeAttributeIds An array of ne_attribute_ids. .PARAMETER HandleType The handle type for what should happen if an existing profile is found. .PARAMETER HandleId The handle id. When handle type is session, this is the session id. .OUTPUTS ProfileCheckAction<PSCustomObject> #> function Initialize-NERMProfileCheckAction { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${WorkflowId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Description}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${Archived} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${NeAttributeIds}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("session", "attribute")] [String] ${HandleType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${HandleId} ) Process { 'Creating PSCustomObject: PSSailpoint.NERM => NERMProfileCheckAction' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$WorkflowId) { throw "invalid value for 'WorkflowId', 'WorkflowId' cannot be null." } if (!$Description) { throw "invalid value for 'Description', 'Description' cannot be null." } $PSO = [PSCustomObject]@{ "workflow_id" = ${WorkflowId} "description" = ${Description} "archived" = ${Archived} "ne_attribute_ids" = ${NeAttributeIds} "handle_type" = ${HandleType} "handle_id" = ${HandleId} } return $PSO } } <# .SYNOPSIS Convert from JSON to ProfileCheckAction<PSCustomObject> .DESCRIPTION Convert from JSON to ProfileCheckAction<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ProfileCheckAction<PSCustomObject> #> function ConvertFrom-NERMJsonToProfileCheckAction { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMProfileCheckAction' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMProfileCheckAction $AllProperties = ("workflow_id", "description", "archived", "ne_attribute_ids", "handle_type", "handle_id") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json throw "Error! Empty JSON cannot be serialized due to the required property 'workflow_id' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "workflow_id"))) { throw "Error! JSON cannot be serialized due to the required property 'workflow_id' missing." } else { $WorkflowId = $JsonParameters.PSobject.Properties["workflow_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "description"))) { throw "Error! JSON cannot be serialized due to the required property 'description' missing." } else { $Description = $JsonParameters.PSobject.Properties["description"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "archived"))) { #optional property not found $Archived = $null } else { $Archived = $JsonParameters.PSobject.Properties["archived"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ne_attribute_ids"))) { #optional property not found $NeAttributeIds = $null } else { $NeAttributeIds = $JsonParameters.PSobject.Properties["ne_attribute_ids"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "handle_type"))) { #optional property not found $HandleType = $null } else { $HandleType = $JsonParameters.PSobject.Properties["handle_type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "handle_id"))) { #optional property not found $HandleId = $null } else { $HandleId = $JsonParameters.PSobject.Properties["handle_id"].value } $PSO = [PSCustomObject]@{ "workflow_id" = ${WorkflowId} "description" = ${Description} "archived" = ${Archived} "ne_attribute_ids" = ${NeAttributeIds} "handle_type" = ${HandleType} "handle_id" = ${HandleId} } return $PSO } } |