// AddDevice provides a mock function with given fields: d
550658
func (_m *DBClient) AddDevice(d models.Device) (string, error) {
	ret := _m.Called(d)

	var r0 string
	if rf, ok := ret.Get(0).(func(models.Device) string); ok {
		r0 = rf(d)
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(models.Device) error); ok {
		r1 = rf(d)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
472660
func (_m *DBClient) AddDeviceService(ds models.DeviceService) (string, error) {
	ret := _m.Called(ds)

	var r0 string
	if rf, ok := ret.Get(0).(func(models.DeviceService) string); ok {
		r0 = rf(ds)
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(models.DeviceService) error); ok {
		r1 = rf(ds)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
372079
func (n *NetworkServerAPI) GetDevice(ctx context.Context, req *ns.GetDeviceRequest) (*ns.GetDeviceResponse, error) {
	var devEUI lorawan.EUI64
	copy(devEUI[:], req.DevEui)

	d, err := storage.GetDevice(storage.DB(), devEUI)
	if err != nil {
		return nil, errToRPCError(err)
	}

	resp := ns.GetDeviceResponse{
		Device: &ns.Device{
			DevEui:            d.DevEUI[:],
			SkipFCntCheck:     d.SkipFCntCheck,
			DeviceProfileId:   d.DeviceProfileID[:],
			ServiceProfileId:  d.ServiceProfileID[:],
			RoutingProfileId:  d.RoutingProfileID[:],
			ReferenceAltitude: d.ReferenceAltitude,
		},
	}

	resp.CreatedAt, err = ptypes.TimestampProto(d.CreatedAt)
	if err != nil {
		return nil, errToRPCError(err)
	}

	resp.UpdatedAt, err = ptypes.TimestampProto(d.UpdatedAt)
	if err != nil {
		return nil, errToRPCError(err)
	}

	return &resp, nil
}
1210134
func (v VirtualMachine) AddDevice(ctx context.Context, device ...types.BaseVirtualDevice) error {
	return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationAdd, types.VirtualDeviceConfigSpecFileOperationCreate, device...)
}
675881
func (cki *ComputedKeyInfos) PaperDevices() []*Device {
	var d []*Device
	for _, v := range cki.Devices {
		if v.Status == nil {
			continue
		}
		if *v.Status != DeviceStatusActive {
			continue
		}
		if v.Type != DeviceTypePaper {
			continue
		}
		d = append(d, v)
	}
	return d
}
232093
func (c *Container) AddVolume(v ContainerVolume) {
	c.volumes = append(c.volumes, v)
}
913957
func (s *GetDeviceOutput) SetDevice(v *DeviceType) *GetDeviceOutput {
	s.Device = v
	return s
}
551820
func (o *Disk) SetDeviceName(v *string) *Disk {
	if o.DeviceName = v; o.DeviceName == nil {
		o.nullFields = append(o.nullFields, "DeviceName")
	}
	return o
}
392710
func (a *Accessory) AddService(s *service.Service) {
	a.Services = append(a.Services, s)
}
160372
func (s *AssociateDeviceWithPlacementInput) SetDeviceId(v string) *AssociateDeviceWithPlacementInput {
	s.DeviceId = &v
	return s
}
1041998
func (p *Pod) AddVolume(vol *PodVolume) *Pod {
	p.Volumes = append(p.Volumes, vol)
	return p
}
186156
func NewDevice(opts ...Option) (*Device, error) {
	d := &Device{
		rspc:   make(chan msg),
		conns:  make(map[string]*conn),
		chConn: make(chan *conn),
		chars:  make(map[int]*ble.Characteristic),
		base:   1,
	}
	if err := d.Option(opts...); err != nil {
		return nil, err
	}

	d.pm = xpc.XpcConnect("com.apple.blued", d)
	d.cm = xpc.XpcConnect("com.apple.blued", d)

	return d, errors.Wrap(d.Init(), "can't init")
}
1367135
func (b *Listeners) Add(f func()) {
	if b == nil {
		return
	}
	b.Lock()
	defer b.Unlock()
	b.listeners = append(b.listeners, f)
}
751452
func (m *PoolMetadata) GetDevice(ctx context.Context, name string) (*DeviceInfo, error) {
	var (
		dev DeviceInfo
		err error
	)

	err = m.db.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket(devicesBucketName)
		return getObject(bucket, name, &dev)
	})

	return &dev, err
}
300118
func (attacher *cinderDiskAttacher) MountDevice(spec *volume.Spec, devicePath string, deviceMountPath string) error {
	mounter := attacher.host.GetMounter(cinderVolumePluginName)
	notMnt, err := mounter.IsLikelyNotMountPoint(deviceMountPath)
	if err != nil {
		if os.IsNotExist(err) {
			if err := os.MkdirAll(deviceMountPath, 0750); err != nil {
				return err
			}
			notMnt = true
		} else {
			return err
		}
	}

	_, volumeFSType, readOnly, err := getVolumeInfo(spec)
	if err != nil {
		return err
	}

	options := []string{}
	if readOnly {
		options = append(options, "ro")
	}
	if notMnt {
		diskMounter := volumeutil.NewSafeFormatAndMountFromHost(cinderVolumePluginName, attacher.host)
		mountOptions := volumeutil.MountOptionFromSpec(spec, options...)
		err = diskMounter.FormatAndMount(devicePath, deviceMountPath, volumeFSType, mountOptions)
		if err != nil {
			os.Remove(deviceMountPath)
			return err
		}
	}
	return nil
}
88879
func (ctx *Ctx) CurrentDevice() (device Device, err error) {
	return ctx.device, nil
}
652056
func (b *DiskBuilder) AddNote(note string) {
	b.notes = append(b.notes, note)
}