func AssignDeviceToModel(client *ei.BuildClient, device_id string, model_id string) { device, err := client.GetDevice(device_id) if err != nil { logging.Fatal("Failed to retrieve current model for model id: %s", model_id) return } // Don't do anything if its already the same if device.ModelId == model_id { return } device.ModelId = model_id updated_device, err := client.UpdateDevice(&device, device_id) logging.Debug("Model and new Devices: %s", updated_device) }