Skip to content

Commit 9ecf9e7

Browse files
authored
Merge pull request #186 from PetriAsi/fix/accessories
set model_number and min_amt
2 parents 12d8b76 + cbb9e13 commit 9ecf9e7

File tree

4 files changed

+62
-23
lines changed

4 files changed

+62
-23
lines changed

SnipeitPS/Public/New-SnipeitAccessory.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ ID Number of the company the accessory is assigned to
2323
.PARAMETER manufacturer_id
2424
ID number of the manufacturer for this accessory.
2525
26+
.PARAMETER model_number
27+
Model number for this accessory
28+
2629
.PARAMETER order_number
2730
Order number for this accessory.
2831
@@ -47,7 +50,7 @@ ID number of the supplier for this accessory
4750
.PARAMETER location_id
4851
ID number of the location the accessory is assigned to
4952
50-
.PARAMETER min_qty
53+
.PARAMETER min_amt
5154
Min quantity of the accessory before alert is triggered
5255
5356
.PARAMETER url
@@ -86,11 +89,13 @@ function New-SnipeitAccessory() {
8689

8790
[string]$order_number,
8891

92+
[string]$model_number,
93+
8994
[float]$purchase_cost,
9095

9196
[datetime]$purchase_date,
9297

93-
[int]$min_qty,
98+
[int]$min_amt,
9499

95100
[ValidateRange(1, [int]::MaxValue)]
96101
[int]$supplier_id,

SnipeitPS/Public/Set-SnipeitAccessory.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ ID Number of the company the accessory is assigned to
2626
.PARAMETER manufacturer_id
2727
ID number of the manufacturer for this accessory.
2828
29+
.PARAMETER model_number
30+
Model number for this accessory
31+
2932
.PARAMETER order_number
3033
Order number for this accessory.
3134
@@ -85,6 +88,7 @@ function Set-SnipeitAccessory() {
8588

8689
[Nullable[System.Int32]]$manufacturer_id,
8790

91+
[string]$model_number,
8892

8993
[string]$order_number,
9094

@@ -120,7 +124,7 @@ function Set-SnipeitAccessory() {
120124
foreach($accessory_id in $id){
121125
$Parameters = @{
122126
Uri = "$url/api/v1/accessories/$accessory_id"
123-
Method = 'Patch'
127+
Method = 'Put'
124128
Body = $Body
125129
Token = $apiKey
126130
}

docs/New-SnipeitAccessory.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Creates new accessory on Snipe-It system
1414

1515
```
1616
New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>]
17-
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
18-
[[-purchase_date] <DateTime>] [[-min_qty] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
17+
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-model_number] <String>] [[-purchase_cost] <Single>]
18+
[[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
1919
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

@@ -40,7 +40,7 @@ Parameter Sets: (All)
4040
Aliases:
4141

4242
Required: True
43-
Position: 13
43+
Position: 14
4444
Default value: None
4545
Accept pipeline input: False
4646
Accept wildcard characters: False
@@ -85,7 +85,7 @@ Parameter Sets: (All)
8585
Aliases:
8686

8787
Required: False
88-
Position: 11
88+
Position: 12
8989
Default value: 0
9090
Accept pipeline input: False
9191
Accept wildcard characters: False
@@ -106,7 +106,7 @@ Accept pipeline input: False
106106
Accept wildcard characters: False
107107
```
108108
109-
### -min_qty
109+
### -min_amt
110110
Min quantity of the accessory before alert is triggered
111111
112112
```yaml
@@ -115,12 +115,27 @@ Parameter Sets: (All)
115115
Aliases:
116116

117117
Required: False
118-
Position: 9
118+
Position: 10
119119
Default value: 0
120120
Accept pipeline input: False
121121
Accept wildcard characters: False
122122
```
123123
124+
### -model_number
125+
Model number for this accessory
126+
127+
```yaml
128+
Type: String
129+
Parameter Sets: (All)
130+
Aliases:
131+
132+
Required: False
133+
Position: 7
134+
Default value: None
135+
Accept pipeline input: False
136+
Accept wildcard characters: False
137+
```
138+
124139
### -name
125140
Accessory name
126141
@@ -160,7 +175,7 @@ Parameter Sets: (All)
160175
Aliases:
161176

162177
Required: False
163-
Position: 7
178+
Position: 8
164179
Default value: 0
165180
Accept pipeline input: False
166181
Accept wildcard characters: False
@@ -175,7 +190,7 @@ Parameter Sets: (All)
175190
Aliases:
176191

177192
Required: False
178-
Position: 8
193+
Position: 9
179194
Default value: None
180195
Accept pipeline input: False
181196
Accept wildcard characters: False
@@ -205,7 +220,7 @@ Parameter Sets: (All)
205220
Aliases:
206221

207222
Required: False
208-
Position: 10
223+
Position: 11
209224
Default value: 0
210225
Accept pipeline input: False
211226
Accept wildcard characters: False
@@ -220,7 +235,7 @@ Parameter Sets: (All)
220235
Aliases:
221236

222237
Required: True
223-
Position: 12
238+
Position: 13
224239
Default value: None
225240
Accept pipeline input: False
226241
Accept wildcard characters: False

docs/Set-SnipeitAccessory.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Updates accessory on Snipe-It system
1414

1515
```
1616
Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
17-
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
18-
[[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [-url] <String> [-apiKey] <String>
19-
[-WhatIf] [-Confirm] [<CommonParameters>]
17+
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-model_number] <String>] [[-order_number] <String>]
18+
[[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>]
19+
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

2222
## DESCRIPTION
@@ -40,7 +40,7 @@ Parameter Sets: (All)
4040
Aliases:
4141

4242
Required: True
43-
Position: 13
43+
Position: 14
4444
Default value: None
4545
Accept pipeline input: False
4646
Accept wildcard characters: False
@@ -115,7 +115,22 @@ Parameter Sets: (All)
115115
Aliases:
116116

117117
Required: False
118-
Position: 10
118+
Position: 11
119+
Default value: None
120+
Accept pipeline input: False
121+
Accept wildcard characters: False
122+
```
123+
124+
### -model_number
125+
Model number for this accessory
126+
127+
```yaml
128+
Type: String
129+
Parameter Sets: (All)
130+
Aliases:
131+
132+
Required: False
133+
Position: 7
119134
Default value: None
120135
Accept pipeline input: False
121136
Accept wildcard characters: False
@@ -145,7 +160,7 @@ Parameter Sets: (All)
145160
Aliases:
146161

147162
Required: False
148-
Position: 7
163+
Position: 8
149164
Default value: None
150165
Accept pipeline input: False
151166
Accept wildcard characters: False
@@ -160,7 +175,7 @@ Parameter Sets: (All)
160175
Aliases:
161176

162177
Required: False
163-
Position: 8
178+
Position: 9
164179
Default value: 0
165180
Accept pipeline input: False
166181
Accept wildcard characters: False
@@ -175,7 +190,7 @@ Parameter Sets: (All)
175190
Aliases:
176191

177192
Required: False
178-
Position: 9
193+
Position: 10
179194
Default value: None
180195
Accept pipeline input: False
181196
Accept wildcard characters: False
@@ -205,7 +220,7 @@ Parameter Sets: (All)
205220
Aliases:
206221

207222
Required: False
208-
Position: 11
223+
Position: 12
209224
Default value: None
210225
Accept pipeline input: False
211226
Accept wildcard characters: False
@@ -220,7 +235,7 @@ Parameter Sets: (All)
220235
Aliases:
221236

222237
Required: True
223-
Position: 12
238+
Position: 13
224239
Default value: None
225240
Accept pipeline input: False
226241
Accept wildcard characters: False

0 commit comments

Comments
 (0)