Api/FlyDownloadCenterApi.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
 
Get information of report jobs
 
.DESCRIPTION
 
No description available.
 
.PARAMETER RequestBody
A collection of GUID for the report jobs
 
.PARAMETER ReturnType
 
Select the return type (optional): text/plain, application/json, text/json, application/*+json
 
.PARAMETER WithHttpInfo
 
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
 
.OUTPUTS
 
GenerateReportJobModelApiQueryResult
#>

function Get-FlyReportJobs {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String[]]
        ${RequestBody},
        [String]
        [ValidateSet("text/plain", "application/json", "text/json", "application/*+json")]
        $ReturnType,
        [Switch]
        $WithHttpInfo
    )

    Process {
        'Calling method: Get-FlyReportJobs' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $LocalVarAccepts = @()
        $LocalVarContentTypes = @()
        $LocalVarQueryParameters = @{}
        $LocalVarHeaderParameters = @{}
        $LocalVarFormParameters = @{}
        $LocalVarPathParameters = @{}
        $LocalVarCookieParameters = @{}
        $LocalVarBodyParameter = $null

        $Configuration = Get-FlyConfiguration
        # HTTP header 'Accept' (if needed)
        $LocalVarAccepts = @('text/plain', 'application/json', 'text/json', 'application/*+json')

        if ($ReturnType) {
            # use the return type (MIME) provided by the user
            $LocalVarAccepts = @($ReturnType)
        }

        # HTTP header 'Content-Type'
        $LocalVarContentTypes = @('application/json')

        $LocalVarUri = '/downloadcenter/refresh'

        if (!$RequestBody) {
            throw "Error! The required parameter `RequestBody` missing when calling getReportJobs."
        }

        $LocalVarBodyParameter = ConvertTo-Json $RequestBody -Depth 100

        if ($Configuration["AccessToken"]) {
            $LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"]
            Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand)
        }

        $LocalVarResult = Invoke-FlyApiClient -Method 'POST' `
                                -Uri $LocalVarUri `
                                -Accepts $LocalVarAccepts `
                                -ContentTypes $LocalVarContentTypes `
                                -Body $LocalVarBodyParameter `
                                -HeaderParameters $LocalVarHeaderParameters `
                                -QueryParameters $LocalVarQueryParameters `
                                -FormParameters $LocalVarFormParameters `
                                -CookieParameters $LocalVarCookieParameters `
                                -ReturnType "GenerateReportJobModelApiQueryResult" `
                                -IsBodyNullable $false

        if ($WithHttpInfo.IsPresent) {
            return $LocalVarResult
        } else {
            return $LocalVarResult["Response"]
        }
    }
}

<#
.SYNOPSIS
 
Get report url by job id
 
.DESCRIPTION
 
No description available.
 
.PARAMETER JobId
The GUID of the report job
 
.PARAMETER ReturnType
 
Select the return type (optional): text/plain, application/json, text/json, application/*+json
 
.PARAMETER WithHttpInfo
 
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
 
.OUTPUTS
 
UrlResultModel
#>

function Get-FlyReportUrl {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${JobId},
        [String]
        [ValidateSet("text/plain", "application/json", "text/json", "application/*+json")]
        $ReturnType,
        [Switch]
        $WithHttpInfo
    )

    Process {
        'Calling method: Get-FlyReportUrl' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $LocalVarAccepts = @()
        $LocalVarContentTypes = @()
        $LocalVarQueryParameters = @{}
        $LocalVarHeaderParameters = @{}
        $LocalVarFormParameters = @{}
        $LocalVarPathParameters = @{}
        $LocalVarCookieParameters = @{}
        $LocalVarBodyParameter = $null

        $Configuration = Get-FlyConfiguration
        # HTTP header 'Accept' (if needed)
        $LocalVarAccepts = @('text/plain', 'application/json', 'text/json', 'application/*+json')

        if ($ReturnType) {
            # use the return type (MIME) provided by the user
            $LocalVarAccepts = @($ReturnType)
        }

        $LocalVarUri = '/downloadcenter/reporturl'

        if (!$JobId) {
            throw "Error! The required parameter `JobId` missing when calling getReportUrl."
        }
        $LocalVarQueryParameters['jobId'] = $JobId

        if ($Configuration["AccessToken"]) {
            $LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"]
            Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand)
        }

        $LocalVarResult = Invoke-FlyApiClient -Method 'GET' `
                                -Uri $LocalVarUri `
                                -Accepts $LocalVarAccepts `
                                -ContentTypes $LocalVarContentTypes `
                                -Body $LocalVarBodyParameter `
                                -HeaderParameters $LocalVarHeaderParameters `
                                -QueryParameters $LocalVarQueryParameters `
                                -FormParameters $LocalVarFormParameters `
                                -CookieParameters $LocalVarCookieParameters `
                                -ReturnType "UrlResultModel" `
                                -IsBodyNullable $false

        if ($WithHttpInfo.IsPresent) {
            return $LocalVarResult
        } else {
            return $LocalVarResult["Response"]
        }
    }
}