Model/MicrosoftODataEdmVocabulariesIEdmVocabularyAnnotation.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 Term
No description available.
.PARAMETER Target
No description available.
.PARAMETER Value
No description available.
.OUTPUTS
 
MicrosoftODataEdmVocabulariesIEdmVocabularyAnnotation<PSCustomObject>
#>


function Initialize-ElementsMicrosoftODataEdmVocabulariesIEdmVocabularyAnnotation {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Term},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Target},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Value}
    )

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


        $PSO = [PSCustomObject]@{
            "term" = ${Term}
            "target" = ${Target}
            "value" = ${Value}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ElementsMicrosoftODataEdmVocabulariesIEdmVocabularyAnnotation
        $AllProperties = ("qualifier", "term", "target", "value")
        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 "qualifier"))) { #optional property not found
            $Qualifier = $null
        } else {
            $Qualifier = $JsonParameters.PSobject.Properties["qualifier"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "qualifier" = ${Qualifier}
            "term" = ${Term}
            "target" = ${Target}
            "value" = ${Value}
        }

        return $PSO
    }

}