Model/NotificationModel.ps1

#
# Fly SDK API
# No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
# Version: 1.0
# Contact: support@avepoint.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS
 
No summary available.
 
.DESCRIPTION
 
No description available.
 
.PARAMETER SendProjectMigration
No description available.
.PARAMETER Frequency
No description available.
.PARAMETER StartTime
No description available.
.PARAMETER IsEnableEndTime
No description available.
.PARAMETER EndTime
No description available.
.PARAMETER MigrationEmailRecipients
No description available.
.PARAMETER ProjectMigrationEmailTemplateId
No description available.
.PARAMETER SendIndividualMapping
No description available.
.PARAMETER MappingCondition
* `AllMappings` = 0 * `OnlyFailedMappings` = 1
.PARAMETER SendToSourceEmail
No description available.
.PARAMETER SendToDestinationEmail
No description available.
.PARAMETER SendToMe
No description available.
.PARAMETER SendToAdditionalRecipients
No description available.
.PARAMETER AdditionalRecipients
No description available.
.PARAMETER EmailTemplateId
No description available.
.OUTPUTS
 
NotificationModel<PSCustomObject>
#>


function Initialize-FlyNotificationModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendProjectMigration},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Frequency},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${StartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsEnableEndTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${EndTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${MigrationEmailRecipients},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProjectMigrationEmailTemplateId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendIndividualMapping},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MappingCondition},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendToSourceEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendToDestinationEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendToMe},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SendToAdditionalRecipients},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${AdditionalRecipients},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${EmailTemplateId}
    )

    Process {
        'Creating PSCustomObject: Fly.Client => FlyNotificationModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "sendProjectMigration" = ${SendProjectMigration}
            "frequency" = ${Frequency}
            "startTime" = ${StartTime}
            "isEnableEndTime" = ${IsEnableEndTime}
            "endTime" = ${EndTime}
            "migrationEmailRecipients" = ${MigrationEmailRecipients}
            "projectMigrationEmailTemplateId" = ${ProjectMigrationEmailTemplateId}
            "sendIndividualMapping" = ${SendIndividualMapping}
            "mappingCondition" = ${MappingCondition}
            "sendToSourceEmail" = ${SendToSourceEmail}
            "sendToDestinationEmail" = ${SendToDestinationEmail}
            "sendToMe" = ${SendToMe}
            "sendToAdditionalRecipients" = ${SendToAdditionalRecipients}
            "additionalRecipients" = ${AdditionalRecipients}
            "emailTemplateId" = ${EmailTemplateId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS
 
Convert from JSON to NotificationModel<PSCustomObject>
 
.DESCRIPTION
 
Convert from JSON to NotificationModel<PSCustomObject>
 
.PARAMETER Json
 
Json object
 
.OUTPUTS
 
NotificationModel<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Fly.Client => FlyNotificationModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in FlyNotificationModel
        $AllProperties = ("sendProjectMigration", "frequency", "startTime", "isEnableEndTime", "endTime", "migrationEmailRecipients", "projectMigrationEmailTemplateId", "sendIndividualMapping", "mappingCondition", "sendToSourceEmail", "sendToDestinationEmail", "sendToMe", "sendToAdditionalRecipients", "additionalRecipients", "emailTemplateId")
        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 "sendProjectMigration"))) { #optional property not found
            $SendProjectMigration = $null
        } else {
            $SendProjectMigration = $JsonParameters.PSobject.Properties["sendProjectMigration"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "sendProjectMigration" = ${SendProjectMigration}
            "frequency" = ${Frequency}
            "startTime" = ${StartTime}
            "isEnableEndTime" = ${IsEnableEndTime}
            "endTime" = ${EndTime}
            "migrationEmailRecipients" = ${MigrationEmailRecipients}
            "projectMigrationEmailTemplateId" = ${ProjectMigrationEmailTemplateId}
            "sendIndividualMapping" = ${SendIndividualMapping}
            "mappingCondition" = ${MappingCondition}
            "sendToSourceEmail" = ${SendToSourceEmail}
            "sendToDestinationEmail" = ${SendToDestinationEmail}
            "sendToMe" = ${SendToMe}
            "sendToAdditionalRecipients" = ${SendToAdditionalRecipients}
            "additionalRecipients" = ${AdditionalRecipients}
            "emailTemplateId" = ${EmailTemplateId}
        }

        return $PSO
    }

}