// Lists all children domains belonging to a specified domain
971573
func (s *DomainService) ListDomainChildren(p *ListDomainChildrenParams) (*ListDomainChildrenResponse, error) {
	resp, err := s.cs.newRequest("listDomainChildren", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListDomainChildrenResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
159983
func (tn *TreeNode) Children() map[string]*TreeNode {
	tn.RLock()
	defer tn.RUnlock()
	children := make(map[string]*TreeNode, len(tn.children))
	for k, v := range tn.children {
		children[k] = v
	}
	return children
}
683479
func (o *Domain) ContainerInterfaces(info *bambou.FetchingInfo) (ContainerInterfacesList, *bambou.Error) {

	var list ContainerInterfacesList
	err := bambou.CurrentSession().FetchChildren(o, ContainerInterfaceIdentity, &list, info)
	return list, err
}
677065
func (d *DNS) GetDomainResources(domainID int) ([]*Resource, error) {
	params := linode.Parameters{
		"DomainID": strconv.Itoa(domainID),
	}

	var list []*Resource
	_, err := d.linode.Request("domain.resource.list", params, &list)
	if err != nil {
		return nil, err
	}
	return list, nil
}
1096282
func (o *WebCategory) AssignWebDomainNames(children WebDomainNamesList) *bambou.Error {

	list := []bambou.Identifiable{}
	for _, c := range children {
		list = append(list, c)
	}

	return bambou.CurrentSession().AssignChildren(o, list, WebDomainNameIdentity)
}
1151668
func (o *Domain) ForwardingPathLists(info *bambou.FetchingInfo) (ForwardingPathListsList, *bambou.Error) {

	var list ForwardingPathListsList
	err := bambou.CurrentSession().FetchChildren(o, ForwardingPathListIdentity, &list, info)
	return list, err
}
262027
func (api *Client) GetDomains(query ...*GetDomainsQuery) ([]*Domain, error) {
	var options *GetDomainsQuery
	if len(query) > 0 {
		options = query[0]
	}
	result, _, err := api.makeRequest(http.MethodGet, api.concatUserPath(domainsPath), &[]*Domain{}, options)
	if err != nil {
		return nil, err
	}
	return *(result.(*[]*Domain)), nil
}
1025203
func (s *DomainsService) ListRecords(domainID string, recordName string) ([]Record, *Response, error) {
	path := recordAction("List")

	payload := newPayLoad(s.client.CommonParams)

	payload.Add("domain_id", domainID)

	if recordName != "" {
		payload.Add("sub_domain", recordName)
	}

	wrappedRecords := recordsWrapper{}

	res, err := s.client.post(path, payload, &wrappedRecords)
	if err != nil {
		return []Record{}, res, err
	}

	if wrappedRecords.Status.Code != "1" {
		return wrappedRecords.Records, nil, fmt.Errorf("Could not get domains: %s", wrappedRecords.Status.Message)
	}

	records := []Record{}
	for _, record := range wrappedRecords.Records {
		records = append(records, record)
	}

	return records, res, nil
}
15464
func (o *Domain) Domains(info *bambou.FetchingInfo) (DomainsList, *bambou.Error) {

	var list DomainsList
	err := bambou.CurrentSession().FetchChildren(o, DomainIdentity, &list, info)
	return list, err
}
1116982
func (d *DNS) GetDomains(domainId interface{}) ([]*Domain, error) {
	params := linode.Parameters{}
	if domainId != nil {
		id, ok := domainId.(int)
		if ok {
			params.Set("DomainID", strconv.Itoa(id))
		}
	}

	var list []*Domain
	_, err := d.linode.Request("domain.list", params, &list)
	if err != nil {
		return nil, err
	}
	return list, nil
}
1292984
func (m *GormAreaRepository) ListChildren(ctx context.Context, parentArea *Area) ([]Area, error) {
	defer goa.MeasureSince([]string{"goa", "db", "Area", "querychild"}, time.Now())
	var objs []Area

	tx := m.db.Where("path ~ ($1 || '.*{1}')::lquery", parentArea.Path.Convert()).Find(&objs)
	if tx.RecordNotFound() {
		return nil, errors.NewNotFoundError("Area", parentArea.ID.String())
	}
	if tx.Error != nil {
		return nil, errors.NewInternalError(ctx, tx.Error)
	}
	return objs, nil
}
361074
func (o *Domain) Links(info *bambou.FetchingInfo) (LinksList, *bambou.Error) {

	var list LinksList
	err := bambou.CurrentSession().FetchChildren(o, LinkIdentity, &list, info)
	return list, err
}
1285599
func (d *Domain) List() (domains []*InfoBase, err error) {
	_, err = d.Get("/domains", &domains)
	return
}
1143548
func (c *Client) ListDomains(p *ListDomainsParameter) ([]*Domain, error) {
	obj, err := c.Request("listDomains", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Domain), err
}
391558
func domains(db *gorm.DB, scope scope) ([]*Domain, error) {
	var domains []*Domain
	return domains, find(db, scope, &domains)
}
193738
func (org *Organization) Domains() ([]*Domain, error) {
	var d domainsResponse
	err := org.PPE.get(fmt.Sprintf("/domains/%s", org.PrimaryDomain), &d)
	if err != nil {
		return []*Domain{}, err
	}
	drs := d.Domains
	doms := make([]*Domain, len(org.domains))
	for _, dr := range drs {
		for i, dom := range org.domains {
			if dr.DomainName == dom {
				doms[i] = domainFromDomainResponse(org, dr)
			}
		}
	}
	return doms, nil
}
872318
func (c *ConfigEntry) ListAll(args *structs.DCSpecificRequest, reply *structs.IndexedGenericConfigEntries) error {
	if done, err := c.srv.forward("ConfigEntry.ListAll", args, args, reply); done {
		return err
	}
	defer metrics.MeasureSince([]string{"config_entry", "listAll"}, time.Now())

	// Fetch the ACL token, if any.
	rule, err := c.srv.ResolveToken(args.Token)
	if err != nil {
		return err
	}

	return c.srv.blockingQuery(
		&args.QueryOptions,
		&reply.QueryMeta,
		func(ws memdb.WatchSet, state *state.Store) error {
			index, entries, err := state.ConfigEntries(ws)
			if err != nil {
				return err
			}

			// Filter the entries returned by ACL permissions.
			filteredEntries := make([]structs.ConfigEntry, 0, len(entries))
			for _, entry := range entries {
				if rule != nil && !entry.CanRead(rule) {
					continue
				}
				filteredEntries = append(filteredEntries, entry)
			}

			reply.Entries = filteredEntries
			reply.Index = index
			return nil
		})
}