Model/CreateRoomMailboxRoomPlaceRequestModel.ps1

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

<#
CreateRoomMailboxRoomPlaceRequestModel<PSCustomObject>
#>


function New-CreateRoomMailboxRoomPlaceRequestModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Building},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Floor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FloorLabel},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActivityId}
    )

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

        
        $PSO = [PSCustomObject]@{
            "Building" = ${Building}
            "Floor" = ${Floor}
            "FloorLabel" = ${FloorLabel}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }
}

<#
CreateRoomMailboxRoomPlaceRequestModel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CreateRoomMailboxRoomPlaceRequestModel
        $AllProperties = $("Building", "Floor", "FloorLabel", "ActivityId")
        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 "Building"))) { #optional property not found
            $Building = $null
        } else {
            $Building = $JsonParameters.PSobject.Properties["Building"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "Building" = ${Building}
            "Floor" = ${Floor}
            "FloorLabel" = ${FloorLabel}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }

}