Merge pull request #186 from PetriAsi/fix/accessories

set model_number and min_amt
This commit is contained in:
Petri Asikainen 2021-06-17 10:59:16 +03:00 committed by GitHub
commit 9ecf9e7313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 23 deletions

View file

@ -23,6 +23,9 @@ ID Number of the company the accessory is assigned to
.PARAMETER manufacturer_id .PARAMETER manufacturer_id
ID number of the manufacturer for this accessory. ID number of the manufacturer for this accessory.
.PARAMETER model_number
Model number for this accessory
.PARAMETER order_number .PARAMETER order_number
Order number for this accessory. Order number for this accessory.
@ -47,7 +50,7 @@ ID number of the supplier for this accessory
.PARAMETER location_id .PARAMETER location_id
ID number of the location the accessory is assigned to ID number of the location the accessory is assigned to
.PARAMETER min_qty .PARAMETER min_amt
Min quantity of the accessory before alert is triggered Min quantity of the accessory before alert is triggered
.PARAMETER url .PARAMETER url
@ -86,11 +89,13 @@ function New-SnipeitAccessory() {
[string]$order_number, [string]$order_number,
[string]$model_number,
[float]$purchase_cost, [float]$purchase_cost,
[datetime]$purchase_date, [datetime]$purchase_date,
[int]$min_qty, [int]$min_amt,
[ValidateRange(1, [int]::MaxValue)] [ValidateRange(1, [int]::MaxValue)]
[int]$supplier_id, [int]$supplier_id,

View file

@ -26,6 +26,9 @@ ID Number of the company the accessory is assigned to
.PARAMETER manufacturer_id .PARAMETER manufacturer_id
ID number of the manufacturer for this accessory. ID number of the manufacturer for this accessory.
.PARAMETER model_number
Model number for this accessory
.PARAMETER order_number .PARAMETER order_number
Order number for this accessory. Order number for this accessory.
@ -85,6 +88,7 @@ function Set-SnipeitAccessory() {
[Nullable[System.Int32]]$manufacturer_id, [Nullable[System.Int32]]$manufacturer_id,
[string]$model_number,
[string]$order_number, [string]$order_number,
@ -120,7 +124,7 @@ function Set-SnipeitAccessory() {
foreach($accessory_id in $id){ foreach($accessory_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories/$accessory_id" Uri = "$url/api/v1/accessories/$accessory_id"
Method = 'Patch' Method = 'Put'
Body = $Body Body = $Body
Token = $apiKey Token = $apiKey
} }

View file

@ -14,8 +14,8 @@ Creates new accessory on Snipe-It system
``` ```
New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>] New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-model_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_qty] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -40,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 14
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -85,7 +85,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 11 Position: 12
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -106,7 +106,7 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -min_qty ### -min_amt
Min quantity of the accessory before alert is triggered Min quantity of the accessory before alert is triggered
```yaml ```yaml
@ -115,12 +115,27 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 9 Position: 10
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -model_number
Model number for this accessory
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -name ### -name
Accessory name Accessory name
@ -160,7 +175,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 7 Position: 8
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -175,7 +190,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 8 Position: 9
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -205,7 +220,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 10 Position: 11
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -220,7 +235,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 12 Position: 13
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,9 +14,9 @@ Updates accessory on Snipe-It system
``` ```
Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>] Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>] [[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-model_number] <String>] [[-order_number] <String>]
[[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [-url] <String> [-apiKey] <String> [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>]
[-WhatIf] [-Confirm] [<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -40,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 14
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -115,7 +115,22 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 10 Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -model_number
Model number for this accessory
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -145,7 +160,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 7 Position: 8
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -160,7 +175,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 8 Position: 9
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -175,7 +190,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 9 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -205,7 +220,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 11 Position: 12
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -220,7 +235,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 12 Position: 13
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False