nerm/src/PSSailpoint.NERM/Model/PageContent1.ps1
|
# # NERM API # The NERM API accesss and modifies resources in your environment. # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Uid The user-specified identifier for the record .PARAMETER Type The type of content on the page. .PARAMETER Content The text content to present in this page content record. .OUTPUTS PageContent1<PSCustomObject> #> function Initialize-NERMPageContent1 { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Uid}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("FormHeading", "LargeHeading", "MediumHeading", "SmallHeading", "Paragraph", "HtmlContainer", "Owner", "RequestProgressBar")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Content} ) Process { 'Creating PSCustomObject: PSSailpoint.NERM => NERMPageContent1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Type) { throw "invalid value for 'Type', 'Type' cannot be null." } $PSO = [PSCustomObject]@{ "uid" = ${Uid} "type" = ${Type} "content" = ${Content} } return $PSO } } <# .SYNOPSIS Convert from JSON to PageContent1<PSCustomObject> .DESCRIPTION Convert from JSON to PageContent1<PSCustomObject> .PARAMETER Json Json object .OUTPUTS PageContent1<PSCustomObject> #> function ConvertFrom-NERMJsonToPageContent1 { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMPageContent1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMPageContent1 $AllProperties = ("uid", "type", "content") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json throw "Error! Empty JSON cannot be serialized due to the required property 'type' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { throw "Error! JSON cannot be serialized due to the required property 'type' missing." } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "uid"))) { #optional property not found $Uid = $null } else { $Uid = $JsonParameters.PSobject.Properties["uid"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "content"))) { #optional property not found $Content = $null } else { $Content = $JsonParameters.PSobject.Properties["content"].value } $PSO = [PSCustomObject]@{ "uid" = ${Uid} "type" = ${Type} "content" = ${Content} } return $PSO } } |