Model/EventAttributesFilterDefinitionConditionsInnerValue.ps1
|
# # SailPoint Identity Security API - Workflows # Use these APIs to interact with the SailPoint Identity Security 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: v1 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION Value to compare the field against. Omit for `is empty`, `is not empty`, `is null` and `is not null`. Use a 64-bit integer for `number` fields and for `size`. Use `true` or `false` for `boolean` fields, and a regular expression literal such as `/^john/i` for `=~`. JSONPath and inline expressions are not allowed. .PARAMETER Json JSON object .OUTPUTS EventAttributesFilterDefinitionConditionsInnerValue<PSCustomObject> #> function ConvertFrom-JsonToEventAttributesFilterDefinitionConditionsInnerValue { [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" = @("Boolean", "Int64", "String") } } # try to match Boolean defined in the oneOf schemas try { $matchInstance = ConvertFrom-JsonToBoolean $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "Boolean" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'Boolean' defined in oneOf (EventAttributesFilterDefinitionConditionsInnerValue). Proceeding to the next one if any." } # try to match Int64 defined in the oneOf schemas try { $matchInstance = ConvertFrom-JsonToInt64 $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "Int64" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'Int64' defined in oneOf (EventAttributesFilterDefinitionConditionsInnerValue). Proceeding to the next one if any." } # try to match String defined in the oneOf schemas try { $matchInstance = ConvertFrom-JsonToString $Json foreach($property in $matchInstance.PsObject.Properties) { if ($null -ne $property.Value) { $matchType = "String" $match++ break } } } catch { # fail to match the schema defined in oneOf, proceed to the next one Write-Debug "Failed to match 'String' defined in oneOf (EventAttributesFilterDefinitionConditionsInnerValue). 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 ([Boolean, Int64, String]). JSON Payload: $($Json)" } elseif ($match -eq 1) { return [PSCustomObject]@{ "ActualType" = ${matchType} "ActualInstance" = ${matchInstance} "OneOfSchemas" = @("Boolean", "Int64", "String") } } else { throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Boolean, Int64, String]). JSON Payload: $($Json)" } } } |