Model/Entitlementconnectionsearchhit.ps1

#
# Identity Security Cloud API - Entitlement Connections
# 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: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Entitlement connection record returned by search-backed list endpoints.

.PARAMETER Id
Connection ID as represented in search results.
.PARAMETER Identity
Identity summary object from search index.
.PARAMETER MachineIdentity
Machine identity summary object when available.
.PARAMETER Account
Account summary object.
.PARAMETER Entitlement
No description available.
.PARAMETER Source
Source summary object.
.PARAMETER State
Connection state object.
.PARAMETER Jit
JIT timestamps for lifecycle events.
.PARAMETER Standalone
Indicates whether the connection is marked as standalone.
.PARAMETER Type
Connection type classification.
.OUTPUTS

Entitlementconnectionsearchhit<PSCustomObject>
#>


function Initialize-Entitlementconnectionsearchhit {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Identity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${MachineIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Account},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Entitlement},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${State},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Jit},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Standalone} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("JIT", "STANDING", "NA")]
        [String]
        ${Type}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "identity" = ${Identity}
            "machineIdentity" = ${MachineIdentity}
            "account" = ${Account}
            "entitlement" = ${Entitlement}
            "source" = ${Source}
            "state" = ${State}
            "jit" = ${Jit}
            "standalone" = ${Standalone}
            "type" = ${Type}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Entitlementconnectionsearchhit<PSCustomObject>

.DESCRIPTION

Convert from JSON to Entitlementconnectionsearchhit<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Entitlementconnectionsearchhit<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Entitlementconnectionsearchhit
        $AllProperties = ("id", "identity", "machineIdentity", "account", "entitlement", "source", "state", "jit", "standalone", "type")
        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 "identity"))) { #optional property not found
            $Identity = $null
        } else {
            $Identity = $JsonParameters.PSobject.Properties["identity"].value
        }

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "identity" = ${Identity}
            "machineIdentity" = ${MachineIdentity}
            "account" = ${Account}
            "entitlement" = ${Entitlement}
            "source" = ${Source}
            "state" = ${State}
            "jit" = ${Jit}
            "standalone" = ${Standalone}
            "type" = ${Type}
        }

        return $PSO
    }

}