Api/FlyProjectsApi.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
 
Check if the project name already exists
 
.DESCRIPTION
 
No description available.
 
.PARAMETER Name
The name of the project which you want to check
 
.PARAMETER Id
The GUID of the project which you want to check, not required
 
.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
 
Boolean
#>

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

    Process {
        'Calling method: Invoke-FlyCheckProjectExist' | 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 = '/projects/validate'

        if ($Id) {
            $LocalVarQueryParameters['id'] = $Id
        }

        if (!$Name) {
            throw "Error! The required parameter `Name` missing when calling checkProjectExist."
        }
        $LocalVarQueryParameters['name'] = $Name

        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 "Boolean" `
                                -IsBodyNullable $false

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

<#
.SYNOPSIS
 
Create a new project
 
.DESCRIPTION
 
No description available.
 
.PARAMETER ProjectCreationModel
The information for project creation
 
.PARAMETER ReturnType
 
Select the return type (optional): 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
 
None
#>

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

    Process {
        'Calling method: New-FlyProject' | 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 = @('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 = '/projects'

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

        $LocalVarBodyParameter = ConvertTo-Json $ProjectCreationModel -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 "" `
                                -IsBodyNullable $false

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

<#
.SYNOPSIS
 
Get project mapping summaries by paging query
 
.DESCRIPTION
 
No description available.
 
.PARAMETER ProjectId
The GUID of the project which the project mapping belongs to, required
 
.PARAMETER Stages
A list of Stages which will be used together with other search conditions to filter project mappings.
 
.PARAMETER StageStatuses
A list of Stage Statues which will be used together with other search conditions to filter project mappings.
 
.PARAMETER Statuses
A list of Statuses which will be used together with other search conditions to filter project mappings.
 
.PARAMETER DestinationStatuses
A list of DestinationStatuses which will be used together with other search conditions to filter project mappings. Only used for Teams workspace
 
.PARAMETER ColorCodes
A list of ColorCodes which will be used together with other search conditions to filter project mappings.
 
.PARAMETER IsScheduled
Specify a boolean value to filter the project mappings with Scheduled stage status, need add Waiting into StageStatuses parameter simultaneously if True.
 
.PARAMETER Search
Search by name field
 
.PARAMETER SortBy
Order by one field
 
.PARAMETER SortOrder
Order by type
 
.PARAMETER Top
Define the number of records you want to return, default value is 20
 
.PARAMETER Skip
Define the number of records you want to skip, default value is 0
 
.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
 
ProjectMappingSummaryModelApiQueryResult
#>

function Get-FlyProjectMappings {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${ProjectId},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${Stages},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${StageStatuses},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${Statuses},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${DestinationStatuses},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${ColorCodes},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Boolean]]
        ${IsScheduled},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${Search},
        [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${SortBy},
        [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject]
        ${SortOrder},
        [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Top},
        [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Skip},
        [String]
        [ValidateSet("text/plain", "application/json", "text/json", "application/*+json")]
        $ReturnType,
        [Switch]
        $WithHttpInfo
    )

    Process {
        'Calling method: Get-FlyProjectMappings' | 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 = '/projects/{projectId}/mappings/summaries'
        if (!$ProjectId) {
            throw "Error! The required parameter `ProjectId` missing when calling getProjectMappings."
        }
        $LocalVarUri = $LocalVarUri.replace('{projectId}', [System.Web.HTTPUtility]::UrlEncode($ProjectId))

        if ($Stages) {
            $LocalVarQueryParameters['stages'] = $Stages
        }

        if ($StageStatuses) {
            $LocalVarQueryParameters['stageStatuses'] = $StageStatuses
        }

        if ($Statuses) {
            $LocalVarQueryParameters['statuses'] = $Statuses
        }

        if ($DestinationStatuses) {
            $LocalVarQueryParameters['destinationStatuses'] = $DestinationStatuses
        }

        if ($ColorCodes) {
            $LocalVarQueryParameters['colorCodes'] = $ColorCodes
        }

        if ($IsScheduled) {
            $LocalVarQueryParameters['isScheduled'] = $IsScheduled
        }

        if ($Search) {
            $LocalVarQueryParameters['search'] = $Search
        }

        if ($SortBy) {
            $LocalVarQueryParameters['sortBy'] = $SortBy
        }

        if ($SortOrder) {
            $LocalVarQueryParameters['sortOrder'] = $SortOrder
        }

        if ($Top) {
            $LocalVarQueryParameters['top'] = $Top
        }

        if ($Skip) {
            $LocalVarQueryParameters['skip'] = $Skip
        }

        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 "ProjectMappingSummaryModelApiQueryResult" `
                                -IsBodyNullable $false

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

<#
.SYNOPSIS
 
Get project summaries by paging query supported sort fields: name
 
.DESCRIPTION
 
No description available.
 
.PARAMETER TagIds
A collection of GUID for tags
 
.PARAMETER Statuses
A collection of Status which will be used together with other serach conditions to filter projects
 
.PARAMETER Types
A collection of Platform Types which will be used together with other serach conditions to filter projects
 
.PARAMETER Search
Search by name field
 
.PARAMETER SortBy
Order by one field
 
.PARAMETER SortOrder
Order by type
 
.PARAMETER Top
Define the number of records you want to return, default value is 20
 
.PARAMETER Skip
Define the number of records you want to skip, default value is 0
 
.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
 
ProjectSummaryModelApiQueryResult
#>

function Get-FlyProjects {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String[]]
        ${TagIds},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${Statuses},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject[]]
        ${Types},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${Search},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${SortBy},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject]
        ${SortOrder},
        [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Top},
        [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Skip},
        [String]
        [ValidateSet("text/plain", "application/json", "text/json", "application/*+json")]
        $ReturnType,
        [Switch]
        $WithHttpInfo
    )

    Process {
        'Calling method: Get-FlyProjects' | 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 = '/projects/summaries'

        if ($TagIds) {
            $LocalVarQueryParameters['tagIds'] = $TagIds
        }

        if ($Statuses) {
            $LocalVarQueryParameters['statuses'] = $Statuses
        }

        if ($Types) {
            $LocalVarQueryParameters['types'] = $Types
        }

        if ($Search) {
            $LocalVarQueryParameters['search'] = $Search
        }

        if ($SortBy) {
            $LocalVarQueryParameters['sortBy'] = $SortBy
        }

        if ($SortOrder) {
            $LocalVarQueryParameters['sortOrder'] = $SortOrder
        }

        if ($Top) {
            $LocalVarQueryParameters['top'] = $Top
        }

        if ($Skip) {
            $LocalVarQueryParameters['skip'] = $Skip
        }

        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 "ProjectSummaryModelApiQueryResult" `
                                -IsBodyNullable $false

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

<#
.SYNOPSIS
 
Generate error report per project.
 
.DESCRIPTION
 
No description available.
 
.PARAMETER GenerateProjectErrorReportSettingsModel
Generate error report job configuration information.
 
.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
 
String
#>

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

    Process {
        'Calling method: Start-FlyErrorReportJob' | 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 = '/projects/reports/mergeerrors'

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

        $LocalVarBodyParameter = ConvertTo-Json $GenerateProjectErrorReportSettingsModel -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 "String" `
                                -IsBodyNullable $false

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