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

No description available.

.PARAMETER Id
Unique identifier for this scheduled action.
.PARAMETER Created
The time when this scheduled action was created.
.PARAMETER JobType
Type of the scheduled job.
.PARAMETER Content
No description available.
.PARAMETER StartTime
The time when this scheduled action should start.
.PARAMETER CronString
Cron expression defining the schedule for this action.
.PARAMETER TimeZoneId
Time zone ID for interpreting the cron expression.
.OUTPUTS

ScheduledActionResponse<PSCustomObject>
#>


function Initialize-V2024ScheduledActionResponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("BACKUP", "CREATE_DRAFT", "CONFIG_DEPLOY_DRAFT")]
        [String]
        ${JobType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Content},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${StartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CronString},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TimeZoneId}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "created" = ${Created}
            "jobType" = ${JobType}
            "content" = ${Content}
            "startTime" = ${StartTime}
            "cronString" = ${CronString}
            "timeZoneId" = ${TimeZoneId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ScheduledActionResponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to ScheduledActionResponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ScheduledActionResponse<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024ScheduledActionResponse
        $AllProperties = ("id", "created", "jobType", "content", "startTime", "cronString", "timeZoneId")
        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 "created"))) { #optional property not found
            $Created = $null
        } else {
            $Created = $JsonParameters.PSobject.Properties["created"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "created" = ${Created}
            "jobType" = ${JobType}
            "content" = ${Content}
            "startTime" = ${StartTime}
            "cronString" = ${CronString}
            "timeZoneId" = ${TimeZoneId}
        }

        return $PSO
    }

}