Model/TeamLifecycleGallery.ps1

#
# Cloud Governance Api
# Contact: support@avepoint.com
#

<#
TeamLifecycleGallery<PSCustomObject>
#>


function New-TeamLifecycleGallery {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TeamInfo},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TeamLifecycleActionDetails},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryInternalName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${GalleryMetadata}
    )

    Process {
        'Creating PSCustomObject: Cloud.Governance.Client => TeamLifecycleGallery' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "TeamInfo" = ${TeamInfo}
            "TeamLifecycleActionDetails" = ${TeamLifecycleActionDetails}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }
}

<#
TeamLifecycleGallery<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in TeamLifecycleGallery
        $AllProperties = $("TeamInfo", "TeamLifecycleActionDetails", "GalleryType", "GalleryInternalName", "GalleryMetadata")
        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 "TeamInfo"))) { #optional property not found
            $TeamInfo = $null
        } else {
            $TeamInfo = $JsonParameters.PSobject.Properties["TeamInfo"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "TeamInfo" = ${TeamInfo}
            "TeamLifecycleActionDetails" = ${TeamLifecycleActionDetails}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }

}