beta/src/PSSailpointBeta/Model/SavedSearchComplete.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 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

SavedSearchComplete<PSCustomObject>
#>


function Initialize-BetaSavedSearchComplete {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Query},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SearchName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SearchResults},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SignedS3Url}
    )

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

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

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

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

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

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

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

        if (!$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 SavedSearchComplete<PSCustomObject>

.DESCRIPTION

Convert from JSON to SavedSearchComplete<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

SavedSearchComplete<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaSavedSearchComplete
        $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
    }

}