Model/Compensatingcontrolcreate.ps1
|
# # Identity Security Cloud API - SOD Controls # 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 No description available. .PARAMETER Name The display name of the compensating control. .PARAMETER Description A human-readable description of the compensating control. .PARAMETER Owner No description available. .PARAMETER SecondaryOwners References to additional identities or governance groups that share ownership of the compensating control (maximum 10). .PARAMETER Type The type of compensating control that determines how a violation is addressed. .PARAMETER Action The action performed when the compensating control is applied. .PARAMETER Expiration The duration after which the applied control expires, expressed as a duration string. .PARAMETER JustificationRequired Indicates whether a justification is required when applying this control. .PARAMETER WorkflowID Workflow definition ID used when the control action is a workflow. .OUTPUTS Compensatingcontrolcreate<PSCustomObject> #> function Initialize-Compensatingcontrolcreate { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Description}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Owner}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${SecondaryOwners}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("Mitigation", "Remediation")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("Workflow", "Certification")] [String] ${Action}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Expiration}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${JustificationRequired} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${WorkflowID} ) Process { 'Creating PSCustomObject: PSSailpoint.SodControls => Compensatingcontrolcreate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Name) { throw "invalid value for 'Name', 'Name' cannot be null." } if ($Name.length -gt 128) { throw "invalid value for 'Name', the character length must be smaller than or equal to 128." } if (!$Description -and $Description.length -gt 1024) { throw "invalid value for 'Description', the character length must be smaller than or equal to 1024." } if (!$Owner) { throw "invalid value for 'Owner', 'Owner' cannot be null." } if (!$SecondaryOwners -and $SecondaryOwners.length -gt 10) { throw "invalid value for 'SecondaryOwners', number of items must be less than or equal to 10." } if (!$Type) { throw "invalid value for 'Type', 'Type' cannot be null." } $PSO = [PSCustomObject]@{ "name" = ${Name} "description" = ${Description} "owner" = ${Owner} "secondaryOwners" = ${SecondaryOwners} "type" = ${Type} "action" = ${Action} "expiration" = ${Expiration} "justificationRequired" = ${JustificationRequired} "workflowID" = ${WorkflowID} } return $PSO } } <# .SYNOPSIS Convert from JSON to Compensatingcontrolcreate<PSCustomObject> .DESCRIPTION Convert from JSON to Compensatingcontrolcreate<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Compensatingcontrolcreate<PSCustomObject> #> function ConvertFrom-JsonToCompensatingcontrolcreate { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.SodControls => Compensatingcontrolcreate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in Compensatingcontrolcreate $AllProperties = ("name", "description", "owner", "secondaryOwners", "type", "action", "expiration", "justificationRequired", "workflowID") 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 'name' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { throw "Error! JSON cannot be serialized due to the required property 'name' missing." } else { $Name = $JsonParameters.PSobject.Properties["name"].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 "type"))) { throw "Error! JSON cannot be serialized due to the required property 'type' missing." } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "description"))) { #optional property not found $Description = $null } else { $Description = $JsonParameters.PSobject.Properties["description"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "secondaryOwners"))) { #optional property not found $SecondaryOwners = $null } else { $SecondaryOwners = $JsonParameters.PSobject.Properties["secondaryOwners"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "action"))) { #optional property not found $Action = $null } else { $Action = $JsonParameters.PSobject.Properties["action"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "expiration"))) { #optional property not found $Expiration = $null } else { $Expiration = $JsonParameters.PSobject.Properties["expiration"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "justificationRequired"))) { #optional property not found $JustificationRequired = $null } else { $JustificationRequired = $JsonParameters.PSobject.Properties["justificationRequired"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "workflowID"))) { #optional property not found $WorkflowID = $null } else { $WorkflowID = $JsonParameters.PSobject.Properties["workflowID"].value } $PSO = [PSCustomObject]@{ "name" = ${Name} "description" = ${Description} "owner" = ${Owner} "secondaryOwners" = ${SecondaryOwners} "type" = ${Type} "action" = ${Action} "expiration" = ${Expiration} "justificationRequired" = ${JustificationRequired} "workflowID" = ${WorkflowID} } return $PSO } } |