Model/MicrosoftODataODataServiceDocument.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 TypeAnnotation No description available. .PARAMETER EntitySets No description available. .PARAMETER Singletons No description available. .PARAMETER FunctionImports No description available. .OUTPUTS MicrosoftODataODataServiceDocument<PSCustomObject> #> function Initialize-ElementsMicrosoftODataODataServiceDocument { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${TypeAnnotation}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${EntitySets}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Singletons}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${FunctionImports} ) Process { 'Creating PSCustomObject: Elements.Client => ElementsMicrosoftODataODataServiceDocument' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "typeAnnotation" = ${TypeAnnotation} "entitySets" = ${EntitySets} "singletons" = ${Singletons} "functionImports" = ${FunctionImports} } return $PSO } } <# .SYNOPSIS Convert from JSON to MicrosoftODataODataServiceDocument<PSCustomObject> .DESCRIPTION Convert from JSON to MicrosoftODataODataServiceDocument<PSCustomObject> .PARAMETER Json Json object .OUTPUTS MicrosoftODataODataServiceDocument<PSCustomObject> #> function ConvertFrom-ElementsJsonToMicrosoftODataODataServiceDocument { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Elements.Client => ElementsMicrosoftODataODataServiceDocument' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in ElementsMicrosoftODataODataServiceDocument $AllProperties = ("typeAnnotation", "entitySets", "singletons", "functionImports") 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 "typeAnnotation"))) { #optional property not found $TypeAnnotation = $null } else { $TypeAnnotation = $JsonParameters.PSobject.Properties["typeAnnotation"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "entitySets"))) { #optional property not found $EntitySets = $null } else { $EntitySets = $JsonParameters.PSobject.Properties["entitySets"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "singletons"))) { #optional property not found $Singletons = $null } else { $Singletons = $JsonParameters.PSobject.Properties["singletons"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "functionImports"))) { #optional property not found $FunctionImports = $null } else { $FunctionImports = $JsonParameters.PSobject.Properties["functionImports"].value } $PSO = [PSCustomObject]@{ "typeAnnotation" = ${TypeAnnotation} "entitySets" = ${EntitySets} "singletons" = ${Singletons} "functionImports" = ${FunctionImports} } return $PSO } } |