v2025/src/PSSailpoint.V2025/Model/IdentityEntitlementDetailsEntitlementDto.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 Id
The entitlement id
.PARAMETER Name
The entitlement name
.PARAMETER Created
Time when the entitlement was last modified
.PARAMETER Modified
Time when the entitlement was last modified
.PARAMETER Description
The description of the entitlement
.PARAMETER Type
The type of the object, will always be ""ENTITLEMENT""
.PARAMETER SourceId
The source ID
.PARAMETER SourceName
The source name
.PARAMETER Owner
No description available.
.PARAMETER Value
The value of the entitlement
.PARAMETER Flags
a list of properties informing the viewer about the entitlement
.OUTPUTS

IdentityEntitlementDetailsEntitlementDto<PSCustomObject>
#>


function Initialize-V2025IdentityEntitlementDetailsEntitlementDto {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owner},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Value},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Flags}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "description" = ${Description}
            "type" = ${Type}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "owner" = ${Owner}
            "value" = ${Value}
            "flags" = ${Flags}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to IdentityEntitlementDetailsEntitlementDto<PSCustomObject>

.DESCRIPTION

Convert from JSON to IdentityEntitlementDetailsEntitlementDto<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

IdentityEntitlementDetailsEntitlementDto<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025IdentityEntitlementDetailsEntitlementDto
        $AllProperties = ("id", "name", "created", "modified", "description", "type", "sourceId", "sourceName", "owner", "value", "flags")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].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 "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 "description"))) { #optional property not found
            $Description = $null
        } else {
            $Description = $JsonParameters.PSobject.Properties["description"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "description" = ${Description}
            "type" = ${Type}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "owner" = ${Owner}
            "value" = ${Value}
            "flags" = ${Flags}
        }

        return $PSO
    }

}