beta/src/PSSailpointBeta/Model/TriggerInputSavedSearchComplete.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow 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 FileName
A name for the report file.
.PARAMETER OwnerEmail
The email address of the identity that owns the saved search.
.PARAMETER OwnerName
The name of the identity that owns the saved search.
.PARAMETER Query
The search query that was used to generate the report.
.PARAMETER SearchName
The name of the saved search.
.PARAMETER SearchResults
No description available.
.PARAMETER SignedS3Url
The Amazon S3 URL to download the report from.
.OUTPUTS

TriggerInputSavedSearchComplete<PSCustomObject>
#>


function Initialize-BetaTriggerInputSavedSearchComplete {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FileName},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerEmail},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerName},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Query},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SearchName},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SearchResults},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SignedS3Url}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaTriggerInputSavedSearchComplete' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if ($null -eq $FileName) {
            throw "invalid value for 'FileName', 'FileName' cannot be null."
        }

        if ($null -eq $OwnerEmail) {
            throw "invalid value for 'OwnerEmail', 'OwnerEmail' cannot be null."
        }

        if ($null -eq $OwnerName) {
            throw "invalid value for 'OwnerName', 'OwnerName' cannot be null."
        }

        if ($null -eq $Query) {
            throw "invalid value for 'Query', 'Query' cannot be null."
        }

        if ($null -eq $SearchName) {
            throw "invalid value for 'SearchName', 'SearchName' cannot be null."
        }

        if ($null -eq $SearchResults) {
            throw "invalid value for 'SearchResults', 'SearchResults' cannot be null."
        }

        if ($null -eq $SignedS3Url) {
            throw "invalid value for 'SignedS3Url', 'SignedS3Url' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "fileName" = ${FileName}
            "ownerEmail" = ${OwnerEmail}
            "ownerName" = ${OwnerName}
            "query" = ${Query}
            "searchName" = ${SearchName}
            "searchResults" = ${SearchResults}
            "signedS3Url" = ${SignedS3Url}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to TriggerInputSavedSearchComplete<PSCustomObject>

.DESCRIPTION

Convert from JSON to TriggerInputSavedSearchComplete<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

TriggerInputSavedSearchComplete<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaTriggerInputSavedSearchComplete' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaTriggerInputSavedSearchComplete
        $AllProperties = ("fileName", "ownerEmail", "ownerName", "query", "searchName", "searchResults", "signedS3Url")
        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 'fileName' missing."
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "fileName" = ${FileName}
            "ownerEmail" = ${OwnerEmail}
            "ownerName" = ${OwnerName}
            "query" = ${Query}
            "searchName" = ${SearchName}
            "searchResults" = ${SearchResults}
            "signedS3Url" = ${SignedS3Url}
        }

        return $PSO
    }

}