Model/Identitycollectorfieldmapping.ps1

#
# Identity Security Cloud API - Data Access Security
# 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 FieldDictionaryName
The name of the data dictionary field to map to. Dictionary fields of type Users apply to the users collection; dictionary fields of type Roles apply to the groups collection.
.PARAMETER SourceAttributeName
The source attribute name to read at runtime. This may be a built-in attribute for the identity collector type or a custom attribute listed in `properties` for the same collection. Built-in attributes can be discovered using the identity collector properties metadata endpoint.
.OUTPUTS

Identitycollectorfieldmapping<PSCustomObject>
#>


function Initialize-Identitycollectorfieldmapping {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FieldDictionaryName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceAttributeName}
    )

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

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

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


        $PSO = [PSCustomObject]@{
            "fieldDictionaryName" = ${FieldDictionaryName}
            "sourceAttributeName" = ${SourceAttributeName}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Identitycollectorfieldmapping<PSCustomObject>

.DESCRIPTION

Convert from JSON to Identitycollectorfieldmapping<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Identitycollectorfieldmapping<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

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

        $PSO = [PSCustomObject]@{
            "fieldDictionaryName" = ${FieldDictionaryName}
            "sourceAttributeName" = ${SourceAttributeName}
        }

        return $PSO
    }

}