// GetAllTemplates returns all templates
498876
func (p *Plugin) GetAllTemplates() ([]*process.Template, error) {
	if p.tReader == nil {
		return nil, errors.Errorf("cannot read process templates: reader is nil (no path was defined)")
	}
	return p.tReader.GetAllTemplates()
}
659854
func (c *Client) IndexGetTemplate(names ...string) *IndicesGetTemplateService {
	return NewIndicesGetTemplateService(c).Name(names...)
}
904292
func GetAll() map[Kind][]Plugin {
	plugins := pluginGlobal.plugins()
	if plugins == nil {
		return nil
	}
	return plugins.plugins
}
1170897
func (t *LaunchTemplate) findAllLaunchTemplates(c *fi.Context) ([]*ec2.LaunchTemplate, error) {
	var list []*ec2.LaunchTemplate

	cloud := c.Cloud.(awsup.AWSCloud)

	var next *string
	for {
		resp, err := cloud.EC2().DescribeLaunchTemplates(&ec2.DescribeLaunchTemplatesInput{
			NextToken: next,
		})
		if err != nil {
			return nil, err
		}
		for _, x := range resp.LaunchTemplates {
			list = append(list, x)
		}

		if resp.NextToken == nil {
			return list, nil
		}
		next = resp.NextToken
	}
}
986050
func (api *ImagesAPI) GetAll(options *ImageGetOptions) (images *Images, err error) {
	uri := api.client.Endpoint + imageUrl
	if options != nil {
		uri += getQueryString(options)
	}
	res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
	if err != nil {
		return
	}

	images = &Images{}
	err = json.Unmarshal(res, images)
	return
}
851929
func (s *Server) GetServiceTemplates(unused struct{}, response *map[string]servicetemplate.ServiceTemplate) error  {
	templates, err := s.f.GetServiceTemplates(s.context())
	if err != nil {
		return err
	}
	*response = templates
	return nil
}
993102
func RestoreTemplates(stateDir string) error {
	// Simplest implementation: Just garbage-collect everything.
	// In future we should make this smarter.
	path := filepath.Join(stateDir, defaults.TemplatesDir)
	err := os.RemoveAll(path)
	if err == nil || os.IsNotExist(err) {
		return nil
	}
	return &os.PathError{
		Op:   "failed to remove old BPF templates",
		Path: path,
		Err:  err,
	}
}
476462
func (o *Me) EgressAdvFwdEntryTemplates(info *bambou.FetchingInfo) (EgressAdvFwdEntryTemplatesList, *bambou.Error) {

	var list EgressAdvFwdEntryTemplatesList
	err := bambou.CurrentSession().FetchChildren(o, EgressAdvFwdEntryTemplateIdentity, &list, info)
	return list, err
}
1021162
func (t *Mux) ParseTemplates() error {
	t.mutex.Lock()
	defer t.mutex.Unlock()

	for _, h := range t.handlers {
		set := h.handler().Templates()
		err := set.union(t.GlobalTemplates)

		if err != nil {
			return err
		}

		err = set.parse(t.leftDelim, t.rightDelim)

		if err != nil {
			return err
		}

		h.templates = set
	}

	return nil
}
892175
func (r *Response) GenericTemplate(elements *[]StructuredMessageElement, messagingType MessagingType, tags ...string) error {
	var tag string
	if len(tags) > 0 {
		tag = tags[0]
	}

	m := SendStructuredMessage{
		MessagingType: messagingType,
		Recipient:     r.to,
		Message: StructuredMessageData{
			Attachment: StructuredMessageAttachment{
				Type: "template",
				Payload: StructuredMessagePayload{
					TemplateType: "generic",
					Buttons:      nil,
					Elements:     elements,
				},
			},
		},
		Tag: tag,
	}
	return r.DispatchMessage(&m)
}
669128
func (t *Template) GetAllAWSSESTemplateResources() map[string]*resources.AWSSESTemplate {
	results := map[string]*resources.AWSSESTemplate{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSSESTemplate:
			results[name] = resource
		}
	}
	return results
}
851419
func (a *Client) GetTemplatesLibrary(params *GetTemplatesLibraryParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplatesLibraryOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetTemplatesLibraryParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetTemplatesLibrary",
		Method:             "GET",
		PathPattern:        "/templates/library",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetTemplatesLibraryReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetTemplatesLibraryOK), nil
}
1361703
func (r Resource_Group) GetTemplate() (resp datatypes.Resource_Group_Template, err error) {
	err = r.Session.DoRequest("SoftLayer_Resource_Group", "getTemplate", nil, &r.Options, &resp)
	return
}
721906
func gatherTemplates(o *Config, outFileNamer func(string) (string, error)) (templates []*tplate, err error) {
	o.defaults()
	mode, modeOverride, err := o.getMode()
	if err != nil {
		return nil, err
	}

	// the arg-provided input string gets a special name
	if o.Input != "" {
		templates = []*tplate{{
			name:         "<arg>",
			contents:     o.Input,
			mode:         mode,
			modeOverride: modeOverride,
			targetPath:   o.OutputFiles[0],
		}}
	} else if o.InputDir != "" {
		// input dirs presume output dirs are set too
		templates, err = walkDir(o.InputDir, outFileNamer, o.ExcludeGlob, mode, modeOverride)
		if err != nil {
			return nil, err
		}
	} else if o.Input == "" {
		templates = make([]*tplate, len(o.InputFiles))
		for i := range o.InputFiles {
			templates[i], err = fileToTemplates(o.InputFiles[i], o.OutputFiles[i], mode, modeOverride)
			if err != nil {
				return nil, err
			}
		}
	}

	return processTemplates(templates)
}
946137
func (s *Store) ListTemplates(ctx context.Context, prefix string) []string {
	lst, err := s.storage.List(ctx, "")
	if err != nil {
		out.Debug(ctx, "failed to list templates: %s", err)
		return nil
	}
	tpls := make(map[string]struct{}, len(lst))
	for _, path := range lst {
		if !strings.HasSuffix(path, TemplateFile) {
			continue
		}
		path = strings.TrimSuffix(path, sep+TemplateFile)
		if prefix != "" {
			path = prefix + sep + path
		}
		tpls[path] = struct{}{}
	}
	out := make([]string, 0, len(tpls))
	for k := range tpls {
		out = append(out, k)
	}
	sort.Strings(out)
	return out
}
823757
func (t *LaunchTemplate) findAllLaunchTemplatesVersions(c *fi.Context) ([]*ec2.LaunchTemplateVersion, error) {
	var list []*ec2.LaunchTemplateVersion

	cloud, ok := c.Cloud.(awsup.AWSCloud)
	if !ok {
		return []*ec2.LaunchTemplateVersion{}, fmt.Errorf("invalid cloud provider: %v, expected: awsup.AWSCloud", c.Cloud)
	}

	templates, err := t.findAllLaunchTemplates(c)
	if err != nil {
		return nil, err
	}

	var next *string
	for _, x := range templates {
		err := func() error {
			for {
				resp, err := cloud.EC2().DescribeLaunchTemplateVersions(&ec2.DescribeLaunchTemplateVersionsInput{
					LaunchTemplateName: x.LaunchTemplateName,
					NextToken:          next,
				})
				if err != nil {
					return err
				}
				for _, x := range resp.LaunchTemplateVersions {
					list = append(list, x)
				}
				if resp.NextToken == nil {
					return nil
				}

				next = resp.NextToken
			}
		}()
		if err != nil {
			return nil, err
		}
	}

	return list, nil
}
27479
func WithTemplates(b *Bundle) router.Middleware {
	return func(c *router.Context, next router.Handler) {
		// Note: Use(...) calls EnsureLoaded and initializes b.err inside.
		c.Context = Use(c.Context, b, &Extra{
			Request: c.Request,
			Params:  c.Params,
		})
		if b.err != nil {
			http.Error(c.Writer, fmt.Sprintf("Can't load HTML templates.\n%s", b.err), http.StatusInternalServerError)
			return
		}
		next(c)
	}
}