Model/ContextAttributeDto.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

No description available.

.PARAMETER Attribute
The name of the attribute
.PARAMETER Value
No description available.
.PARAMETER Derived
True if the attribute was derived.
.OUTPUTS

ContextAttributeDto<PSCustomObject>
#>


function Initialize-V2024ContextAttributeDto {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Attribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Value},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Derived} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "attribute" = ${Attribute}
            "value" = ${Value}
            "derived" = ${Derived}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ContextAttributeDto<PSCustomObject>

.DESCRIPTION

Convert from JSON to ContextAttributeDto<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ContextAttributeDto<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024ContextAttributeDto
        $AllProperties = ("attribute", "value", "derived")
        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 "attribute"))) { #optional property not found
            $Attribute = $null
        } else {
            $Attribute = $JsonParameters.PSobject.Properties["attribute"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "attribute" = ${Attribute}
            "value" = ${Value}
            "derived" = ${Derived}
        }

        return $PSO
    }

}