Model/FilterSummaryModelApiQueryResult.ps1

#
# Fly SDK API
# No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
# Version: 1.0
# Contact: support@avepoint.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS
 
No summary available.
 
.DESCRIPTION
 
No description available.
 
.PARAMETER NextLink
The link of next page result, null if there is no more data
.PARAMETER VarData
The real data set
.PARAMETER TotalCount
No description available.
.PARAMETER Properties
No description available.
.OUTPUTS
 
FilterSummaryModelApiQueryResult<PSCustomObject>
#>


function Initialize-FlyFilterSummaryModelApiQueryResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NextLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${VarData},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Properties}
    )

    Process {
        'Creating PSCustomObject: Fly.Client => FlyFilterSummaryModelApiQueryResult' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "nextLink" = ${NextLink}
            "data" = ${VarData}
            "totalCount" = ${TotalCount}
            "properties" = ${Properties}
        }

        return $PSO
    }
}

<#
.SYNOPSIS
 
Convert from JSON to FilterSummaryModelApiQueryResult<PSCustomObject>
 
.DESCRIPTION
 
Convert from JSON to FilterSummaryModelApiQueryResult<PSCustomObject>
 
.PARAMETER Json
 
Json object
 
.OUTPUTS
 
FilterSummaryModelApiQueryResult<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Fly.Client => FlyFilterSummaryModelApiQueryResult' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in FlyFilterSummaryModelApiQueryResult
        $AllProperties = ("nextLink", "data", "totalCount", "properties")
        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 "nextLink"))) { #optional property not found
            $NextLink = $null
        } else {
            $NextLink = $JsonParameters.PSobject.Properties["nextLink"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "nextLink" = ${NextLink}
            "data" = ${VarData}
            "totalCount" = ${TotalCount}
            "properties" = ${Properties}
        }

        return $PSO
    }

}