@@ -27,7 +27,7 @@ func testCreateDevice(t *testing.T) ArduinoDevicev2 {
27
27
Type : "mkr1000" ,
28
28
}
29
29
30
- device , _ , err := client .DevicesV2Api .DevicesV2Create (ctx , devicePayload )
30
+ device , _ , err := client .DevicesV2Api .DevicesV2Create (ctx , devicePayload , nil )
31
31
assert .NoError (t , err , "No errors creating device" )
32
32
assert .Equal (t , devicePayload .Name , device .Name , "Device name was correctly set" )
33
33
assert .Equal (t , devicePayload .Type , device .Type , "Device type was correctly set" )
@@ -111,7 +111,7 @@ func cleanup() {
111
111
}
112
112
113
113
for _ , d := range devices {
114
- _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , d .Id )
114
+ _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , d .Id , nil )
115
115
if err != nil {
116
116
panic (err )
117
117
}
@@ -144,7 +144,7 @@ func TestDevicesAPI(t *testing.T) {
144
144
device := testCreateDevice (t )
145
145
146
146
// Show device
147
- newDevice , _ , err := client .DevicesV2Api .DevicesV2Show (ctx , device .Id )
147
+ newDevice , _ , err := client .DevicesV2Api .DevicesV2Show (ctx , device .Id , nil )
148
148
assert .NoError (t , err , "No errors showing device" )
149
149
assert .Equal (t , device .Name , newDevice .Name , "Device Name is correct" )
150
150
assert .Equal (t , device .Type , newDevice .Type , "Device ID is correct" )
@@ -159,12 +159,12 @@ func TestDevicesAPI(t *testing.T) {
159
159
newName := "TestDevice2"
160
160
device , _ , err = client .DevicesV2Api .DevicesV2Update (ctx , device .Id , Devicev2 {
161
161
Name : newName ,
162
- })
162
+ }, nil )
163
163
assert .NoError (t , err , "No error updating device" )
164
164
assert .Equal (t , newName , device .Name , "Name was updated correctly" )
165
165
166
166
// Delete device
167
- _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id )
167
+ _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id , nil )
168
168
assert .NoError (t , err , "No errors deleting device" )
169
169
170
170
// Ensure device list is empty
@@ -173,7 +173,7 @@ func TestDevicesAPI(t *testing.T) {
173
173
assert .Equal (t , 0 , len (devices ), "Device list is empty" )
174
174
175
175
// Try to get the no more existing device
176
- device , _ , err = client .DevicesV2Api .DevicesV2Show (ctx , device .Id )
176
+ device , _ , err = client .DevicesV2Api .DevicesV2Show (ctx , device .Id , nil )
177
177
assert .EqualError (t , err , "401 Unauthorized" , "Error should be unauthorized" )
178
178
assert .Equal (t , ArduinoDevicev2 {}, device , "Device should be empty" )
179
179
}
@@ -205,7 +205,7 @@ func TestThingsAPI(t *testing.T) {
205
205
assert .Equal (t , ArduinoThing {}, thing , "Thing should be empty" )
206
206
207
207
// Delete device
208
- _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id )
208
+ _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id , nil )
209
209
assert .NoError (t , err , "No errors deleting device" )
210
210
}
211
211
@@ -234,7 +234,7 @@ func TestProperties(t *testing.T) {
234
234
assert .Equal (t , propertyPayload .UpdateStrategy , property .UpdateStrategy , "Property update strategy was set correctly" )
235
235
236
236
// Generate a sketch
237
- thing , _ , err = client .ThingsV2Api .ThingsV2CreateSketch (ctx , thing .Id , ThingSketch {})
237
+ thing , _ , err = client .ThingsV2Api .ThingsV2CreateSketch (ctx , thing .Id , ThingSketch {}, nil )
238
238
assert .NoError (t , err , "No errors creating sketch" )
239
239
assert .NotNil (t , thing .SketchId , "Sketch ID is not null" )
240
240
@@ -320,7 +320,7 @@ func TestProperties(t *testing.T) {
320
320
assert .NoError (t , err , "No errors getting raw series last value" )
321
321
322
322
// Delete sketch
323
- thing , _ , err = client .ThingsV2Api .ThingsV2DeleteSketch (ctx , thing .Id )
323
+ thing , _ , err = client .ThingsV2Api .ThingsV2DeleteSketch (ctx , thing .Id , nil )
324
324
assert .NoError (t , err , "No errors updating sketch" )
325
325
assert .Equal (t , "" , thing .SketchId , "Sketch ID is empty" )
326
326
@@ -329,7 +329,7 @@ func TestProperties(t *testing.T) {
329
329
assert .NoError (t , err , "No errors deleting property" )
330
330
331
331
// Delete device and thing
332
- _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id )
332
+ _ , err = client .DevicesV2Api .DevicesV2Delete (ctx , device .Id , nil )
333
333
assert .NoError (t , err , "No errors deleting device" )
334
334
335
335
_ , err = client .ThingsV2Api .ThingsV2Delete (ctx , thing .Id , nil )
0 commit comments