beta/src/PSSailpointBeta/Model/MailFromAttributes.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow 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

MAIL FROM attributes for a domain / identity

.PARAMETER Id
The identity or domain address
.PARAMETER MxRecord
MX record that is required in customer's DNS to allow the domain to receive bounce and complaint notifications that email providers send you
.PARAMETER TxtRecord
TXT record that is required in customer's DNS in order to prove that Amazon SES is authorized to send email from your domain
.PARAMETER MailFromDomainStatus
The current status of the MAIL FROM verification
.OUTPUTS

MailFromAttributes<PSCustomObject>
#>


function Initialize-BetaMailFromAttributes {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${MxRecord},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TxtRecord},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("PENDING", "SUCCESS", "FAILED")]
        [String]
        ${MailFromDomainStatus}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaMailFromAttributes' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "mxRecord" = ${MxRecord}
            "txtRecord" = ${TxtRecord}
            "mailFromDomainStatus" = ${MailFromDomainStatus}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MailFromAttributes<PSCustomObject>

.DESCRIPTION

Convert from JSON to MailFromAttributes<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MailFromAttributes<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaMailFromAttributes' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaMailFromAttributes
        $AllProperties = ("id", "mxRecord", "txtRecord", "mailFromDomainStatus")
        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 "mxRecord"))) { #optional property not found
            $MxRecord = $null
        } else {
            $MxRecord = $JsonParameters.PSobject.Properties["mxRecord"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "mxRecord" = ${MxRecord}
            "txtRecord" = ${TxtRecord}
            "mailFromDomainStatus" = ${MailFromDomainStatus}
        }

        return $PSO
    }

}