// GetByIDs sends out all items matching a set of IDs
764591
func (r *ChainResource) GetByIDs(ctx smolder.APIContext, request *restful.Request, response *restful.Response, ids []string) {
	resp := ChainResponse{}
	resp.Init(ctx)

	for _, id := range ids {
		chain := bees.GetChain(id)
		if chain == nil {
			r.NotFound(request, response)
			return
		}

		resp.AddChain(*chain)
	}

	resp.Send(response)
}
274091
func (c *Client) GetLightByID(id uint64) (light common.Light, err error) {
	dev, err := c.GetDeviceByID(id)
	if err != nil {
		return nil, err
	}

	light, ok := dev.(common.Light)
	if !ok {
		return nil, common.ErrDeviceInvalidType
	}

	return light, nil
}
1121919
func getByID(c context.Context, id string) (*instances.Instance, error) {
	if vmtoken.Has(c) {
		return nil, status.Errorf(codes.PermissionDenied, "unauthorized user")
	}
	vm := &model.VM{
		ID: id,
	}
	switch err := datastore.Get(c, vm); {
	case err == datastore.ErrNoSuchEntity:
		return nil, status.Errorf(codes.NotFound, "no VM found with ID %q", id)
	case err != nil:
		return nil, errors.Annotate(err, "failed to fetch VM").Err()
	default:
		return toInstance(vm), nil
	}
}
563756
func DeleteNoticesByIDs(ids []int64) error {
	if len(ids) == 0 {
		return nil
	}
	_, err := x.Where("id IN (" + strings.Join(tool.Int64sToStrings(ids), ",") + ")").Delete(new(Notice))
	return err
}
1163567
func (r *BulkResponse) ById(id string) []*BulkResponseItem {
	if r.Items == nil {
		return nil
	}
	items := make([]*BulkResponseItem, 0)
	for _, item := range r.Items {
		for _, result := range item {
			if result.Id == id {
				items = append(items, result)
			}
		}
	}
	return items
}
1257099
func (repo *repo) FindByID(id uint) (user service.Entity, err error) {
	if err = dbconn.DB.Where("id = ?", id).First(&user).Error; err != nil {
		return service.Entity{}, err
	}
	return user, nil
}
549737
func (info Info) GetUserByID(userID string) *User {
	for _, user := range info.Users {
		if user.ID == userID {
			return &user
		}
	}
	return nil
}
1367550
func (c *Client) GetFileInfoByID(id string) (*FileInfo, error) {
	res, err := c.doRequest("b2_get_file_info", map[string]interface{}{
		"fileId": id,
	})
	if err != nil {
		return nil, err
	}
	defer drainAndClose(res.Body)
	var fi *fileInfoObj
	if err := json.NewDecoder(res.Body).Decode(&fi); err != nil {
		return nil, err
	}
	return fi.makeFileInfo(), nil
}
484063
func (ts *Store) GetIDs() ([]string, error) {
	var treeStoreIDs []string
	ls, err := ioutil.ReadDir(ts.dir)
	if err != nil {
		if !os.IsNotExist(err) {
			return nil, errwrap.Wrap(errors.New("cannot read treestore directory"), err)
		}
	}

	for _, p := range ls {
		if p.IsDir() {
			id := filepath.Base(p.Name())
			treeStoreIDs = append(treeStoreIDs, id)
		}
	}
	return treeStoreIDs, nil
}
245425
func GetLobbyByID(id uint) (*Lobby, error) {
	lob := &Lobby{}
	err := db.DB.First(lob, id).Error

	if err == gorm.ErrRecordNotFound {
		return nil, ErrLobbyNotFound
	}

	return lob, err
}
599743
func (r *RepositoryInvitation) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
676585
func (u *UniterAPIV5) RelationById(args params.RelationIds) (params.RelationResultsV5, error) {
	v6Results, err := u.UniterAPI.RelationById(args)
	if err != nil {
		return params.RelationResultsV5{}, errors.Trace(err)
	}
	return relationResultsToV5(v6Results), nil
}
389160
func (s *DomainService) GetDomainByID(id string, opts ...OptionFunc) (*Domain, int, error) {
	p := &ListDomainsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListDomains(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.Domains[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for Domain UUID: %s!", id)
}
840448
func (m *UserManager) GetByID(id int64) (user User, err error) {
	stmt := Users.Select().Where(Users.C("id").Equals(id))
	if err = m.conn.Query(stmt, &user); err != nil {
		return
	}
	if !user.Exists() {
		err = fmt.Errorf("auth: no user with id %d exists", id)
	}
	return
}
614
func (f *File) ItemByID(id uint32) (*Item, error) {
	meta, err := f.getMeta()
	if err != nil {
		return nil, err
	}
	it := &Item{
		f:  f,
		ID: id,
	}
	if meta.ItemLocation != nil {
		for _, ilbe := range meta.ItemLocation.Items {
			if uint32(ilbe.ItemID) == id {
				shallowCopy := ilbe
				it.Location = &shallowCopy
			}
		}
	}
	if meta.ItemInfo != nil {
		for _, iie := range meta.ItemInfo.ItemInfos {
			if uint32(iie.ItemID) == id {
				it.Info = iie
			}
		}
	}
	if it.Info == nil {
		return nil, ErrUnknownItem
	}
	if meta.Properties != nil {
		allProps := meta.Properties.PropertyContainer.Properties
		for _, ipa := range meta.Properties.Associations {
			// TODO: I've never seen a file with more than
			// top-level ItemPropertyAssociation box, but
			// apparently they can exist with different
			// versions/flags. For now we just merge them
			// all together, but that's not really right.
			// So for now, just bail once a previous loop
			// found anything.
			if len(it.Properties) > 0 {
				break
			}

			for _, ipai := range ipa.Entries {
				if ipai.ItemID != id {
					continue
				}
				for _, ass := range ipai.Associations {
					if ass.Index != 0 && int(ass.Index) <= len(allProps) {
						box := allProps[ass.Index-1]
						boxp, err := box.Parse()
						if err == nil {
							box = boxp
						}
						it.Properties = append(it.Properties, box)
					}
				}
			}
		}
	}
	return it, nil
}
990525
func (_m *DBClient) GetDeviceById(id string) (models.Device, error) {
	ret := _m.Called(id)

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

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

	return r0, r1
}
829155
func (db UserDB) GetByID(id string) (u *models.User, ok bool) {
	u, ok = db.ids[id]
	return
}