intelligence/src/PSSailpoint.Intelligence/Model/Intelnhicapabilitybucket.ps1

#
# SailPoint Identity Security API - Intelligence
# Use these APIs to interact with the SailPoint Identity Security 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

First page of one capability kind on the non-human identity lookup.

.PARAMETER Items
Capabilities of this kind linked to the identity.
.PARAMETER TotalCount
Total count for this kind. Omitted when items is empty.
.PARAMETER Next
URL for the next page of this kind. Omitted when all rows fit on this page.
.OUTPUTS

Intelnhicapabilitybucket<PSCustomObject>
#>


function Initialize-Intelnhicapabilitybucket {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Items},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Next}
    )

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

        if (!$Items) {
            throw "invalid value for 'Items', 'Items' cannot be null."
        }

        if ($TotalCount -and $TotalCount -lt 1) {
          throw "invalid value for 'TotalCount', must be greater than or equal to 1."
        }


        $PSO = [PSCustomObject]@{
            "items" = ${Items}
            "totalCount" = ${TotalCount}
            "next" = ${Next}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Intelnhicapabilitybucket<PSCustomObject>

.DESCRIPTION

Convert from JSON to Intelnhicapabilitybucket<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Intelnhicapabilitybucket<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Intelnhicapabilitybucket
        $AllProperties = ("items", "totalCount", "next")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'items' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "items"))) {
            throw "Error! JSON cannot be serialized due to the required property 'items' missing."
        } else {
            $Items = $JsonParameters.PSobject.Properties["items"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "items" = ${Items}
            "totalCount" = ${TotalCount}
            "next" = ${Next}
        }

        return $PSO
    }

}