// Enterprises retrieves the list of child Enterprises of the Me
427014
func (o *Me) Enterprises(info *bambou.FetchingInfo) (EnterprisesList, *bambou.Error) {

	var list EnterprisesList
	err := bambou.CurrentSession().FetchChildren(o, EnterpriseIdentity, &list, info)
	return list, err
}
1126928
func (o *Enterprise) NSGateways(info *bambou.FetchingInfo) (NSGatewaysList, *bambou.Error) {

	var list NSGatewaysList
	err := bambou.CurrentSession().FetchChildren(o, NSGatewayIdentity, &list, info)
	return list, err
}
471683
func (entity *AEDatastoreAdminOperation) FetchChildren(c context.Context) error {
	g := goon.FromContext(c)

	// AEBackupInformationList と AEBackupKindList の処理
	{
		var backupInfoList []*AEBackupInformation
		qb := newAEBackupInformationQueryBuilder().Ancestor(g.Key(entity))
		_, err := g.GetAll(qb.Query(), &backupInfoList)
		if err != nil {
			log.Infof(c, "on AEBackupInformation#GetAll: %s", err.Error())
			return err
		}
		for _, backupInfo := range backupInfoList {
			if backupInfo.ParentKey == nil || backupInfo.ParentKey.Incomplete() {
				// TODO うまく処理できるようになおす
				log.Infof(c, "on backupInfo.ParentKey == nil, %#v, %#v", entity, backupInfo)
				continue
			}
			err := backupInfo.FetchChildren(c)
			if err != nil {
				log.Infof(c, "on AEBackupInformation#FetchChildren: %s", err.Error())
				return err
			}
		}
		entity.AEBackupInformationList = backupInfoList
	}
	{
		var backupKindList []*AEBackupKind
		// AEBackupKind はDatastore上にEntityが存在しない
		// AEBackupInformationに存在するものが存在するのでは？というのも仮定
		for _, backupInfo := range entity.AEBackupInformationList {
			for _, kind := range backupInfo.Kinds {
				backupKind := &AEBackupKind{
					ParentKey: g.Key(backupInfo),
					ID:        kind,
				}
				err := backupKind.FetchChildren(c)
				if err != nil {
					return err
				}
				backupKindList = append(backupKindList, backupKind)
			}
		}
		entity.AEBackupKindList = backupKindList
	}

	return nil
}
248478
func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opt *ProjectListOptions) ([]*Project, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/projects", owner, repo)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept headers when APIs fully launch.
	req.Header.Set("Accept", mediaTypeProjectsPreview)

	var projects []*Project
	resp, err := s.client.Do(ctx, req, &projects)
	if err != nil {
		return nil, resp, err
	}

	return projects, resp, nil
}
486910
func (o *Enterprise) IKECertificates(info *bambou.FetchingInfo) (IKECertificatesList, *bambou.Error) {

	var list IKECertificatesList
	err := bambou.CurrentSession().FetchChildren(o, IKECertificateIdentity, &list, info)
	return list, err
}
1087385
func (o *Enterprise) AllAlarms(info *bambou.FetchingInfo) (AllAlarmsList, *bambou.Error) {

	var list AllAlarmsList
	err := bambou.CurrentSession().FetchChildren(o, AllAlarmIdentity, &list, info)
	return list, err
}
374162
func (gce *Cloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error) {
	// TODO: use PageToken to list all not just the first 500
	return gce.service.InstanceGroups.List(gce.projectID, zone).Do()
}
569867
func (image *Image) ListChildren() (pools []string, images []string, err error) {
	if image.image == nil {
		return nil, nil, RbdErrorImageNotOpen
	}

	var c_pools_len, c_images_len C.size_t

	ret := C.rbd_list_children(image.image,
		nil, &c_pools_len,
		nil, &c_images_len)
	if ret == 0 {
		return nil, nil, nil
	}
	if ret < 0 && ret != -C.ERANGE {
		return nil, nil, RBDError(ret)
	}

	pools_buf := make([]byte, c_pools_len)
	images_buf := make([]byte, c_images_len)

	ret = C.rbd_list_children(image.image,
		(*C.char)(unsafe.Pointer(&pools_buf[0])),
		&c_pools_len,
		(*C.char)(unsafe.Pointer(&images_buf[0])),
		&c_images_len)
	if ret < 0 {
		return nil, nil, RBDError(ret)
	}

	tmp := bytes.Split(pools_buf[:c_pools_len-1], []byte{0})
	for _, s := range tmp {
		if len(s) > 0 {
			name := C.GoString((*C.char)(unsafe.Pointer(&s[0])))
			pools = append(pools, name)
		}
	}

	tmp = bytes.Split(images_buf[:c_images_len-1], []byte{0})
	for _, s := range tmp {
		if len(s) > 0 {
			name := C.GoString((*C.char)(unsafe.Pointer(&s[0])))
			images = append(images, name)
		}
	}

	return pools, images, nil
}
1060860
func (entity *AEBackupInformationKindTypeInfo) FetchChildren(c context.Context) error {
	entityTypeInfo := &AEBackupEntityTypeInfo{}
	err := json.Unmarshal([]byte(entity.EntityTypeInfo), entityTypeInfo)
	if err != nil {
		g := goon.FromContext(c)
		key := g.Key(entity)
		log.Infof(c, "on AEBackupInformationKindTypeInfo#FetchChildren json.Unmarshal, key: %s, %s", key.String(), entity.EntityTypeInfo)
		return err
	}
	entity.EntityTypeInfoJSON = entityTypeInfo

	return nil
}
1079519
func (o *L2Domain) Applications(info *bambou.FetchingInfo) (ApplicationsList, *bambou.Error) {

	var list ApplicationsList
	err := bambou.CurrentSession().FetchChildren(o, ApplicationIdentity, &list, info)
	return list, err
}
232977
func (o *Enterprise) RoutingPolicies(info *bambou.FetchingInfo) (RoutingPoliciesList, *bambou.Error) {

	var list RoutingPoliciesList
	err := bambou.CurrentSession().FetchChildren(o, RoutingPolicyIdentity, &list, info)
	return list, err
}
170384
func (sd *StorageGroupDefinition) IterateStores(it StoreIterator) error {
	if sd == nil {
		return nil
	}
	if sd.RelationalStores != nil {
		names := make([]string, len(sd.RelationalStores))
		i := 0
		for n := range sd.RelationalStores {
			names[i] = n
			i++
		}
		sort.Strings(names)
		for _, n := range names {
			if err := it(sd.RelationalStores[n]); err != nil {
				return err
			}
		}
	}
	return nil
}
1206693
func (c *ZkConn) Children(ctx context.Context, path string) (children []string, stat *zk.Stat, err error) {
	err = c.withRetry(ctx, func(conn *zk.Conn) error {
		children, stat, err = conn.Children(path)
		return err
	})
	return
}
1031451
func (o *Me) VCenters(info *bambou.FetchingInfo) (VCentersList, *bambou.Error) {

	var list VCentersList
	err := bambou.CurrentSession().FetchChildren(o, VCenterIdentity, &list, info)
	return list, err
}
335717
func (sd StorageGroupDefinition) Children() []dslengine.Definition {
	var stores []dslengine.Definition
	for _, s := range sd.RelationalStores {
		stores = append(stores, s)
	}
	return stores
}
430861
func (o *ObjectList) Children() *ObjectList {
	var result ObjectList
	for _, item := range o.Items {
		if len(item.Keys) > 0 {
			result.Add(item)
		}
	}

	return &result
}
708363
func (f RelationalModelDefinition) Children() []dslengine.Definition {
	var stores []dslengine.Definition
	for _, s := range f.RelationalFields {
		stores = append(stores, s)
	}
	return stores
}