Model/ServiceProviderConfiguration.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Represents the IdentityNow as Service Provider Configuration allowing customers to log into IDN via an Identity Provider

.PARAMETER Enabled
This determines whether or not the SAML authentication flow is enabled for an org
.PARAMETER BypassIdp
This allows basic login with the parameter prompt=true. This is often toggled on when debugging SAML authentication setup. When false, only org admins with MFA-enabled can bypass the IDP.
.PARAMETER SamlConfigurationValid
This indicates whether or not the SAML configuration is valid.
.PARAMETER FederationProtocolDetails
A list of the abstract implementations of the Federation Protocol details. Typically, this will include on SpDetails object and one IdpDetails object used in tandem to define a SAML integration between a customer's identity provider and a customer's SailPoint instance (i.e., the service provider).
.OUTPUTS

ServiceProviderConfiguration<PSCustomObject>
#>


function Initialize-ServiceProviderConfiguration {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Enabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${BypassIdp} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SamlConfigurationValid} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${FederationProtocolDetails}
    )

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


        $PSO = [PSCustomObject]@{
            "enabled" = ${Enabled}
            "bypassIdp" = ${BypassIdp}
            "samlConfigurationValid" = ${SamlConfigurationValid}
            "federationProtocolDetails" = ${FederationProtocolDetails}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ServiceProviderConfiguration<PSCustomObject>

.DESCRIPTION

Convert from JSON to ServiceProviderConfiguration<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ServiceProviderConfiguration<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ServiceProviderConfiguration
        $AllProperties = ("enabled", "bypassIdp", "samlConfigurationValid", "federationProtocolDetails")
        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 "enabled"))) { #optional property not found
            $Enabled = $null
        } else {
            $Enabled = $JsonParameters.PSobject.Properties["enabled"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "enabled" = ${Enabled}
            "bypassIdp" = ${BypassIdp}
            "samlConfigurationValid" = ${SamlConfigurationValid}
            "federationProtocolDetails" = ${FederationProtocolDetails}
        }

        return $PSO
    }

}