v2025/src/PSSailpoint.V2025/Model/SourceCreationErrors.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER SourceName
Source's human-readable name.
.PARAMETER SourceError
Source's human-readable description.
.PARAMETER Created
Date-time when the source was created
.PARAMETER Modified
Date-time when the source was last modified.
.PARAMETER Operation
operation category (e.g. DELETE).
.OUTPUTS

SourceCreationErrors<PSCustomObject>
#>


function Initialize-V2025SourceCreationErrors {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceError},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Operation}
    )

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


        $PSO = [PSCustomObject]@{
            "source_name" = ${SourceName}
            "source_error" = ${SourceError}
            "created" = ${Created}
            "modified" = ${Modified}
            "operation" = ${Operation}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SourceCreationErrors<PSCustomObject>

.DESCRIPTION

Convert from JSON to SourceCreationErrors<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SourceCreationErrors<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025SourceCreationErrors
        $AllProperties = ("multihostId", "source_name", "source_error", "created", "modified", "operation")
        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 "multihostId"))) { #optional property not found
            $MultihostId = $null
        } else {
            $MultihostId = $JsonParameters.PSobject.Properties["multihostId"].value
        }

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

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

        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 "operation"))) { #optional property not found
            $Operation = $null
        } else {
            $Operation = $JsonParameters.PSobject.Properties["operation"].value
        }

        $PSO = [PSCustomObject]@{
            "multihostId" = ${MultihostId}
            "source_name" = ${SourceName}
            "source_error" = ${SourceError}
            "created" = ${Created}
            "modified" = ${Modified}
            "operation" = ${Operation}
        }

        return $PSO
    }

}