Model/MicrosoftODataEdmIEdmModel.ps1

#
# Portal Api
# Portal Api HTTP API V1
# Version: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS
 
No summary available.
 
.DESCRIPTION
 
No description available.
 
.PARAMETER DirectValueAnnotationsManager
No description available.
.PARAMETER EntityContainer
No description available.
.OUTPUTS
 
MicrosoftODataEdmIEdmModel<PSCustomObject>
#>


function Initialize-ElementsMicrosoftODataEdmIEdmModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DirectValueAnnotationsManager},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EntityContainer}
    )

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


        $PSO = [PSCustomObject]@{
            "directValueAnnotationsManager" = ${DirectValueAnnotationsManager}
            "entityContainer" = ${EntityContainer}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ElementsMicrosoftODataEdmIEdmModel
        $AllProperties = ("schemaElements", "vocabularyAnnotations", "referencedModels", "declaredNamespaces", "directValueAnnotationsManager", "entityContainer")
        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 "schemaElements"))) { #optional property not found
            $SchemaElements = $null
        } else {
            $SchemaElements = $JsonParameters.PSobject.Properties["schemaElements"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "schemaElements" = ${SchemaElements}
            "vocabularyAnnotations" = ${VocabularyAnnotations}
            "referencedModels" = ${ReferencedModels}
            "declaredNamespaces" = ${DeclaredNamespaces}
            "directValueAnnotationsManager" = ${DirectValueAnnotationsManager}
            "entityContainer" = ${EntityContainer}
        }

        return $PSO
    }

}