branding/src/PSSailpoint.Branding/Model/BrandingItemCreate.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Name
name of branding item
.PARAMETER ProductName
product name
.PARAMETER ActionButtonColor
hex value of color for action button
.PARAMETER DarkActionButtonColor
hex value of color for action button in dark mode
.PARAMETER ActiveLinkColor
hex value of color for link
.PARAMETER DarkActiveLinkColor
hex value of color for link in dark mode
.PARAMETER NavigationColor
hex value of color for navigation bar
.PARAMETER DarkNavigationColor
hex value of color for navigation bar in dark mode
.PARAMETER EmailFromAddress
email from address
.PARAMETER LoginInformationalMessage
login information message
.PARAMETER FileStandard
png file with logo. To remove an existing logo, delete the branding item and create it again. Omitting this field on update keeps the current logo.
.PARAMETER DarkFileStandard
png file with dark-mode logo. To remove an existing dark-mode logo, delete the branding item and create it again. Omitting this field on update keeps the current dark-mode logo.
.OUTPUTS

BrandingItemCreate<PSCustomObject>
#>


function Initialize-BrandingItemCreate {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProductName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActionButtonColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DarkActionButtonColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActiveLinkColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DarkActiveLinkColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NavigationColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DarkNavigationColor},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${EmailFromAddress},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LoginInformationalMessage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.IO.FileInfo]
        ${FileStandard},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.IO.FileInfo]
        ${DarkFileStandard}
    )

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

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


        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "productName" = ${ProductName}
            "actionButtonColor" = ${ActionButtonColor}
            "darkActionButtonColor" = ${DarkActionButtonColor}
            "activeLinkColor" = ${ActiveLinkColor}
            "darkActiveLinkColor" = ${DarkActiveLinkColor}
            "navigationColor" = ${NavigationColor}
            "darkNavigationColor" = ${DarkNavigationColor}
            "emailFromAddress" = ${EmailFromAddress}
            "loginInformationalMessage" = ${LoginInformationalMessage}
            "fileStandard" = ${FileStandard}
            "darkFileStandard" = ${DarkFileStandard}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to BrandingItemCreate<PSCustomObject>

.DESCRIPTION

Convert from JSON to BrandingItemCreate<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

BrandingItemCreate<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BrandingItemCreate
        $AllProperties = ("name", "productName", "actionButtonColor", "darkActionButtonColor", "activeLinkColor", "darkActiveLinkColor", "navigationColor", "darkNavigationColor", "emailFromAddress", "loginInformationalMessage", "fileStandard", "darkFileStandard")
        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 'name' missing."
        }

        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 "productName"))) {
            throw "Error! JSON cannot be serialized due to the required property 'productName' missing."
        } else {
            $ProductName = $JsonParameters.PSobject.Properties["productName"].value
        }

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "name" = ${Name}
            "productName" = ${ProductName}
            "actionButtonColor" = ${ActionButtonColor}
            "darkActionButtonColor" = ${DarkActionButtonColor}
            "activeLinkColor" = ${ActiveLinkColor}
            "darkActiveLinkColor" = ${DarkActiveLinkColor}
            "navigationColor" = ${NavigationColor}
            "darkNavigationColor" = ${DarkNavigationColor}
            "emailFromAddress" = ${EmailFromAddress}
            "loginInformationalMessage" = ${LoginInformationalMessage}
            "fileStandard" = ${FileStandard}
            "darkFileStandard" = ${DarkFileStandard}
        }

        return $PSO
    }

}