beta/src/PSSailpointBeta/Model/ObjectImportResult.ps1
# # IdentityNow Beta API # Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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: 3.1.0-beta # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION Response model for import of a single object. .PARAMETER Infos Informational messages returned from the target service on import. .PARAMETER Warnings Warning messages returned from the target service on import. .PARAMETER Errors Error messages returned from the target service on import. .PARAMETER ImportedObjects References to objects that were created or updated by the import. .OUTPUTS ObjectImportResult<PSCustomObject> #> function Initialize-BetaObjectImportResult { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Infos}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Warnings}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Errors}, [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${ImportedObjects} ) Process { 'Creating PSCustomObject: PSSailpointBeta => BetaObjectImportResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if ($null -eq $Infos) { throw "invalid value for 'Infos', 'Infos' cannot be null." } if ($null -eq $Warnings) { throw "invalid value for 'Warnings', 'Warnings' cannot be null." } if ($null -eq $Errors) { throw "invalid value for 'Errors', 'Errors' cannot be null." } if ($null -eq $ImportedObjects) { throw "invalid value for 'ImportedObjects', 'ImportedObjects' cannot be null." } $PSO = [PSCustomObject]@{ "infos" = ${Infos} "warnings" = ${Warnings} "errors" = ${Errors} "importedObjects" = ${ImportedObjects} } return $PSO } } <# .SYNOPSIS Convert from JSON to ObjectImportResult<PSCustomObject> .DESCRIPTION Convert from JSON to ObjectImportResult<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ObjectImportResult<PSCustomObject> #> function ConvertFrom-BetaJsonToObjectImportResult { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpointBeta => BetaObjectImportResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in BetaObjectImportResult $AllProperties = ("infos", "warnings", "errors", "importedObjects") 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 'infos' missing." } if (!([bool]($JsonParameters.PSobject.Properties.name -match "infos"))) { throw "Error! JSON cannot be serialized due to the required property 'infos' missing." } else { $Infos = $JsonParameters.PSobject.Properties["infos"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "warnings"))) { throw "Error! JSON cannot be serialized due to the required property 'warnings' missing." } else { $Warnings = $JsonParameters.PSobject.Properties["warnings"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "errors"))) { throw "Error! JSON cannot be serialized due to the required property 'errors' missing." } else { $Errors = $JsonParameters.PSobject.Properties["errors"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "importedObjects"))) { throw "Error! JSON cannot be serialized due to the required property 'importedObjects' missing." } else { $ImportedObjects = $JsonParameters.PSobject.Properties["importedObjects"].value } $PSO = [PSCustomObject]@{ "infos" = ${Infos} "warnings" = ${Warnings} "errors" = ${Errors} "importedObjects" = ${ImportedObjects} } return $PSO } } |