beta/src/PSSailpoint.Beta/Model/LauncherRequest.ps1

#
# Identity Security Cloud Beta API
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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: 3.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Name
Name of the Launcher, limited to 255 characters
.PARAMETER Description
Description of the Launcher, limited to 2000 characters
.PARAMETER Type
Launcher type
.PARAMETER Disabled
State of the Launcher
.PARAMETER Reference
No description available.
.PARAMETER Config
JSON configuration associated with this Launcher, restricted to a max size of 4KB
.OUTPUTS

LauncherRequest<PSCustomObject>
#>


function Initialize-BetaLauncherRequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("INTERACTIVE_PROCESS")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${Disabled},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Reference},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidatePattern("^\{\}$")]
        [String]
        ${Config}
    )

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

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

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

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

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

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "description" = ${Description}
            "type" = ${Type}
            "disabled" = ${Disabled}
            "reference" = ${Reference}
            "config" = ${Config}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to LauncherRequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to LauncherRequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

LauncherRequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaLauncherRequest
        $AllProperties = ("name", "description", "type", "disabled", "reference", "config")
        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 'name' missing."
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "description" = ${Description}
            "type" = ${Type}
            "disabled" = ${Disabled}
            "reference" = ${Reference}
            "config" = ${Config}
        }

        return $PSO
    }

}