Model/CreateScheduleRequest.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER TaskTypeName
The type or category of the scheduled task.
.PARAMETER ScheduleType
The scheduling type, such as ""Daily"", ""Weekly"" etc.
.PARAMETER Interval
The interval depends on the chosen schedule cycle (scheduleType), i.e. if the schedule is daily, the interval will represent the days between executions.
.PARAMETER ScheduleTaskName
The display name of the scheduled task.
.PARAMETER StartTime
The start time for the scheduled task, represented as epoch seconds.
.PARAMETER EndTime
The end time for the scheduled task, represented as epoch seconds.
.PARAMETER DaysOfWeek
A list of days of the week when the task should run (e.g., ""Monday"", ""Wednesday"").
.PARAMETER Active
Indicates whether the scheduled task is currently active.
.PARAMETER RunAfterScheduleTaskId
The ID of another scheduled task that triggers this scheduled task upon its completion.
.PARAMETER ApplicationId
The unique identifier of the application associated with the scheduled task.
.OUTPUTS

CreateScheduleRequest<PSCustomObject>
#>


function Initialize-V2025CreateScheduleRequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TaskTypeName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ScheduleType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Interval},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ScheduleTaskName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${StartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${EndTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${DaysOfWeek},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Active} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${RunAfterScheduleTaskId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ApplicationId}
    )

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


        $PSO = [PSCustomObject]@{
            "taskTypeName" = ${TaskTypeName}
            "scheduleType" = ${ScheduleType}
            "interval" = ${Interval}
            "scheduleTaskName" = ${ScheduleTaskName}
            "startTime" = ${StartTime}
            "endTime" = ${EndTime}
            "daysOfWeek" = ${DaysOfWeek}
            "active" = ${Active}
            "runAfterScheduleTaskId" = ${RunAfterScheduleTaskId}
            "applicationId" = ${ApplicationId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CreateScheduleRequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to CreateScheduleRequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CreateScheduleRequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025CreateScheduleRequest
        $AllProperties = ("taskTypeName", "scheduleType", "interval", "scheduleTaskName", "startTime", "endTime", "daysOfWeek", "active", "runAfterScheduleTaskId", "applicationId")
        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 "taskTypeName"))) { #optional property not found
            $TaskTypeName = $null
        } else {
            $TaskTypeName = $JsonParameters.PSobject.Properties["taskTypeName"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "taskTypeName" = ${TaskTypeName}
            "scheduleType" = ${ScheduleType}
            "interval" = ${Interval}
            "scheduleTaskName" = ${ScheduleTaskName}
            "startTime" = ${StartTime}
            "endTime" = ${EndTime}
            "daysOfWeek" = ${DaysOfWeek}
            "active" = ${Active}
            "runAfterScheduleTaskId" = ${RunAfterScheduleTaskId}
            "applicationId" = ${ApplicationId}
        }

        return $PSO
    }

}