Public/Get-DattoSaasBackup.ps1

function Get-DattoSaasBackup {
<#
.SYNOPSIS
Returns SaaS Protection backup application data for a customer.
.DESCRIPTION
Implements GET /v1/saas/{saasCustomerId}/applications.
.PARAMETER SaasCustomerId
The SaaS Protection customer ID.
.PARAMETER DaysUntil
Days until the report should be generated, as defined by the Datto API.
.PARAMETER RawResponse
Returns the direct API response body.
.PARAMETER Connection
A connection object, name, or ID.
.EXAMPLE
Get-DattoSaasBackup -SaasCustomerId 53124 -DaysUntil 30
#>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory, ValueFromPipelineByPropertyName)][ValidateRange(1, [int]::MaxValue)][int]$SaasCustomerId,
        [Parameter()][ValidateRange(0, [int]::MaxValue)][Nullable[int]]$DaysUntil,
        [Parameter()][switch]$RawResponse,
        [Parameter()][AllowNull()][object]$Connection
    )
    process {
        $query = @{}
        if ($PSBoundParameters.ContainsKey('DaysUntil')) { $query['daysUntil'] = $DaysUntil }
        Invoke-DattoApiRequest -Path "/v1/saas/$SaasCustomerId/applications" -Query $query -RawResponse:$RawResponse -Connection $Connection
    }
}