v3/src/PSSailpoint/Model/CampaignAllOf.ps1

#
# IdentityNow V3 API
# Use these APIs to interact with the IdentityNow 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: 3.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Created
Created time of the campaign
.PARAMETER Modified
Modified time of the campaign
.PARAMETER CorrelatedStatus
The correlatedStatus of the campaign. Only SOURCE_OWNER campaigns can be Uncorrelated. An Uncorrelated certification campaign only includes Uncorrelated identities (An identity is uncorrelated if it has no accounts on an authoritative source).
.PARAMETER VarFilter
No description available.
.PARAMETER SunsetCommentsRequired
Determines if comments on sunset date changes are required.
.PARAMETER SourceOwnerCampaignInfo
No description available.
.PARAMETER SearchCampaignInfo
No description available.
.PARAMETER RoleCompositionCampaignInfo
No description available.
.PARAMETER Alerts
A list of errors and warnings that have accumulated.
.PARAMETER TotalCertifications
The total number of certifications in this campaign.
.PARAMETER CompletedCertifications
The number of completed certifications in this campaign.
.PARAMETER SourcesWithOrphanEntitlements
A list of sources in the campaign that contain \""orphan entitlements\"" (entitlements without a corresponding Managed Attribute). An empty list indicates the campaign has no orphan entitlements. Null indicates there may be unknown orphan entitlements in the campaign (the campaign was created before this feature was implemented).
.PARAMETER MandatoryCommentRequirement
Determines whether comments are required for decisions during certification reviews. You can require comments for all decisions, revoke-only decisions, or no decisions. By default, comments are not required for decisions.
.OUTPUTS

CampaignAllOf<PSCustomObject>
#>


function Initialize-CampaignAllOf {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("CORRELATED", "UNCORRELATED")]
        [PSCustomObject]
        ${CorrelatedStatus},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${VarFilter},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SunsetCommentsRequired} = $true,
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SourceOwnerCampaignInfo},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SearchCampaignInfo},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RoleCompositionCampaignInfo},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Alerts},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalCertifications},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${CompletedCertifications},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${SourcesWithOrphanEntitlements},
        [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ALL_DECISIONS", "REVOKE_ONLY_DECISIONS", "NO_DECISIONS")]
        [String]
        ${MandatoryCommentRequirement}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint => CampaignAllOf' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "modified" = ${Modified}
            "correlatedStatus" = ${CorrelatedStatus}
            "filter" = ${VarFilter}
            "sunsetCommentsRequired" = ${SunsetCommentsRequired}
            "sourceOwnerCampaignInfo" = ${SourceOwnerCampaignInfo}
            "searchCampaignInfo" = ${SearchCampaignInfo}
            "roleCompositionCampaignInfo" = ${RoleCompositionCampaignInfo}
            "alerts" = ${Alerts}
            "totalCertifications" = ${TotalCertifications}
            "completedCertifications" = ${CompletedCertifications}
            "sourcesWithOrphanEntitlements" = ${SourcesWithOrphanEntitlements}
            "mandatoryCommentRequirement" = ${MandatoryCommentRequirement}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CampaignAllOf<PSCustomObject>

.DESCRIPTION

Convert from JSON to CampaignAllOf<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CampaignAllOf<PSCustomObject>
#>

function ConvertFrom-JsonToCampaignAllOf {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint => CampaignAllOf' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CampaignAllOf
        $AllProperties = ("created", "modified", "correlatedStatus", "filter", "sunsetCommentsRequired", "sourceOwnerCampaignInfo", "searchCampaignInfo", "roleCompositionCampaignInfo", "alerts", "totalCertifications", "completedCertifications", "sourcesWithOrphanEntitlements", "mandatoryCommentRequirement")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "created"))) { #optional property not found
            $Created = $null
        } else {
            $Created = $JsonParameters.PSobject.Properties["created"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "modified"))) { #optional property not found
            $Modified = $null
        } else {
            $Modified = $JsonParameters.PSobject.Properties["modified"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "correlatedStatus"))) { #optional property not found
            $CorrelatedStatus = $null
        } else {
            $CorrelatedStatus = $JsonParameters.PSobject.Properties["correlatedStatus"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "filter"))) { #optional property not found
            $VarFilter = $null
        } else {
            $VarFilter = $JsonParameters.PSobject.Properties["filter"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sunsetCommentsRequired"))) { #optional property not found
            $SunsetCommentsRequired = $null
        } else {
            $SunsetCommentsRequired = $JsonParameters.PSobject.Properties["sunsetCommentsRequired"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sourceOwnerCampaignInfo"))) { #optional property not found
            $SourceOwnerCampaignInfo = $null
        } else {
            $SourceOwnerCampaignInfo = $JsonParameters.PSobject.Properties["sourceOwnerCampaignInfo"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "searchCampaignInfo"))) { #optional property not found
            $SearchCampaignInfo = $null
        } else {
            $SearchCampaignInfo = $JsonParameters.PSobject.Properties["searchCampaignInfo"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "roleCompositionCampaignInfo"))) { #optional property not found
            $RoleCompositionCampaignInfo = $null
        } else {
            $RoleCompositionCampaignInfo = $JsonParameters.PSobject.Properties["roleCompositionCampaignInfo"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "alerts"))) { #optional property not found
            $Alerts = $null
        } else {
            $Alerts = $JsonParameters.PSobject.Properties["alerts"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "totalCertifications"))) { #optional property not found
            $TotalCertifications = $null
        } else {
            $TotalCertifications = $JsonParameters.PSobject.Properties["totalCertifications"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "completedCertifications"))) { #optional property not found
            $CompletedCertifications = $null
        } else {
            $CompletedCertifications = $JsonParameters.PSobject.Properties["completedCertifications"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sourcesWithOrphanEntitlements"))) { #optional property not found
            $SourcesWithOrphanEntitlements = $null
        } else {
            $SourcesWithOrphanEntitlements = $JsonParameters.PSobject.Properties["sourcesWithOrphanEntitlements"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "mandatoryCommentRequirement"))) { #optional property not found
            $MandatoryCommentRequirement = $null
        } else {
            $MandatoryCommentRequirement = $JsonParameters.PSobject.Properties["mandatoryCommentRequirement"].value
        }

        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "modified" = ${Modified}
            "correlatedStatus" = ${CorrelatedStatus}
            "filter" = ${VarFilter}
            "sunsetCommentsRequired" = ${SunsetCommentsRequired}
            "sourceOwnerCampaignInfo" = ${SourceOwnerCampaignInfo}
            "searchCampaignInfo" = ${SearchCampaignInfo}
            "roleCompositionCampaignInfo" = ${RoleCompositionCampaignInfo}
            "alerts" = ${Alerts}
            "totalCertifications" = ${TotalCertifications}
            "completedCertifications" = ${CompletedCertifications}
            "sourcesWithOrphanEntitlements" = ${SourcesWithOrphanEntitlements}
            "mandatoryCommentRequirement" = ${MandatoryCommentRequirement}
        }

        return $PSO
    }

}