Model/AuditDetails.ps1

#
# Identity Security Cloud V2024 API
# 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: v2024
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Audit details for the reassignment configuration of an identity

.PARAMETER Created
Initial date and time when the record was created
.PARAMETER CreatedBy
No description available.
.PARAMETER Modified
Last modified date and time for the record
.PARAMETER ModifiedBy
No description available.
.OUTPUTS

AuditDetails<PSCustomObject>
#>


function Initialize-V2024AuditDetails {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CreatedBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ModifiedBy}
    )

    Process {
        'Creating PSCustomObject: Tm.V2024 => V2024AuditDetails' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "createdBy" = ${CreatedBy}
            "modified" = ${Modified}
            "modifiedBy" = ${ModifiedBy}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AuditDetails<PSCustomObject>

.DESCRIPTION

Convert from JSON to AuditDetails<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AuditDetails<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Tm.V2024 => V2024AuditDetails' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024AuditDetails
        $AllProperties = ("created", "createdBy", "modified", "modifiedBy")
        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 "createdBy"))) { #optional property not found
            $CreatedBy = $null
        } else {
            $CreatedBy = $JsonParameters.PSobject.Properties["createdBy"].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 "modifiedBy"))) { #optional property not found
            $ModifiedBy = $null
        } else {
            $ModifiedBy = $JsonParameters.PSobject.Properties["modifiedBy"].value
        }

        $PSO = [PSCustomObject]@{
            "created" = ${Created}
            "createdBy" = ${CreatedBy}
            "modified" = ${Modified}
            "modifiedBy" = ${ModifiedBy}
        }

        return $PSO
    }

}