Model/SourceResourceMappingValue.ps1

#
# Identity Security Cloud API - Sources
# 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 DatasetId
Dataset identifier that owns the resource.
.PARAMETER ResourceType
Resource type from source schema config.
.PARAMETER ObjectType
Connector object type for the resource.
.OUTPUTS

SourceResourceMappingValue<PSCustomObject>
#>


function Initialize-SourceResourceMappingValue {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DatasetId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ResourceType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ObjectType}
    )

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


        $PSO = [PSCustomObject]@{
            "datasetId" = ${DatasetId}
            "resourceType" = ${ResourceType}
            "objectType" = ${ObjectType}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SourceResourceMappingValue<PSCustomObject>

.DESCRIPTION

Convert from JSON to SourceResourceMappingValue<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SourceResourceMappingValue<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SourceResourceMappingValue
        $AllProperties = ("datasetId", "resourceType", "objectType")
        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 "datasetId"))) { #optional property not found
            $DatasetId = $null
        } else {
            $DatasetId = $JsonParameters.PSobject.Properties["datasetId"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "datasetId" = ${DatasetId}
            "resourceType" = ${ResourceType}
            "objectType" = ${ObjectType}
        }

        return $PSO
    }

}