v2025/src/PSSailpoint.V2025/Model/ParameterStorageParameter.ps1

#
# Identity Security Cloud V2025 API
# Use these APIs to interact with the Identity Security Cloud 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

A parameter that has been retrieved from the store.

.PARAMETER Id
The ID of the reference
.PARAMETER OwnerId
The ID of the user who owns the parameter.
.PARAMETER Type
The type of the parameter. This cannot be changed after being set. Please see the types document for more information.
.PARAMETER Name
The human-readable name of the parameter.
.PARAMETER PrimaryField
The name of the primary field in the public fields.
.PARAMETER PublicFields
The public fields stored for this parameter. See the types document for information about what can be stored.
.PARAMETER Description
Describe the parameter
.PARAMETER LastModifiedAt
ISO8606 format datetime of the last time any field of the parameter was changed.
.PARAMETER LastModifiedBy
The ID of the user who last modified the parameter. Empty when identity is not known.
.PARAMETER PrivateFieldsLastModifiedAt
ISO8606 format datetime of the time the secret fields were changed on the parameter.
.PARAMETER PrivateFieldsLastModifiedBy
The ID of the user who last modified the private fields. Empty when identity is not known.
.OUTPUTS

ParameterStorageParameter<PSCustomObject>
#>


function Initialize-V2025ParameterStorageParameter {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OwnerId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryField},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PublicFields},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastModifiedAt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastModifiedBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrivateFieldsLastModifiedAt},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrivateFieldsLastModifiedBy}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.V2025 => V2025ParameterStorageParameter' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if (!$Id) {
            throw "invalid value for 'Id', 'Id' cannot be null."
        }

        if (!$OwnerId) {
            throw "invalid value for 'OwnerId', 'OwnerId' cannot be null."
        }

        if (!$Name) {
            throw "invalid value for 'Name', 'Name' cannot be null."
        }

        if (!$PublicFields) {
            throw "invalid value for 'PublicFields', 'PublicFields' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "ownerId" = ${OwnerId}
            "type" = ${Type}
            "name" = ${Name}
            "primaryField" = ${PrimaryField}
            "publicFields" = ${PublicFields}
            "description" = ${Description}
            "lastModifiedAt" = ${LastModifiedAt}
            "lastModifiedBy" = ${LastModifiedBy}
            "privateFieldsLastModifiedAt" = ${PrivateFieldsLastModifiedAt}
            "privateFieldsLastModifiedBy" = ${PrivateFieldsLastModifiedBy}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ParameterStorageParameter<PSCustomObject>

.DESCRIPTION

Convert from JSON to ParameterStorageParameter<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ParameterStorageParameter<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.V2025 => V2025ParameterStorageParameter' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025ParameterStorageParameter
        $AllProperties = ("id", "ownerId", "type", "name", "primaryField", "publicFields", "description", "lastModifiedAt", "lastModifiedBy", "privateFieldsLastModifiedAt", "privateFieldsLastModifiedBy")
        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 'id' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) {
            throw "Error! JSON cannot be serialized due to the required property 'id' missing."
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ownerId"))) {
            throw "Error! JSON cannot be serialized due to the required property 'ownerId' missing."
        } else {
            $OwnerId = $JsonParameters.PSobject.Properties["ownerId"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) {
            throw "Error! JSON cannot be serialized due to the required property 'name' missing."
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "publicFields"))) {
            throw "Error! JSON cannot be serialized due to the required property 'publicFields' missing."
        } else {
            $PublicFields = $JsonParameters.PSobject.Properties["publicFields"].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 "primaryField"))) { #optional property not found
            $PrimaryField = $null
        } else {
            $PrimaryField = $JsonParameters.PSobject.Properties["primaryField"].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 "lastModifiedAt"))) { #optional property not found
            $LastModifiedAt = $null
        } else {
            $LastModifiedAt = $JsonParameters.PSobject.Properties["lastModifiedAt"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "ownerId" = ${OwnerId}
            "type" = ${Type}
            "name" = ${Name}
            "primaryField" = ${PrimaryField}
            "publicFields" = ${PublicFields}
            "description" = ${Description}
            "lastModifiedAt" = ${LastModifiedAt}
            "lastModifiedBy" = ${LastModifiedBy}
            "privateFieldsLastModifiedAt" = ${PrivateFieldsLastModifiedAt}
            "privateFieldsLastModifiedBy" = ${PrivateFieldsLastModifiedBy}
        }

        return $PSO
    }

}