Model/SourceDatasetResource.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

Resource definition for a source. On create, `name`, `type`, `datasetId`, and `schema` are required. The `schema` must define at least one attribute plus `identityAttribute` and `displayAttribute`. The resource `id` is always server-generated from `name` (`customer:` plus a normalized form of `name`); any client-supplied `id` is ignored. After creation, schema attribute edits are made through the source schema APIs. `datasetId` associates the resource with a dataset and is recorded in the resource schema configuration.

.PARAMETER Name
Display name of the resource. Required on create.
.PARAMETER Features
Feature identifiers supported by this resource.
.PARAMETER Type
Resource type. Required on create.
.PARAMETER DatasetId
Dataset identifier to associate this resource with. Required on create.
.PARAMETER Schema
No description available.
.OUTPUTS

SourceDatasetResource<PSCustomObject>
#>


function Initialize-SourceDatasetResource {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Features},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DatasetId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Schema}
    )

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "features" = ${Features}
            "type" = ${Type}
            "datasetId" = ${DatasetId}
            "schema" = ${Schema}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SourceDatasetResource<PSCustomObject>

.DESCRIPTION

Convert from JSON to SourceDatasetResource<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SourceDatasetResource<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SourceDatasetResource
        $AllProperties = ("id", "name", "features", "type", "datasetId", "schema")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

        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 "schema"))) { #optional property not found
            $Schema = $null
        } else {
            $Schema = $JsonParameters.PSobject.Properties["schema"].value
        }

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "features" = ${Features}
            "type" = ${Type}
            "datasetId" = ${DatasetId}
            "schema" = ${Schema}
        }

        return $PSO
    }

}