Model/Policyviolationresponse.ps1
|
# # Identity Security Cloud API - SOD Violations # 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 separation-of-duties policy violation for an identity. .PARAMETER Owner No description available. .PARAMETER Target No description available. .PARAMETER Policy No description available. .PARAMETER Status No description available. .PARAMETER Level No description available. .OUTPUTS Policyviolationresponse<PSCustomObject> #> function Initialize-Policyviolationresponse { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Owner}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Target}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Policy}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("Open", "Mitigated", "Remediated", "Closed")] [PSCustomObject] ${Status}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("Low", "Medium", "High", "Critical")] [PSCustomObject] ${Level} ) Process { 'Creating PSCustomObject: PSSailpoint.SodViolations => Policyviolationresponse' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Owner) { throw "invalid value for 'Owner', 'Owner' cannot be null." } if (!$Target) { throw "invalid value for 'Target', 'Target' cannot be null." } if (!$Policy) { throw "invalid value for 'Policy', 'Policy' cannot be null." } if (!$Status) { throw "invalid value for 'Status', 'Status' cannot be null." } if (!$Level) { throw "invalid value for 'Level', 'Level' cannot be null." } $PSO = [PSCustomObject]@{ "owner" = ${Owner} "target" = ${Target} "policy" = ${Policy} "status" = ${Status} "level" = ${Level} } return $PSO } } <# .SYNOPSIS Convert from JSON to Policyviolationresponse<PSCustomObject> .DESCRIPTION Convert from JSON to Policyviolationresponse<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Policyviolationresponse<PSCustomObject> #> function ConvertFrom-JsonToPolicyviolationresponse { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.SodViolations => Policyviolationresponse' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in Policyviolationresponse $AllProperties = ("id", "name", "created", "modified", "lastEvaluatedDate", "owner", "conflictingCriteria", "appliedControls", "expiration", "target", "policy", "status", "level") 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 'id' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { throw "Error! JSON cannot be serialized due to the required property 'id' missing." } else { $Id = $JsonParameters.PSobject.Properties["id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "created"))) { throw "Error! JSON cannot be serialized due to the required property 'created' missing." } else { $Created = $JsonParameters.PSobject.Properties["created"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "modified"))) { throw "Error! JSON cannot be serialized due to the required property 'modified' missing." } else { $Modified = $JsonParameters.PSobject.Properties["modified"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "owner"))) { throw "Error! JSON cannot be serialized due to the required property 'owner' missing." } else { $Owner = $JsonParameters.PSobject.Properties["owner"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "conflictingCriteria"))) { throw "Error! JSON cannot be serialized due to the required property 'conflictingCriteria' missing." } else { $ConflictingCriteria = $JsonParameters.PSobject.Properties["conflictingCriteria"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "appliedControls"))) { throw "Error! JSON cannot be serialized due to the required property 'appliedControls' missing." } else { $AppliedControls = $JsonParameters.PSobject.Properties["appliedControls"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "expiration"))) { throw "Error! JSON cannot be serialized due to the required property 'expiration' missing." } else { $Expiration = $JsonParameters.PSobject.Properties["expiration"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "target"))) { throw "Error! JSON cannot be serialized due to the required property 'target' missing." } else { $Target = $JsonParameters.PSobject.Properties["target"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "policy"))) { throw "Error! JSON cannot be serialized due to the required property 'policy' missing." } else { $Policy = $JsonParameters.PSobject.Properties["policy"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { throw "Error! JSON cannot be serialized due to the required property 'status' missing." } else { $Status = $JsonParameters.PSobject.Properties["status"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "level"))) { throw "Error! JSON cannot be serialized due to the required property 'level' missing." } else { $Level = $JsonParameters.PSobject.Properties["level"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found $Name = $null } else { $Name = $JsonParameters.PSobject.Properties["name"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "lastEvaluatedDate"))) { #optional property not found $LastEvaluatedDate = $null } else { $LastEvaluatedDate = $JsonParameters.PSobject.Properties["lastEvaluatedDate"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} "created" = ${Created} "modified" = ${Modified} "lastEvaluatedDate" = ${LastEvaluatedDate} "owner" = ${Owner} "conflictingCriteria" = ${ConflictingCriteria} "appliedControls" = ${AppliedControls} "expiration" = ${Expiration} "target" = ${Target} "policy" = ${Policy} "status" = ${Status} "level" = ${Level} } return $PSO } } |