@@ -54,7 +54,7 @@ func (cl *Client) DeviceCreate(fqbn, name, serial, dType string) (*iotclient.Ard
5454 Serial : serial ,
5555 Type : dType ,
5656 }
57- dev , _ , err := cl .api .DevicesV2Api .DevicesV2Create (cl .ctx , payload )
57+ dev , _ , err := cl .api .DevicesV2Api .DevicesV2Create (cl .ctx , payload , nil )
5858 if err != nil {
5959 err = fmt .Errorf ("creating device, %w" , errorDetail (err ))
6060 return nil , err
@@ -105,7 +105,7 @@ func (cl *Client) DevicePassSet(id string) (*iotclient.ArduinoDevicev2Pass, erro
105105// DeviceDelete deletes the device corresponding to the passed ID
106106// from Arduino IoT Cloud.
107107func (cl * Client ) DeviceDelete (id string ) error {
108- _ , err := cl .api .DevicesV2Api .DevicesV2Delete (cl .ctx , id )
108+ _ , err := cl .api .DevicesV2Api .DevicesV2Delete (cl .ctx , id , nil )
109109 if err != nil {
110110 err = fmt .Errorf ("deleting device: %w" , errorDetail (err ))
111111 return err
@@ -137,7 +137,7 @@ func (cl *Client) DeviceList(tags map[string]string) ([]iotclient.ArduinoDevicev
137137// DeviceShow allows to retrieve a specific device, given its id,
138138// from Arduino IoT Cloud.
139139func (cl * Client ) DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error ) {
140- dev , _ , err := cl .api .DevicesV2Api .DevicesV2Show (cl .ctx , id )
140+ dev , _ , err := cl .api .DevicesV2Api .DevicesV2Show (cl .ctx , id , nil )
141141 if err != nil {
142142 err = fmt .Errorf ("retrieving device, %w" , errorDetail (err ))
143143 return nil , err
@@ -150,6 +150,7 @@ func (cl *Client) DeviceShow(id string) (*iotclient.ArduinoDevicev2, error) {
150150func (cl * Client ) DeviceOTA (id string , file * os.File , expireMins int ) error {
151151 opt := & iotclient.DevicesV2OtaUploadOpts {
152152 ExpireInMins : optional .NewInt32 (int32 (expireMins )),
153+ Async : optional .NewBool (true ),
153154 }
154155 _ , err := cl .api .DevicesV2OtaApi .DevicesV2OtaUpload (cl .ctx , id , file , opt )
155156 if err != nil {
@@ -313,7 +314,7 @@ func (cl *Client) ThingTagsDelete(id string, keys []string) error {
313314
314315// DashboardCreate adds a new dashboard on Arduino IoT Cloud.
315316func (cl * Client ) DashboardCreate (dashboard * iotclient.Dashboardv2 ) (* iotclient.ArduinoDashboardv2 , error ) {
316- newDashboard , _ , err := cl .api .DashboardsV2Api .DashboardsV2Create (cl .ctx , * dashboard )
317+ newDashboard , _ , err := cl .api .DashboardsV2Api .DashboardsV2Create (cl .ctx , * dashboard , nil )
317318 if err != nil {
318319 return nil , fmt .Errorf ("%s: %w" , "adding new dashboard" , errorDetail (err ))
319320 }
@@ -323,7 +324,7 @@ func (cl *Client) DashboardCreate(dashboard *iotclient.Dashboardv2) (*iotclient.
323324// DashboardShow allows to retrieve a specific dashboard, given its id,
324325// from Arduino IoT Cloud.
325326func (cl * Client ) DashboardShow (id string ) (* iotclient.ArduinoDashboardv2 , error ) {
326- dashboard , _ , err := cl .api .DashboardsV2Api .DashboardsV2Show (cl .ctx , id )
327+ dashboard , _ , err := cl .api .DashboardsV2Api .DashboardsV2Show (cl .ctx , id , nil )
327328 if err != nil {
328329 err = fmt .Errorf ("retrieving dashboard, %w" , errorDetail (err ))
329330 return nil , err
@@ -343,7 +344,7 @@ func (cl *Client) DashboardList() ([]iotclient.ArduinoDashboardv2, error) {
343344
344345// DashboardDelete deletes a dashboard from Arduino IoT Cloud.
345346func (cl * Client ) DashboardDelete (id string ) error {
346- _ , err := cl .api .DashboardsV2Api .DashboardsV2Delete (cl .ctx , id )
347+ _ , err := cl .api .DashboardsV2Api .DashboardsV2Delete (cl .ctx , id , nil )
347348 if err != nil {
348349 err = fmt .Errorf ("deleting dashboard: %w" , errorDetail (err ))
349350 return err
@@ -362,8 +363,6 @@ func (cl *Client) setup(client, secret, organization string) error {
362363 // We use the token to create a context that will be passed to any API call
363364 cl .ctx = context .WithValue (context .Background (), iotclient .ContextAccessToken , tok .AccessToken )
364365
365- // Create an instance of the iot-api Go client, we pass an empty config
366- // because defaults are ok
367366 config := iotclient .NewConfiguration ()
368367 if organization != "" {
369368 config .DefaultHeader = map [string ]string {"X-Organization" : organization }
0 commit comments