v2024/src/PSSailpoint.V2024/Model/DataSegment.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 Id
The segment's ID.
.PARAMETER Name
The segment's business name.
.PARAMETER Created
The time when the segment is created.
.PARAMETER Modified
The time when the segment is modified.
.PARAMETER Description
The segment's optional description.
.PARAMETER Scopes
List of Scopes that are assigned to the segment
.PARAMETER MemberSelection
List of Identities that are assigned to the segment
.PARAMETER MemberFilter
No description available.
.PARAMETER Membership
No description available.
.PARAMETER Enabled
This boolean indicates whether the segment is currently active. Inactive segments have no effect.
.PARAMETER Published
This boolean indicates whether the segment is being applied to the accounts. If unpublished its being actively modified to until published
.OUTPUTS

DataSegment<PSCustomObject>
#>


function Initialize-V2024DataSegment {
    [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)]
        [PSCustomObject[]]
        ${Scopes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${MemberSelection},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MemberFilter},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ALL", "FILTER", "SELECTION")]
        [PSCustomObject]
        ${Membership},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Enabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Published} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "description" = ${Description}
            "scopes" = ${Scopes}
            "memberSelection" = ${MemberSelection}
            "memberFilter" = ${MemberFilter}
            "membership" = ${Membership}
            "enabled" = ${Enabled}
            "published" = ${Published}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to DataSegment<PSCustomObject>

.DESCRIPTION

Convert from JSON to DataSegment<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

DataSegment<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024DataSegment
        $AllProperties = ("id", "name", "created", "modified", "description", "scopes", "memberSelection", "memberFilter", "membership", "enabled", "published")
        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 "scopes"))) { #optional property not found
            $Scopes = $null
        } else {
            $Scopes = $JsonParameters.PSobject.Properties["scopes"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "description" = ${Description}
            "scopes" = ${Scopes}
            "memberSelection" = ${MemberSelection}
            "memberFilter" = ${MemberFilter}
            "membership" = ${Membership}
            "enabled" = ${Enabled}
            "published" = ${Published}
        }

        return $PSO
    }

}