Model/Machineidentityaggregationrequest.ps1

#
# Identity Security Cloud API - Machine Identities
# 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 DatasetIds
List of dataset Ids to aggregate machine identities
.PARAMETER DisableOptimization
Flag to disable optimization for the aggregation. Defaults to false when not provided. When set to true, it disables aggregation optimizations and may increase processing time.
.OUTPUTS

Machineidentityaggregationrequest<PSCustomObject>
#>


function Initialize-Machineidentityaggregationrequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${DatasetIds},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DisableOptimization} = $false
    )

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

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


        $PSO = [PSCustomObject]@{
            "datasetIds" = ${DatasetIds}
            "disableOptimization" = ${DisableOptimization}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Machineidentityaggregationrequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to Machineidentityaggregationrequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Machineidentityaggregationrequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

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

        $PSO = [PSCustomObject]@{
            "datasetIds" = ${DatasetIds}
            "disableOptimization" = ${DisableOptimization}
        }

        return $PSO
    }

}