Model/BatchWorkflowOptions.ps1

#
# NERM API
# The NERM API accesss and modifies resources in your environment.
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER AllProfiles
Used for batch workflows.
.PARAMETER MultipleRequests
Used for batch workflows for if multiple requests.
.OUTPUTS

BatchWorkflowOptions<PSCustomObject>
#>


function Initialize-NERMBatchWorkflowOptions {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("true", "false")]
        [String]
        ${AllProfiles},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("true", "false")]
        [String]
        ${MultipleRequests}
    )

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


        $PSO = [PSCustomObject]@{
            "all_profiles" = ${AllProfiles}
            "multiple_requests" = ${MultipleRequests}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to BatchWorkflowOptions<PSCustomObject>

.DESCRIPTION

Convert from JSON to BatchWorkflowOptions<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

BatchWorkflowOptions<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

        $PSO = [PSCustomObject]@{
            "all_profiles" = ${AllProfiles}
            "multiple_requests" = ${MultipleRequests}
        }

        return $PSO
    }

}