// GetID returns the ID field if it's non-nil, zero value otherwise.
767158
func (r *RepositoryComment) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
161608
func (r *Repository) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
277762
func (e *Event) GetID() string {
	if e == nil || e.ID == nil {
		return ""
	}
	return *e.ID
}
1015955
func (c *CheckSuite) GetID() int64 {
	if c == nil || c.ID == nil {
		return 0
	}
	return *c.ID
}
1190612
func (s *SliceQuery) Id(id int) *SliceQuery {
	s.id = &id
	return s
}
1150384
func (u *User) GetID() int64 {
	if u == nil || u.ID == nil {
		return 0
	}
	return *u.ID
}
81385
func (d *Dispatch) GetId(name string) (id int32, err error) {
	var dispid []int32
	dispid, err = d.Object.GetIDsOfName([]string{name})
	if err != nil {
		return
	}
	id = dispid[0]
	return
}
68079
func (lft *FieldTranslator) GetID(val interface{}) (id uint64, err error) {
	var vall pdk.Literal
	switch valt := val.(type) {
	case []byte:
		vall = pdk.S(valt)
	case string:
		vall = pdk.S(valt)
	default:
		var ok bool
		if vall, ok = val.(pdk.Literal); !ok {
			return 0, errors.Errorf("val needs to be string, byte slice, or Literal, but is type: %T, val: '%v'", val, val)
		}
	}
	valBytes := pdk.ToBytes(vall)
	var data []byte

	// if you're expecting most of the mapping to already be done, this would be faster
	data, err = lft.valMap.Get(valBytes, &opt.ReadOptions{})
	if err != nil && err != leveldb.ErrNotFound {
		return 0, errors.Wrap(err, "trying to read value map")
	} else if err == nil {
		return binary.BigEndian.Uint64(data), nil
	}

	// else, val not found
	lft.lock.Lock(valBytes)
	defer lft.lock.Unlock(valBytes)
	// re-read after locking
	data, err = lft.valMap.Get(valBytes, &opt.ReadOptions{})
	if err != nil && err != leveldb.ErrNotFound {
		return 0, errors.Wrap(err, "trying to read value map")
	} else if err == nil {
		return binary.BigEndian.Uint64(data), nil
	}

	idBytes := make([]byte, 8)
	new := atomic.AddUint64(lft.curID, 1)
	binary.BigEndian.PutUint64(idBytes, new-1)
	err = lft.idMap.Put(idBytes, valBytes, &opt.WriteOptions{})
	if err != nil {
		return 0, errors.Wrap(err, "putting new id into idmap")
	}
	err = lft.valMap.Put(valBytes, idBytes, &opt.WriteOptions{})
	if err != nil {
		return 0, errors.Wrap(err, "putting new id into valmap")
	}
	return new - 1, nil
}
914839
func (p *PushEventCommit) GetID() string {
	if p == nil || p.ID == nil {
		return ""
	}
	return *p.ID
}
423417
func (s *Source) GetID() int64 {
	if s == nil || s.ID == nil {
		return 0
	}
	return *s.ID
}
1152025
func (p *PullRequestReview) GetID() int64 {
	if p == nil || p.ID == nil {
		return 0
	}
	return *p.ID
}
1210783
func (g *Grant) GetID() int64 {
	if g == nil || g.ID == nil {
		return 0
	}
	return *g.ID
}
720157
func (s *GetScriptService) Id(id string) *GetScriptService {
	s.id = id
	return s
}
415592
func (p *PushEventRepository) GetID() int64 {
	if p == nil || p.ID == nil {
		return 0
	}
	return *p.ID
}
191755
func (s *ExistsService) Id(id string) *ExistsService {
	s.id = id
	return s
}
560289
func (i *Invitation) GetID() int64 {
	if i == nil || i.ID == nil {
		return 0
	}
	return *i.ID
}
987810
func (c *Contributor) GetID() int64 {
	if c == nil || c.ID == nil {
		return 0
	}
	return *c.ID
}