v2024/src/Tm.V2024/Model/TriggerExampleOutput.ps1
# # Identity Security Cloud V2024 API # Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. # Version: v2024 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION An example of the JSON payload that will be sent by the subscribed service to the trigger in response to an event. .PARAMETER Json JSON object .OUTPUTS TriggerExampleOutput<PSCustomObject> #> function ConvertFrom-V2024JsonToTriggerExampleOutput { [CmdletBinding()] Param ( [AllowEmptyString()] [string]$Json ) Process { $match = 0 $matchType = $null $matchInstance = $null # nullable check if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { return [PSCustomObject]@{ "ActualType" = $null "ActualInstance" = $null "OneOfSchemas" = @("AccessRequestDynamicApprover1", "AccessRequestPreApproval1") } } # try to match AccessRequestDynamicApprover1 defined in the oneOf schemas try { $matchInstance = ConvertFrom-V2024JsonToAccessRequestDynamicApprover1 $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "AccessRequestDynamicApprover1" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'AccessRequestDynamicApprover1' defined in oneOf (V2024TriggerExampleOutput). Proceeding to the next one if any." } # try to match AccessRequestPreApproval1 defined in the oneOf schemas try { $matchInstance = ConvertFrom-V2024JsonToAccessRequestPreApproval1 $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "AccessRequestPreApproval1" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'AccessRequestPreApproval1' defined in oneOf (V2024TriggerExampleOutput). 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 ([AccessRequestDynamicApprover1, AccessRequestPreApproval1]). JSON Payload: $($Json)" } elseif ($match -eq 1) { return [PSCustomObject]@{ "ActualType" = ${matchType} "ActualInstance" = ${matchInstance} "OneOfSchemas" = @("AccessRequestDynamicApprover1", "AccessRequestPreApproval1") } } else { throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([AccessRequestDynamicApprover1, AccessRequestPreApproval1]). JSON Payload: $($Json)" } } } |