Model/ApiCommonResponseMetadata.ps1

#
# Confide 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 TotalCount
No description available.
.PARAMETER NextLink
No description available.
.PARAMETER Extra
No description available.
.OUTPUTS
 
ApiCommonResponseMetadata<PSCustomObject>
#>


function Initialize-ConfideApiCommonResponseMetadata {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NextLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Extra}
    )

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


        $PSO = [PSCustomObject]@{
            "totalCount" = ${TotalCount}
            "nextLink" = ${NextLink}
            "extra" = ${Extra}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

        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 "extra"))) { #optional property not found
            $Extra = $null
        } else {
            $Extra = $JsonParameters.PSobject.Properties["extra"].value
        }

        $PSO = [PSCustomObject]@{
            "totalCount" = ${TotalCount}
            "nextLink" = ${NextLink}
            "extra" = ${Extra}
        }

        return $PSO
    }

}