Model/ProjectMappingSummaryModel.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 ProjectId
The GUID of the project against the project mapping
.PARAMETER SourceType
The data type of source identity, refer to [**PlatformDataTypes**](PlatformDataTypes.md) for more details
.PARAMETER SourcePlatform
The platform type of source identity, refer to PlatformType for more details
.PARAMETER SourceName
The display name of source identity
.PARAMETER SourceIdentity
The source identity of migration
.PARAMETER DestinationType
The data type of destination identity, refer to [**PlatformDataTypes**](PlatformDataTypes.md) for more details
.PARAMETER DestinationPlatform
The platform type of source identity, refer to PlatformType for more details
.PARAMETER DestinationName
The display name of destination identity
.PARAMETER DestinationIdentity
The destination identity of migration
.PARAMETER SourceCredentialSaved
Deprecated
.PARAMETER DestinationCredentialSaved
Deprecated
.PARAMETER Identity
The identity of the mapping calculated based on the information of this mapping
.PARAMETER IsScheduleExpired
A boolean value indicates whether schedule time of migration job has expired against the mapping
.PARAMETER ScheduleTime
The schedule time of migration job
.PARAMETER CreateTime
The create time of the project mapping in .NET ticks
.PARAMETER LastUpdateTime
The last updated time of the project mapping in .NET ticks
.PARAMETER Stage
Current or previous migration stage of the project mapping
.PARAMETER StageStatus
The status of current migration stage against the project mapping
.PARAMETER JobProgress
The migration job progress of the project mapping, only available for the project mapping which is executing migration job
.PARAMETER JobProgressDetail
No description available.
.PARAMETER MigratedSize
The data size already migrated against the project mapping
.PARAMETER ErrorItemCount
The error account during migration job against the project mapping
.PARAMETER Id
The GUID of the object
.OUTPUTS
 
ProjectMappingSummaryModel<PSCustomObject>
#>


function Initialize-FlyProjectMappingSummaryModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ProjectId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${SourceType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SourcePlatform},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${DestinationType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DestinationPlatform},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DestinationName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DestinationIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${SourceCredentialSaved},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DestinationCredentialSaved},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Identity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsScheduleExpired},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ScheduleTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${CreateTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${LastUpdateTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Stage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${StageStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${JobProgress},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${JobProgressDetail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${MigratedSize},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ErrorItemCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id}
    )

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


        $PSO = [PSCustomObject]@{
            "projectId" = ${ProjectId}
            "sourceType" = ${SourceType}
            "sourcePlatform" = ${SourcePlatform}
            "sourceName" = ${SourceName}
            "sourceIdentity" = ${SourceIdentity}
            "destinationType" = ${DestinationType}
            "destinationPlatform" = ${DestinationPlatform}
            "destinationName" = ${DestinationName}
            "destinationIdentity" = ${DestinationIdentity}
            "sourceCredentialSaved" = ${SourceCredentialSaved}
            "destinationCredentialSaved" = ${DestinationCredentialSaved}
            "identity" = ${Identity}
            "isScheduleExpired" = ${IsScheduleExpired}
            "scheduleTime" = ${ScheduleTime}
            "createTime" = ${CreateTime}
            "lastUpdateTime" = ${LastUpdateTime}
            "stage" = ${Stage}
            "stageStatus" = ${StageStatus}
            "jobProgress" = ${JobProgress}
            "jobProgressDetail" = ${JobProgressDetail}
            "migratedSize" = ${MigratedSize}
            "errorItemCount" = ${ErrorItemCount}
            "id" = ${Id}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in FlyProjectMappingSummaryModel
        $AllProperties = ("projectId", "sourceType", "sourcePlatform", "sourceName", "sourceIdentity", "destinationType", "destinationPlatform", "destinationName", "destinationIdentity", "sourceCredentialSaved", "destinationCredentialSaved", "identity", "hasRunningJob", "hasRunMigration", "isScheduleExpired", "scheduleTime", "createTime", "lastUpdateTime", "stage", "stageStatus", "jobProgress", "jobProgressDetail", "migratedSize", "errorItemCount", "id")
        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 "projectId"))) { #optional property not found
            $ProjectId = $null
        } else {
            $ProjectId = $JsonParameters.PSobject.Properties["projectId"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "projectId" = ${ProjectId}
            "sourceType" = ${SourceType}
            "sourcePlatform" = ${SourcePlatform}
            "sourceName" = ${SourceName}
            "sourceIdentity" = ${SourceIdentity}
            "destinationType" = ${DestinationType}
            "destinationPlatform" = ${DestinationPlatform}
            "destinationName" = ${DestinationName}
            "destinationIdentity" = ${DestinationIdentity}
            "sourceCredentialSaved" = ${SourceCredentialSaved}
            "destinationCredentialSaved" = ${DestinationCredentialSaved}
            "identity" = ${Identity}
            "hasRunningJob" = ${HasRunningJob}
            "hasRunMigration" = ${HasRunMigration}
            "isScheduleExpired" = ${IsScheduleExpired}
            "scheduleTime" = ${ScheduleTime}
            "createTime" = ${CreateTime}
            "lastUpdateTime" = ${LastUpdateTime}
            "stage" = ${Stage}
            "stageStatus" = ${StageStatus}
            "jobProgress" = ${JobProgress}
            "jobProgressDetail" = ${JobProgressDetail}
            "migratedSize" = ${MigratedSize}
            "errorItemCount" = ${ErrorItemCount}
            "id" = ${Id}
        }

        return $PSO
    }

}