Api/TorizonPlatformAPIDeviceMetricsApi.ps1

#
# Torizon OTA
# This API is rate limited and will return the following headers for each API call. - X-RateLimit-Limit - The total number of requests allowed within a time period - X-RateLimit-Remaining - The total number of requests still allowed until the end of the rate limiting period - X-RateLimit-Reset - The number of seconds until the limit is fully reset In addition, if an API client is rate limited, it will receive a HTTP 420 response with the following header: - Retry-After - The number of seconds to wait until this request is allowed
# Version: 2.0-Beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

Get metrics data from a single device

.DESCRIPTION

No description available.

.PARAMETER DeviceUuid
No description available.

.PARAMETER From
No description available.

.PARAMETER To
No description available.

.PARAMETER Metric
No description available.

.PARAMETER Resolution
No description available.

.PARAMETER WithHttpInfo

A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response

.OUTPUTS

MetricsResponse
#>

function Get-TorizonPlatformAPIDeviceDataDevicesDeviceuuidMetrics {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${DeviceUuid},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [Int64]
        ${From},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [Int64]
        ${To},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String[]]
        ${Metric},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Resolution},
        [Switch]
        $WithHttpInfo
    )

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

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

        $Configuration = Get-TorizonPlatformAPIConfiguration
        # HTTP header 'Accept' (if needed)
        $LocalVarAccepts = @('application/json')

        $LocalVarUri = '/device-data/devices/{deviceUuid}/metrics'
        if (!$DeviceUuid) {
            throw "Error! The required parameter `DeviceUuid` missing when calling getDeviceDataDevicesDeviceuuidMetrics."
        }
        $LocalVarUri = $LocalVarUri.replace('{deviceUuid}', [System.Web.HTTPUtility]::UrlEncode($DeviceUuid))

        if ($Metric) {
            $LocalVarQueryParameters['metric'] = $Metric
        }

        if (!$From) {
            throw "Error! The required parameter `From` missing when calling getDeviceDataDevicesDeviceuuidMetrics."
        }
        $LocalVarQueryParameters['from'] = $From

        if (!$To) {
            throw "Error! The required parameter `To` missing when calling getDeviceDataDevicesDeviceuuidMetrics."
        }
        $LocalVarQueryParameters['to'] = $To

        if ($Resolution) {
            $LocalVarQueryParameters['resolution'] = $Resolution
        }

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

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

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

<#
.SYNOPSIS

Get aggregated metrics data from a fleet of devices

.DESCRIPTION

No description available.

.PARAMETER FleetId
No description available.

.PARAMETER From
No description available.

.PARAMETER To
No description available.

.PARAMETER Metric
No description available.

.PARAMETER Resolution
No description available.

.PARAMETER WithHttpInfo

A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response

.OUTPUTS

MetricsResponse
#>

function Get-TorizonPlatformAPIDeviceDataFleetsFleetidMetrics {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String]
        ${FleetId},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [Int64]
        ${From},
        [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [Int64]
        ${To},
        [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [String[]]
        ${Metric},
        [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int32]]
        ${Resolution},
        [Switch]
        $WithHttpInfo
    )

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

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

        $Configuration = Get-TorizonPlatformAPIConfiguration
        # HTTP header 'Accept' (if needed)
        $LocalVarAccepts = @('application/json')

        $LocalVarUri = '/device-data/fleets/{fleetId}/metrics'
        if (!$FleetId) {
            throw "Error! The required parameter `FleetId` missing when calling getDeviceDataFleetsFleetidMetrics."
        }
        $LocalVarUri = $LocalVarUri.replace('{fleetId}', [System.Web.HTTPUtility]::UrlEncode($FleetId))

        if ($Metric) {
            $LocalVarQueryParameters['metric'] = $Metric
        }

        if (!$From) {
            throw "Error! The required parameter `From` missing when calling getDeviceDataFleetsFleetidMetrics."
        }
        $LocalVarQueryParameters['from'] = $From

        if (!$To) {
            throw "Error! The required parameter `To` missing when calling getDeviceDataFleetsFleetidMetrics."
        }
        $LocalVarQueryParameters['to'] = $To

        if ($Resolution) {
            $LocalVarQueryParameters['resolution'] = $Resolution
        }

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

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

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

<#
.SYNOPSIS

Get the list of metrics available in your repository

.DESCRIPTION

No description available.

.PARAMETER From
No description available.

.PARAMETER To
No description available.

.PARAMETER WithHttpInfo

A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response

.OUTPUTS

PaginationResultString
#>

function Get-TorizonPlatformAPIDeviceDataMetricNames {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int64]]
        ${From},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
        [System.Nullable[Int64]]
        ${To},
        [Switch]
        $WithHttpInfo
    )

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

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

        $Configuration = Get-TorizonPlatformAPIConfiguration
        # HTTP header 'Accept' (if needed)
        $LocalVarAccepts = @('application/json')

        $LocalVarUri = '/device-data/metric-names'

        if ($From) {
            $LocalVarQueryParameters['from'] = $From
        }

        if ($To) {
            $LocalVarQueryParameters['to'] = $To
        }

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

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

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