//List all templates for the current environment. Can use options to do sorting and paging.
195067
func (templateApi *TemplateApi) ListWithOptions(options map[string]string) ([]Template, error) {
	data, err := templateApi.entityService.List(options)
	if err != nil {
		return nil, err
	}
	return parseTemplateList(data), nil
}
758575
func (o *L2Domain) EgressACLTemplates(info *bambou.FetchingInfo) (EgressACLTemplatesList, *bambou.Error) {

	var list EgressACLTemplatesList
	err := bambou.CurrentSession().FetchChildren(o, EgressACLTemplateIdentity, &list, info)
	return list, err
}
3887
func (f *Registry) List() []Description {
	names := make([]string, 0, len(f.facades))
	for name := range f.facades {
		names = append(names, name)
	}
	sort.Strings(names)
	descriptions := make([]Description, 0, len(f.facades))
	for _, name := range names {
		facades := f.facades[name]
		description := descriptionFromVersions(name, facades)
		if len(description.Versions) > 0 {
			descriptions = append(descriptions, description)
		}
	}
	return descriptions
}
1334638
func (t *Template) WithEnvS(envs []string) *Template {
	var result = map[string]string{}
	for _, env := range envs {
		var parts = strings.SplitN(env, "=", 2)
		result[parts[0]] = parts[1]
	}
	return t.WithEnv(result)
}
305520
func loadTemplateEnv(tmpls []*structs.Template, taskDir string, taskEnv *taskenv.TaskEnv) (map[string]string, error) {
	all := make(map[string]string, 50)
	for _, t := range tmpls {
		if !t.Envvars {
			continue
		}

		dest := filepath.Join(taskDir, taskEnv.ReplaceEnv(t.DestPath))
		f, err := os.Open(dest)
		if err != nil {
			return nil, fmt.Errorf("error opening env template: %v", err)
		}
		defer f.Close()

		// Parse environment fil
		vars, err := envparse.Parse(f)
		if err != nil {
			return nil, fmt.Errorf("error parsing env template %q: %v", dest, err)
		}
		for k, v := range vars {
			all[k] = v
		}
	}
	return all, nil
}
1365934
func (s *TemplatesService) ListTemplateRecords(accountID string, templateIdentifier string, options *ListOptions) (*templateRecordsResponse, error) {
	path := versioned(templateRecordPath(accountID, templateIdentifier, 0))
	templateRecordsResponse := &templateRecordsResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.get(path, templateRecordsResponse)
	if err != nil {
		return templateRecordsResponse, err
	}

	templateRecordsResponse.HttpResponse = resp
	return templateRecordsResponse, nil
}
11103
func (c *Client) ListTemplates(p *ListTemplatesParameter) ([]*Template, error) {
	obj, err := c.Request("listTemplates", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Template), err
}
508715
func (r *GormBoardRepository) List(ctx context.Context, spaceTemplateID uuid.UUID) ([]*Board, error) {
	log.Debug(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "loading work item boards for space template")
	// check space template exists
	if err := spacetemplate.NewRepository(r.db).CheckExists(ctx, spaceTemplateID); err != nil {
		return nil, errors.NewNotFoundError("space template", spaceTemplateID.String())
	}
	res := []*Board{}
	db := r.db.Model(&res).Where("space_template_id=?", spaceTemplateID).Order("name ASC").Find(&res)
	if db.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "work item boards not found")
		return nil, errors.NewNotFoundError("work item boards for space template", spaceTemplateID.String())
	}
	if err := db.Error; err != nil {
		return nil, errors.NewInternalError(ctx, err)
	}
	for _, board := range res {
		columns, err := r.loadColumns(ctx, board.ID)
		if err != nil {
			return nil, errs.Wrapf(err, "failed to load columns for board with ID %s", board.ID)
		}
		board.Columns = columns
	}
	return res, nil
}
82611
func (m *MockIndex) Templates(arg0 template.CSS, arg1 template0.FuncMap) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Templates", arg0, arg1)
}
986258
func (s *TemplatesService) ListTemplates(accountID string, options *ListOptions) (*templatesResponse, error) {
	path := versioned(templatePath(accountID, ""))
	templatesResponse := &templatesResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.get(path, templatesResponse)
	if err != nil {
		return templatesResponse, err
	}

	templatesResponse.HttpResponse = resp
	return templatesResponse, nil
}
292582
func (mp ModelPayloads) ListAll() ([]payload.FullPayloadInfo, error) {
	coll, closer := mp.db.GetCollection(payloadsC)
	defer closer()

	var docs []payloadDoc
	if err := coll.Find(nil).All(&docs); err != nil {
		return nil, errors.Trace(err)
	}
	return nsPayloads.asPayloads(docs), nil
}
1120413
func (r *GormWorkItemTypeGroupRepository) List(ctx context.Context, spaceTemplateID uuid.UUID) ([]*WorkItemTypeGroup, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitemtypegroup", "list"}, time.Now())
	log.Debug(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "loading work item type groups for space template")

	// check space template exists
	if err := spacetemplate.NewRepository(r.db).CheckExists(ctx, spaceTemplateID); err != nil {
		return nil, errors.NewNotFoundError("space template", spaceTemplateID.String())
	}

	res := []*WorkItemTypeGroup{}
	db := r.db.Model(&res).Where("space_template_id=?", spaceTemplateID).Order("position ASC").Find(&res)
	if db.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "work item type groups not found")
		return nil, errors.NewNotFoundError("work item type groups for space template", spaceTemplateID.String())
	}
	if err := db.Error; err != nil {
		return nil, errors.NewInternalError(ctx, err)
	}
	for _, group := range res {
		typeList, err := r.loadTypeList(ctx, group.ID)
		if err != nil {
			return nil, errs.WithStack(err)
		}
		group.TypeList = typeList
	}
	return res, nil
}
934301
func NewListTemplate() ListTemplate {
	return ListTemplate{
		GenericTemplate: GenericTemplate{
			TemplateBase: TemplateBase{
				Type: "list",
			},
			Elements: []Element{},
		},
		TopElementStyle: "large",
	}
}
571041
func LoadCustomTemplates(dir string) error {
	initEmptyTmpls()

	files, err := ioutil.ReadDir(dir)
	if err != nil {
		return fmt.Errorf("ioutil.ReadDir: %v", err)
	}

	templateFiles := []string{}
	for _, f := range files {
		templateFiles = append(templateFiles, path.Join(dir, f.Name()))
	}
	tmpls, err = tmpls.ParseFiles(templateFiles...)
	if err != nil {
		return fmt.Errorf("tmpls.ParseFiles: %v", err)
	}
	return nil
}
1265833
func (mg *MailgunImpl) ListTemplateVersions(templateName string, opts *ListOptions) *TemplateVersionsIterator {
	r := newHTTPRequest(generateApiUrl(mg, templatesEndpoint) + "/" + templateName + "/versions")
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	if opts != nil {
		if opts.Limit != 0 {
			r.addParameter("limit", strconv.Itoa(opts.Limit))
		}
	}
	url, err := r.generateUrlWithParameters()
	return &TemplateVersionsIterator{
		mg:                      mg,
		templateVersionListResp: templateVersionListResp{Paging: Paging{Next: url, First: url}},
		err:                     err,
	}
}
670242
func (o *DomainFIPAclTemplate) DomainFIPAclTemplateEntries(info *bambou.FetchingInfo) (DomainFIPAclTemplateEntriesList, *bambou.Error) {

	var list DomainFIPAclTemplateEntriesList
	err := bambou.CurrentSession().FetchChildren(o, DomainFIPAclTemplateEntryIdentity, &list, info)
	return list, err
}
770537
func Template() (c *TemplateController) {
	return &TemplateController{
		List:   templateList,
		New:    templateNew,
		Create: templateCreate,
		Edit:   templateEdit,
		Update: templateUpdate,
		Delete: templateDelete,
	}
}