Model/PublicIdentitiesTextEntry.ps1
|
# # SailPoint Identity Security API - Public Identities # 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 A COMPOSITE query entry that contains a TEXT query. .PARAMETER QueryType Entry type discriminator. Must be TEXT for text query entries. .PARAMETER TextQuery Text query clause for this TEXT entry. .OUTPUTS PublicIdentitiesTextEntry<PSCustomObject> #> function Initialize-PublicIdentitiesTextEntry { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("TEXT")] [String] ${QueryType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${TextQuery} ) Process { 'Creating PSCustomObject: PSSailpoint.PublicIdentities => PublicIdentitiesTextEntry' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$QueryType) { throw "invalid value for 'QueryType', 'QueryType' cannot be null." } if (!$TextQuery) { throw "invalid value for 'TextQuery', 'TextQuery' cannot be null." } $PSO = [PSCustomObject]@{ "queryType" = ${QueryType} "textQuery" = ${TextQuery} } return $PSO } } <# .SYNOPSIS Convert from JSON to PublicIdentitiesTextEntry<PSCustomObject> .DESCRIPTION Convert from JSON to PublicIdentitiesTextEntry<PSCustomObject> .PARAMETER Json Json object .OUTPUTS PublicIdentitiesTextEntry<PSCustomObject> #> function ConvertFrom-JsonToPublicIdentitiesTextEntry { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.PublicIdentities => PublicIdentitiesTextEntry' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PublicIdentitiesTextEntry $AllProperties = ("queryType", "textQuery") 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 'queryType' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "queryType"))) { throw "Error! JSON cannot be serialized due to the required property 'queryType' missing." } else { $QueryType = $JsonParameters.PSobject.Properties["queryType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "textQuery"))) { throw "Error! JSON cannot be serialized due to the required property 'textQuery' missing." } else { $TextQuery = $JsonParameters.PSobject.Properties["textQuery"].value } $PSO = [PSCustomObject]@{ "queryType" = ${QueryType} "textQuery" = ${TextQuery} } return $PSO } } |