beta/src/PSSailpointBeta/Model/ResourceObject.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Representation of the object which is returned from source connectors.

.PARAMETER Instance
Identifier of the specific instance where this object resides.
.PARAMETER Identity
Native identity of the object in the Source.
.PARAMETER Uuid
Universal unique identifier of the object in the Source.
.PARAMETER PreviousIdentity
Native identity that the object has previously.
.PARAMETER Name
Display name for this object.
.PARAMETER ObjectType
Type of object.
.PARAMETER Incomplete
A flag indicating that this is an incomplete object. Used in special cases where the connector has to return account information in several phases and the objects might not have a complete set of all account attributes. The attributes in this object will replace the corresponding attributes in the Link, but no other Link attributes will be changed.
.PARAMETER Incremental
A flag indicating that this is an incremental change object. This is similar to incomplete but it also means that the values of any multi-valued attributes in this object should be merged with the existing values in the Link rather than replacing the existing Link value.
.PARAMETER Delete
A flag indicating that this object has been deleted. This is set only when doing delta aggregation and the connector supports detection of native deletes.
.PARAMETER Remove
A flag set indicating that the values in the attributes represent things to remove rather than things to add. Setting this implies incremental. The values which are always for multi-valued attributes are removed from the current values.
.PARAMETER Missing
A list of attribute names that are not included in this object. This is only used with SMConnector and will only contain ""groups"".
.PARAMETER Attributes
Attributes of this ResourceObject.
.PARAMETER FinalUpdate
In Aggregation, for sparse object the count for total accounts scanned identities updated is not incremented.
.OUTPUTS

ResourceObject<PSCustomObject>
#>


function Initialize-BetaResourceObject {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Instance},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Identity},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Uuid},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PreviousIdentity},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ObjectType},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Incomplete},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Incremental},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Delete},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Remove},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Missing},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Attributes},
        [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${FinalUpdate}
    )

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


        $PSO = [PSCustomObject]@{
            "instance" = ${Instance}
            "identity" = ${Identity}
            "uuid" = ${Uuid}
            "previousIdentity" = ${PreviousIdentity}
            "name" = ${Name}
            "objectType" = ${ObjectType}
            "incomplete" = ${Incomplete}
            "incremental" = ${Incremental}
            "delete" = ${Delete}
            "remove" = ${Remove}
            "missing" = ${Missing}
            "attributes" = ${Attributes}
            "finalUpdate" = ${FinalUpdate}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ResourceObject<PSCustomObject>

.DESCRIPTION

Convert from JSON to ResourceObject<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ResourceObject<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaResourceObject
        $AllProperties = ("instance", "identity", "uuid", "previousIdentity", "name", "objectType", "incomplete", "incremental", "delete", "remove", "missing", "attributes", "finalUpdate")
        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 "instance"))) { #optional property not found
            $Instance = $null
        } else {
            $Instance = $JsonParameters.PSobject.Properties["instance"].value
        }

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "previousIdentity"))) { #optional property not found
            $PreviousIdentity = $null
        } else {
            $PreviousIdentity = $JsonParameters.PSobject.Properties["previousIdentity"].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 "objectType"))) { #optional property not found
            $ObjectType = $null
        } else {
            $ObjectType = $JsonParameters.PSobject.Properties["objectType"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "instance" = ${Instance}
            "identity" = ${Identity}
            "uuid" = ${Uuid}
            "previousIdentity" = ${PreviousIdentity}
            "name" = ${Name}
            "objectType" = ${ObjectType}
            "incomplete" = ${Incomplete}
            "incremental" = ${Incremental}
            "delete" = ${Delete}
            "remove" = ${Remove}
            "missing" = ${Missing}
            "attributes" = ${Attributes}
            "finalUpdate" = ${FinalUpdate}
        }

        return $PSO
    }

}