Api/FlyPoliciesApi.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 policy summaries by paging query supported sort fields: name, description, lastModifyTime
 
.DESCRIPTION
 
No description available.
 
.PARAMETER MigrationModuleType
The platform type of the policy
 
.PARAMETER IgnoreInUseProperty
A boolean value indicates whether do not check the policy is being used, default is false; Set it to true if the performance is slow
 
.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
 
PolicySummaryModelApiQueryResult
#>

function Get-FlyPolicies {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject]
        ${MigrationModuleType},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Boolean]]
        ${IgnoreInUseProperty},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${Search},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${SortBy},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [PSCustomObject]
        ${SortOrder},
        [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Top},
        [Parameter(Position = 6, 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-FlyPolicies' | 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 = '/policies/summaries'

        if ($MigrationModuleType) {
            $LocalVarQueryParameters['migrationModuleType'] = $MigrationModuleType
        }

        if ($IgnoreInUseProperty) {
            $LocalVarQueryParameters['ignoreInUseProperty'] = $IgnoreInUseProperty
        }

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

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