beta/src/PSSailpointBeta/Model/TriggerInputSavedSearchCompleteSearchResultsEntitlement.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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: 3.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

A table of entitlements that match the search criteria.

.PARAMETER Count
The number of rows in the table.
.PARAMETER Noun
The type of object represented in the table.
.PARAMETER Preview
A sample of the data in the table.
.OUTPUTS

TriggerInputSavedSearchCompleteSearchResultsEntitlement<PSCustomObject>
#>


function Initialize-BetaTriggerInputSavedSearchCompleteSearchResultsEntitlement {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Count},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Noun},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String[][]]
        ${Preview}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaTriggerInputSavedSearchCompleteSearchResultsEntitlement' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if ($null -eq $Count) {
            throw "invalid value for 'Count', 'Count' cannot be null."
        }

        if ($null -eq $Noun) {
            throw "invalid value for 'Noun', 'Noun' cannot be null."
        }

        if ($null -eq $Preview) {
            throw "invalid value for 'Preview', 'Preview' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "count" = ${Count}
            "noun" = ${Noun}
            "preview" = ${Preview}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to TriggerInputSavedSearchCompleteSearchResultsEntitlement<PSCustomObject>

.DESCRIPTION

Convert from JSON to TriggerInputSavedSearchCompleteSearchResultsEntitlement<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

TriggerInputSavedSearchCompleteSearchResultsEntitlement<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaTriggerInputSavedSearchCompleteSearchResultsEntitlement' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaTriggerInputSavedSearchCompleteSearchResultsEntitlement
        $AllProperties = ("count", "noun", "preview")
        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 'count' missing."
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "count" = ${Count}
            "noun" = ${Noun}
            "preview" = ${Preview}
        }

        return $PSO
    }

}