v2024/src/PSSailpoint.V2024/Model/RoleMetadataBulkUpdateByFilterRequest.ps1

#
# Identity Security Cloud V2024 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: v2024
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

This API initialize a a Bulk update by filter request of Role metadata. The maximum meta data values that one single role assigned can not exceed 25. Custom metadata need suit licensed.

.PARAMETER Filters
Filtering is supported for the following fields and operators: **id** : *eq, in* **name** : *eq, sw* **created** : *gt, lt, ge, le* **modified** : *gt, lt, ge, le* **owner.id** : *eq, in* **requestable** : *eq*
.PARAMETER Operation
The operation to be performed
.PARAMETER ReplaceScope
The choice of update scope.
.PARAMETER Values
The metadata to be updated, including attribute key and value.
.OUTPUTS

RoleMetadataBulkUpdateByFilterRequest<PSCustomObject>
#>


function Initialize-V2024RoleMetadataBulkUpdateByFilterRequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Filters},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ADD", "REMOVE", "REPLACE")]
        [String]
        ${Operation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ALL", "ATTRIBUTE")]
        [String]
        ${ReplaceScope},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Values}
    )

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

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

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

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


        $PSO = [PSCustomObject]@{
            "filters" = ${Filters}
            "operation" = ${Operation}
            "replaceScope" = ${ReplaceScope}
            "values" = ${Values}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to RoleMetadataBulkUpdateByFilterRequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to RoleMetadataBulkUpdateByFilterRequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

RoleMetadataBulkUpdateByFilterRequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024RoleMetadataBulkUpdateByFilterRequest
        $AllProperties = ("filters", "operation", "replaceScope", "values")
        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 'filters' missing."
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "filters" = ${Filters}
            "operation" = ${Operation}
            "replaceScope" = ${ReplaceScope}
            "values" = ${Values}
        }

        return $PSO
    }

}