Model/SedBatchRecord.ps1

#
# Identity Security Cloud V2024 API
# 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: v2024
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Sed Batch Record

.PARAMETER TenantId
The tenant ID associated with the batch.
.PARAMETER BatchId
The unique ID of the batch.
.PARAMETER Name
The name of the batch.
.PARAMETER ProcessedState
The current state of the batch (e.g., submitted, materialized, completed).
.PARAMETER RequestedBy
The ID of the user who requested the batch.
.PARAMETER MaterializedCount
The number of items materialized in the batch.
.PARAMETER ProcessedCount
The number of items processed in the batch.
.PARAMETER CreatedAt
The timestamp when the batch was created.
.PARAMETER UpdatedAt
The timestamp when the batch was last updated.
.OUTPUTS

SedBatchRecord<PSCustomObject>
#>


function Initialize-V2024SedBatchRecord {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${BatchId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProcessedState},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RequestedBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${MaterializedCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ProcessedCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${CreatedAt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${UpdatedAt}
    )

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


        $PSO = [PSCustomObject]@{
            "tenantId" = ${TenantId}
            "batchId" = ${BatchId}
            "name" = ${Name}
            "processedState" = ${ProcessedState}
            "requestedBy" = ${RequestedBy}
            "materializedCount" = ${MaterializedCount}
            "processedCount" = ${ProcessedCount}
            "createdAt" = ${CreatedAt}
            "updatedAt" = ${UpdatedAt}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to SedBatchRecord<PSCustomObject>

.DESCRIPTION

Convert from JSON to SedBatchRecord<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SedBatchRecord<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024SedBatchRecord
        $AllProperties = ("tenantId", "batchId", "name", "processedState", "requestedBy", "materializedCount", "processedCount", "createdAt", "updatedAt")
        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 "tenantId"))) { #optional property not found
            $TenantId = $null
        } else {
            $TenantId = $JsonParameters.PSobject.Properties["tenantId"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "batchId"))) { #optional property not found
            $BatchId = $null
        } else {
            $BatchId = $JsonParameters.PSobject.Properties["batchId"].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 "processedState"))) { #optional property not found
            $ProcessedState = $null
        } else {
            $ProcessedState = $JsonParameters.PSobject.Properties["processedState"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "tenantId" = ${TenantId}
            "batchId" = ${BatchId}
            "name" = ${Name}
            "processedState" = ${ProcessedState}
            "requestedBy" = ${RequestedBy}
            "materializedCount" = ${MaterializedCount}
            "processedCount" = ${ProcessedCount}
            "createdAt" = ${CreatedAt}
            "updatedAt" = ${UpdatedAt}
        }

        return $PSO
    }

}