Model/TagSummaryModel.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 Name
The name of the object
.PARAMETER Description
The description of the object
.PARAMETER CreateTime
The creation time of the object
.PARAMETER CreateBy
The user who create this object
.PARAMETER LastModifyTime
The last modified time of the object
.PARAMETER LastModifyBy
The user who last modified the object
.PARAMETER Id
The GUID of the object
.OUTPUTS
 
TagSummaryModel<PSCustomObject>
#>


function Initialize-FlyTagSummaryModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${CreateTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CreateBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${LastModifyTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastModifyBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id}
    )

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "description" = ${Description}
            "createTime" = ${CreateTime}
            "createBy" = ${CreateBy}
            "lastModifyTime" = ${LastModifyTime}
            "lastModifyBy" = ${LastModifyBy}
            "id" = ${Id}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in FlyTagSummaryModel
        $AllProperties = ("name", "description", "createTime", "createBy", "lastModifyTime", "lastModifyBy", "id")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "description" = ${Description}
            "createTime" = ${CreateTime}
            "createBy" = ${CreateBy}
            "lastModifyTime" = ${LastModifyTime}
            "lastModifyBy" = ${LastModifyBy}
            "id" = ${Id}
        }

        return $PSO
    }

}