Model/DataAccess2.ps1

#
# Identity Security Cloud API - Next Generation Certification Campaigns
# 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

No description available.

.PARAMETER Policies
List of classification policies that apply to resources the entitlement or group has access to.
.PARAMETER Categories
List of classification categories that apply to resources the entitlement or group has access to.
.PARAMETER ImpactScore
No description available.
.PARAMETER Modified
Modification date of Data Access
.OUTPUTS

DataAccess2<PSCustomObject>
#>


function Initialize-DataAccess2 {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Policies},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Categories},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ImpactScore},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified}
    )

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


        $PSO = [PSCustomObject]@{
            "policies" = ${Policies}
            "categories" = ${Categories}
            "impactScore" = ${ImpactScore}
            "modified" = ${Modified}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to DataAccess2<PSCustomObject>

.DESCRIPTION

Convert from JSON to DataAccess2<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

DataAccess2<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in DataAccess2
        $AllProperties = ("policies", "categories", "impactScore", "modified")
        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 "policies"))) { #optional property not found
            $Policies = $null
        } else {
            $Policies = $JsonParameters.PSobject.Properties["policies"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "policies" = ${Policies}
            "categories" = ${Categories}
            "impactScore" = ${ImpactScore}
            "modified" = ${Modified}
        }

        return $PSO
    }

}