Model/BackupResponse.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER JobId
Unique id assigned to this backup.
.PARAMETER Status
Status of the backup.
.PARAMETER Type
Type of the job, will always be BACKUP for this type of job.
.PARAMETER Tenant
The name of the tenant performing the upload
.PARAMETER RequesterName
The name of the requester.
.PARAMETER FileExists
Whether or not a file was created and stored for this backup.
.PARAMETER Created
The time the job was started.
.PARAMETER Modified
The time of the last update to the job.
.PARAMETER Completed
The time the job was completed.
.PARAMETER Name
The name assigned to the upload file in the request body.
.PARAMETER UserCanDelete
Whether this backup can be deleted by a regular user.
.PARAMETER IsPartial
Whether this backup contains all supported object types or only some of them.
.PARAMETER BackupType
Denotes how this backup was created. - MANUAL - The backup was created by a user. - AUTOMATED - The backup was created by devops. - AUTOMATED_DRAFT - The backup was created during a draft process. - UPLOADED - The backup was created by uploading an existing configuration file.
.PARAMETER Options
No description available.
.PARAMETER HydrationStatus
Whether the object details of this backup are ready.
.PARAMETER TotalObjectCount
Number of objects contained in this backup.
.PARAMETER CloudStorageStatus
Whether this backup has been transferred to a customer storage location.
.OUTPUTS

BackupResponse<PSCustomObject>
#>


function Initialize-BackupResponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${JobId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("NOT_STARTED", "IN_PROGRESS", "COMPLETE", "CANCELLED", "FAILED")]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("BACKUP")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Tenant},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RequesterName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${FileExists} = $true,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${Completed},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${UserCanDelete} = $true,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsPartial} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("UPLOADED", "AUTOMATED", "MANUAL")]
        [String]
        ${BackupType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Options},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("HYDRATED", "NOT_HYDRATED")]
        [String]
        ${HydrationStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${TotalObjectCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("SYNCED", "NOT_SYNCED", "SYNC_FAILED")]
        [String]
        ${CloudStorageStatus}
    )

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


        $PSO = [PSCustomObject]@{
            "jobId" = ${JobId}
            "status" = ${Status}
            "type" = ${Type}
            "tenant" = ${Tenant}
            "requesterName" = ${RequesterName}
            "fileExists" = ${FileExists}
            "created" = ${Created}
            "modified" = ${Modified}
            "completed" = ${Completed}
            "name" = ${Name}
            "userCanDelete" = ${UserCanDelete}
            "isPartial" = ${IsPartial}
            "backupType" = ${BackupType}
            "options" = ${Options}
            "hydrationStatus" = ${HydrationStatus}
            "totalObjectCount" = ${TotalObjectCount}
            "cloudStorageStatus" = ${CloudStorageStatus}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to BackupResponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to BackupResponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

BackupResponse<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BackupResponse
        $AllProperties = ("jobId", "status", "type", "tenant", "requesterName", "fileExists", "created", "modified", "completed", "name", "userCanDelete", "isPartial", "backupType", "options", "hydrationStatus", "totalObjectCount", "cloudStorageStatus")
        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 "jobId"))) { #optional property not found
            $JobId = $null
        } else {
            $JobId = $JsonParameters.PSobject.Properties["jobId"].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 "type"))) { #optional property not found
            $Type = $null
        } else {
            $Type = $JsonParameters.PSobject.Properties["type"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "jobId" = ${JobId}
            "status" = ${Status}
            "type" = ${Type}
            "tenant" = ${Tenant}
            "requesterName" = ${RequesterName}
            "fileExists" = ${FileExists}
            "created" = ${Created}
            "modified" = ${Modified}
            "completed" = ${Completed}
            "name" = ${Name}
            "userCanDelete" = ${UserCanDelete}
            "isPartial" = ${IsPartial}
            "backupType" = ${BackupType}
            "options" = ${Options}
            "hydrationStatus" = ${HydrationStatus}
            "totalObjectCount" = ${TotalObjectCount}
            "cloudStorageStatus" = ${CloudStorageStatus}
        }

        return $PSO
    }

}