beta/src/PSSailpointBeta/Model/CommonAccessResponse.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 Id
Unique ID of the common access item
.PARAMETER Access
No description available.
.PARAMETER Status
CONFIRMED or DENIED
.PARAMETER LastUpdated
No description available.
.PARAMETER ReviewedByUser
true if user has confirmed or denied status
.PARAMETER LastReviewed
No description available.
.PARAMETER CreatedByUser
No description available.
.OUTPUTS

CommonAccessResponse<PSCustomObject>
#>


function Initialize-BetaCommonAccessResponse {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Access},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastUpdated},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ReviewedByUser},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastReviewed},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${CreatedByUser} = $false
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "access" = ${Access}
            "status" = ${Status}
            "lastUpdated" = ${LastUpdated}
            "reviewedByUser" = ${ReviewedByUser}
            "lastReviewed" = ${LastReviewed}
            "createdByUser" = ${CreatedByUser}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to CommonAccessResponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to CommonAccessResponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

CommonAccessResponse<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaCommonAccessResponse
        $AllProperties = ("id", "access", "status", "lastUpdated", "reviewedByUser", "lastReviewed", "createdByUser")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "access" = ${Access}
            "status" = ${Status}
            "lastUpdated" = ${LastUpdated}
            "reviewedByUser" = ${ReviewedByUser}
            "lastReviewed" = ${LastReviewed}
            "createdByUser" = ${CreatedByUser}
        }

        return $PSO
    }

}