endpoints/Contracts.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

<#
  .Synopsis
  Get list of contracts from the API
   
  .Parameter CustomerID
#>

function Get-AteraContracts {
  param (
    [Parameter()]
    [int] $CustomerID
  )
  $uri = "/contracts"
  if ($CustomerID) { $uri = "$uri/customer/$CustomerID" }
  return New-AteraGetRequest -Endpoint $uri
}

<#
  .Synopsis
  Get a single contract from the API
   
  .Parameter ContractID
#>

function Get-AteraContract {
  param (
    [Parameter()]
    [int] $ContractID
  )
  return New-AteraGetRequest -Endpoint "/contracts/$ContractID"
}