beta/src/PSSailpointBeta/Model/ReportConfigDTO.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

No description available.

.PARAMETER ColumnName
Name of column in report
.PARAMETER Required
If true, column is required in all reports, and this entry is immutable. A 400 error will result from any attempt to modify the column's definition.
.PARAMETER Included
If true, column is included in the report. A 400 error will be thrown if an attempt is made to set included=false if required==true.
.PARAMETER Order
Relative sort order for the column. Columns will be displayed left-to-right in nondecreasing order.
.OUTPUTS

ReportConfigDTO<PSCustomObject>
#>


function Initialize-BetaReportConfigDTO {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ColumnName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Required} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Included} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Order}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaReportConfigDTO' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if ($Order -and $Order -gt 2147483647) {
          throw "invalid value for 'Order', must be smaller than or equal to 2147483647."
        }

        if ($Order -and $Order -lt 0) {
          throw "invalid value for 'Order', must be greater than or equal to 0."
        }


        $PSO = [PSCustomObject]@{
            "columnName" = ${ColumnName}
            "required" = ${Required}
            "included" = ${Included}
            "order" = ${Order}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ReportConfigDTO<PSCustomObject>

.DESCRIPTION

Convert from JSON to ReportConfigDTO<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ReportConfigDTO<PSCustomObject>
#>

function ConvertFrom-BetaJsonToReportConfigDTO {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaReportConfigDTO' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaReportConfigDTO
        $AllProperties = ("columnName", "required", "included", "order")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "columnName"))) { #optional property not found
            $ColumnName = $null
        } else {
            $ColumnName = $JsonParameters.PSobject.Properties["columnName"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "required"))) { #optional property not found
            $Required = $null
        } else {
            $Required = $JsonParameters.PSobject.Properties["required"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "included"))) { #optional property not found
            $Included = $null
        } else {
            $Included = $JsonParameters.PSobject.Properties["included"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "order"))) { #optional property not found
            $Order = $null
        } else {
            $Order = $JsonParameters.PSobject.Properties["order"].value
        }

        $PSO = [PSCustomObject]@{
            "columnName" = ${ColumnName}
            "required" = ${Required}
            "included" = ${Included}
            "order" = ${Order}
        }

        return $PSO
    }

}