Model/Correlationrule.ps1
|
# # Identity Security Cloud API - Machine Identities # Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. # Version: v1 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION A single correlation rule within an ownership correlation config. .PARAMETER Id Omit for new rules (server mints a UUID). Send only when updating a rule that already exists on this config (merge on PATCH). Unknown ids are rejected. .PARAMETER Priority The evaluation priority of the rule. Lower values are evaluated first. .PARAMETER DefaultRule Whether this rule is the default rule for the config. .PARAMETER RuleType The rule subject type. When either ruleType or ruleAction.type is GOVERNANCE_GROUP, both must be; ruleType GOVERNANCE_GROUP is allowed only when the parent config type is OWNER_SECONDARY. .PARAMETER RuleAction No description available. .PARAMETER ConditionExpressions The conditions that must match for this rule to apply. .OUTPUTS Correlationrule<PSCustomObject> #> function Initialize-Correlationrule { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [Int32] ${Priority}, [Parameter(ValueFromPipelineByPropertyName = $true)] [Boolean] ${DefaultRule}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("IDENTITY", "ACCOUNT", "GOVERNANCE_GROUP")] [String] ${RuleType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${RuleAction}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${ConditionExpressions} ) Process { 'Creating PSCustomObject: PSSailpoint.MachineIdentities => Correlationrule' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Priority) { throw "invalid value for 'Priority', 'Priority' cannot be null." } if (!$DefaultRule) { throw "invalid value for 'DefaultRule', 'DefaultRule' cannot be null." } if (!$RuleType) { throw "invalid value for 'RuleType', 'RuleType' cannot be null." } if (!$RuleAction) { throw "invalid value for 'RuleAction', 'RuleAction' cannot be null." } if (!$ConditionExpressions) { throw "invalid value for 'ConditionExpressions', 'ConditionExpressions' cannot be null." } $PSO = [PSCustomObject]@{ "id" = ${Id} "priority" = ${Priority} "defaultRule" = ${DefaultRule} "ruleType" = ${RuleType} "ruleAction" = ${RuleAction} "conditionExpressions" = ${ConditionExpressions} } return $PSO } } <# .SYNOPSIS Convert from JSON to Correlationrule<PSCustomObject> .DESCRIPTION Convert from JSON to Correlationrule<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Correlationrule<PSCustomObject> #> function ConvertFrom-JsonToCorrelationrule { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.MachineIdentities => Correlationrule' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in Correlationrule $AllProperties = ("id", "priority", "defaultRule", "ruleType", "ruleAction", "conditionExpressions") 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 'priority' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "priority"))) { throw "Error! JSON cannot be serialized due to the required property 'priority' missing." } else { $Priority = $JsonParameters.PSobject.Properties["priority"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "defaultRule"))) { throw "Error! JSON cannot be serialized due to the required property 'defaultRule' missing." } else { $DefaultRule = $JsonParameters.PSobject.Properties["defaultRule"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ruleType"))) { throw "Error! JSON cannot be serialized due to the required property 'ruleType' missing." } else { $RuleType = $JsonParameters.PSobject.Properties["ruleType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ruleAction"))) { throw "Error! JSON cannot be serialized due to the required property 'ruleAction' missing." } else { $RuleAction = $JsonParameters.PSobject.Properties["ruleAction"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "conditionExpressions"))) { throw "Error! JSON cannot be serialized due to the required property 'conditionExpressions' missing." } else { $ConditionExpressions = $JsonParameters.PSobject.Properties["conditionExpressions"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else { $Id = $JsonParameters.PSobject.Properties["id"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "priority" = ${Priority} "defaultRule" = ${DefaultRule} "ruleType" = ${RuleType} "ruleAction" = ${RuleAction} "conditionExpressions" = ${ConditionExpressions} } return $PSO } } |