beta/src/Tm.Beta/Model/AccessProfileDetails.ps1

#
# Identity Security Cloud Beta API
# Use these APIs to interact with the Identity Security Cloud 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
The ID of the Access Profile
.PARAMETER Name
Name of the Access Profile
.PARAMETER Description
Information about the Access Profile
.PARAMETER Created
Date the Access Profile was created
.PARAMETER Modified
Date the Access Profile was last modified.
.PARAMETER Disabled
Whether the Access Profile is enabled.
.PARAMETER Requestable
Whether the Access Profile is requestable via access request.
.PARAMETER Protected
Whether the Access Profile is protected.
.PARAMETER OwnerId
The owner ID of the Access Profile
.PARAMETER SourceId
The source ID of the Access Profile
.PARAMETER SourceName
The source name of the Access Profile
.PARAMETER AppId
The source app ID of the Access Profile
.PARAMETER AppName
The source app name of the Access Profile
.PARAMETER ApplicationId
The id of the application
.PARAMETER Type
The type of the access profile
.PARAMETER Entitlements
List of IDs of entitlements
.PARAMETER EntitlementCount
The number of entitlements in the access profile
.PARAMETER Segments
List of IDs of segments, if any, to which this Access Profile is assigned.
.PARAMETER ApprovalSchemes
Comma-separated list of approval schemes. Each approval scheme is one of - manager - appOwner - sourceOwner - accessProfileOwner - workgroup:<workgroupId>
.PARAMETER RevokeRequestApprovalSchemes
Comma-separated list of revoke request approval schemes. Each approval scheme is one of - manager - sourceOwner - accessProfileOwner - workgroup:<workgroupId>
.PARAMETER RequestCommentsRequired
Whether the access profile require request comment for access request.
.PARAMETER DeniedCommentsRequired
Whether denied comment is required when access request is denied.
.PARAMETER AccountSelector
No description available.
.OUTPUTS

AccessProfileDetails<PSCustomObject>
#>


function Initialize-BetaAccessProfileDetails {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Disabled} = $true,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Requestable} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Protected} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${AppId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AppName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ApplicationId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Entitlements},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${EntitlementCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Segments},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ApprovalSchemes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RevokeRequestApprovalSchemes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${RequestCommentsRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DeniedCommentsRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AccountSelector}
    )

    Process {
        'Creating PSCustomObject: Tm.Beta => BetaAccessProfileDetails' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "description" = ${Description}
            "created" = ${Created}
            "modified" = ${Modified}
            "disabled" = ${Disabled}
            "requestable" = ${Requestable}
            "protected" = ${Protected}
            "ownerId" = ${OwnerId}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "appId" = ${AppId}
            "appName" = ${AppName}
            "applicationId" = ${ApplicationId}
            "type" = ${Type}
            "entitlements" = ${Entitlements}
            "entitlementCount" = ${EntitlementCount}
            "segments" = ${Segments}
            "approvalSchemes" = ${ApprovalSchemes}
            "revokeRequestApprovalSchemes" = ${RevokeRequestApprovalSchemes}
            "requestCommentsRequired" = ${RequestCommentsRequired}
            "deniedCommentsRequired" = ${DeniedCommentsRequired}
            "accountSelector" = ${AccountSelector}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccessProfileDetails<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccessProfileDetails<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccessProfileDetails<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Tm.Beta => BetaAccessProfileDetails' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaAccessProfileDetails
        $AllProperties = ("id", "name", "description", "created", "modified", "disabled", "requestable", "protected", "ownerId", "sourceId", "sourceName", "appId", "appName", "applicationId", "type", "entitlements", "entitlementCount", "segments", "approvalSchemes", "revokeRequestApprovalSchemes", "requestCommentsRequired", "deniedCommentsRequired", "accountSelector")
        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 "name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "description" = ${Description}
            "created" = ${Created}
            "modified" = ${Modified}
            "disabled" = ${Disabled}
            "requestable" = ${Requestable}
            "protected" = ${Protected}
            "ownerId" = ${OwnerId}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "appId" = ${AppId}
            "appName" = ${AppName}
            "applicationId" = ${ApplicationId}
            "type" = ${Type}
            "entitlements" = ${Entitlements}
            "entitlementCount" = ${EntitlementCount}
            "segments" = ${Segments}
            "approvalSchemes" = ${ApprovalSchemes}
            "revokeRequestApprovalSchemes" = ${RevokeRequestApprovalSchemes}
            "requestCommentsRequired" = ${RequestCommentsRequired}
            "deniedCommentsRequired" = ${DeniedCommentsRequired}
            "accountSelector" = ${AccountSelector}
        }

        return $PSO
    }

}