nerm/src/PSSailpoint.NERM/Model/SubmitRoleProfiles200Response.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 Json JSON object .OUTPUTS SubmitRoleProfiles200Response<PSCustomObject> #> function ConvertFrom-NERMJsonToSubmitRoleProfiles200Response { [CmdletBinding()] Param ( [AllowEmptyString()] [string]$Json ) Process { $match = 0 $matchType = $null $matchInstance = $null # try to match Job defined in the oneOf schemas try { $matchInstance = ConvertFrom-NERMJsonToJob $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "Job" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'Job' defined in oneOf (NERMSubmitRoleProfiles200Response). Proceeding to the next one if any." } # try to match RoleProfiles defined in the oneOf schemas try { $matchInstance = ConvertFrom-NERMJsonToRoleProfiles $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "RoleProfiles" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'RoleProfiles' defined in oneOf (NERMSubmitRoleProfiles200Response). Proceeding to the next one if any." } if ($match -gt 1) { throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Job, RoleProfiles]). JSON Payload: $($Json)" } elseif ($match -eq 1) { return [PSCustomObject]@{ "ActualType" = ${matchType} "ActualInstance" = ${matchInstance} "OneOfSchemas" = @("Job", "RoleProfiles") } } else { throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Job, RoleProfiles]). JSON Payload: $($Json)" } } } |