Model/ApiModelObjectsModernApiImportUserStatusResponse.ps1

#
# Confide 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 TaskId
No description available.
.PARAMETER Status
No description available.
.PARAMETER TotalCount
No description available.
.PARAMETER ProcessedCount
No description available.
.PARAMETER FailedCount
No description available.
.PARAMETER Items
No description available.
.PARAMETER Message
No description available.
.PARAMETER StartTime
No description available.
.PARAMETER FinishTime
No description available.
.OUTPUTS
 
ApiModelObjectsModernApiImportUserStatusResponse<PSCustomObject>
#>


function Initialize-ConfideApiModelObjectsModernApiImportUserStatusResponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TaskId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${TotalCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ProcessedCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${FailedCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Items},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Message},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${StartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${FinishTime}
    )

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


        $PSO = [PSCustomObject]@{
            "taskId" = ${TaskId}
            "status" = ${Status}
            "totalCount" = ${TotalCount}
            "processedCount" = ${ProcessedCount}
            "failedCount" = ${FailedCount}
            "items" = ${Items}
            "message" = ${Message}
            "startTime" = ${StartTime}
            "finishTime" = ${FinishTime}
        }

        return $PSO
    }
}

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

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ConfideApiModelObjectsModernApiImportUserStatusResponse
        $AllProperties = ("taskId", "status", "totalCount", "processedCount", "failedCount", "items", "message", "startTime", "finishTime")
        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 "taskId"))) { #optional property not found
            $TaskId = $null
        } else {
            $TaskId = $JsonParameters.PSobject.Properties["taskId"].value
        }

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "message"))) { #optional property not found
            $Message = $null
        } else {
            $Message = $JsonParameters.PSobject.Properties["message"].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 "finishTime"))) { #optional property not found
            $FinishTime = $null
        } else {
            $FinishTime = $JsonParameters.PSobject.Properties["finishTime"].value
        }

        $PSO = [PSCustomObject]@{
            "taskId" = ${TaskId}
            "status" = ${Status}
            "totalCount" = ${TotalCount}
            "processedCount" = ${ProcessedCount}
            "failedCount" = ${FailedCount}
            "items" = ${Items}
            "message" = ${Message}
            "startTime" = ${StartTime}
            "finishTime" = ${FinishTime}
        }

        return $PSO
    }

}