nerm/src/PSSailpoint.NERM/Model/Language.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 Default Set default to True to set a default language, to set another language to default, set default to True on the target language and the current default will become disabled .PARAMETER Enabled True when the language is enabled, False when it is not .PARAMETER Locale The locale string for the language, current options are- en, fr, es, de, fr-CA .OUTPUTS Language<PSCustomObject> #> function Initialize-NERMLanguage { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${Default}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${Enabled}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Locale} ) Process { 'Creating PSCustomObject: PSSailpoint.NERM => NERMLanguage' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "default" = ${Default} "enabled" = ${Enabled} "locale" = ${Locale} } return $PSO } } <# .SYNOPSIS Convert from JSON to Language<PSCustomObject> .DESCRIPTION Convert from JSON to Language<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Language<PSCustomObject> #> function ConvertFrom-NERMJsonToLanguage { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMLanguage' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMLanguage $AllProperties = ("default", "enabled", "locale") 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 "default"))) { #optional property not found $Default = $null } else { $Default = $JsonParameters.PSobject.Properties["default"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "enabled"))) { #optional property not found $Enabled = $null } else { $Enabled = $JsonParameters.PSobject.Properties["enabled"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "locale"))) { #optional property not found $Locale = $null } else { $Locale = $JsonParameters.PSobject.Properties["locale"].value } $PSO = [PSCustomObject]@{ "default" = ${Default} "enabled" = ${Enabled} "locale" = ${Locale} } return $PSO } } |