v2024/src/PSSailpoint.V2024/Model/SpConfigExportResults.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

Response model for config export download response.

.PARAMETER Version
Current version of the export results object.
.PARAMETER Timestamp
Time the export was completed.
.PARAMETER Tenant
Name of the tenant where this export originated.
.PARAMETER Description
Optional user defined description/name for export job.
.PARAMETER Options
No description available.
.PARAMETER Objects
No description available.
.OUTPUTS

SpConfigExportResults<PSCustomObject>
#>


function Initialize-V2024SpConfigExportResults {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Version},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Timestamp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Tenant},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Options},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Objects}
    )

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


        $PSO = [PSCustomObject]@{
            "version" = ${Version}
            "timestamp" = ${Timestamp}
            "tenant" = ${Tenant}
            "description" = ${Description}
            "options" = ${Options}
            "objects" = ${Objects}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SpConfigExportResults<PSCustomObject>

.DESCRIPTION

Convert from JSON to SpConfigExportResults<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SpConfigExportResults<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024SpConfigExportResults
        $AllProperties = ("version", "timestamp", "tenant", "description", "options", "objects")
        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 "version"))) { #optional property not found
            $Version = $null
        } else {
            $Version = $JsonParameters.PSobject.Properties["version"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "version" = ${Version}
            "timestamp" = ${Timestamp}
            "tenant" = ${Tenant}
            "description" = ${Description}
            "options" = ${Options}
            "objects" = ${Objects}
        }

        return $PSO
    }

}