// SetTemplate sets the Template field's value.
769261
func (s *SendBulkTemplatedEmailInput) SetTemplate(v string) *SendBulkTemplatedEmailInput {
	s.Template = &v
	return s
}
569935
func (s *UpdateFunctionInput) SetResponseMappingTemplate(v string) *UpdateFunctionInput {
	s.ResponseMappingTemplate = &v
	return s
}
1095839
func (s *GetTemplateSummaryInput) SetTemplateBody(v string) *GetTemplateSummaryInput {
	s.TemplateBody = &v
	return s
}
65329
func (s *GetCustomVerificationEmailTemplateInput) SetTemplateName(v string) *GetCustomVerificationEmailTemplateInput {
	s.TemplateName = &v
	return s
}
492967
func (s *CreateChangeSetInput) SetTemplateURL(v string) *CreateChangeSetInput {
	s.TemplateURL = &v
	return s
}
17488
func SetTemplate(t *template.Template, name, filename string) error {

	// Read template
	buf, err := ioutil.ReadFile(filename)
	if err != nil {
		return err
	}

	// Update if exists
	if tt := t.Lookup(name); tt != nil {
		_, err = tt.Parse(string(buf))
		return err
	}

	// Allocate new name if not
	_, err = t.New(name).Parse(string(buf))
	return err
}
897381
func (s *UpdateProjectInput) SetPlacementTemplate(v *PlacementTemplate) *UpdateProjectInput {
	s.PlacementTemplate = v
	return s
}
213137
func (s *InputTransformer) SetInputTemplate(v string) *InputTransformer {
	s.InputTemplate = &v
	return s
}
1325546
func (r *Store) SetTemplate(ctx context.Context, name string, content []byte) error {
	_, store, name := r.getStore(ctx, name)
	return store.SetTemplate(ctx, name, content)
}
26373
func (s *Template) SetTemplateName(v string) *Template {
	s.TemplateName = &v
	return s
}
844460
func (s *UpdateEnvironmentInput) SetTemplateName(v string) *UpdateEnvironmentInput {
	s.TemplateName = &v
	return s
}
1082294
func (s *Job) SetJobTemplate(v string) *Job {
	s.JobTemplate = &v
	return s
}
37305
func (s *CreateCustomVerificationEmailTemplateInput) SetTemplateContent(v string) *CreateCustomVerificationEmailTemplateInput {
	s.TemplateContent = &v
	return s
}
24139
func (s *ValidateTemplateInput) SetTemplateBody(v string) *ValidateTemplateInput {
	s.TemplateBody = &v
	return s
}
1161071
func (s *Store) SetTemplate(ctx context.Context, name string, content []byte) error {
	p := s.templatefile(name)

	if err := s.storage.Set(ctx, p, content); err != nil {
		return errors.Wrapf(err, "failed to write template")
	}

	if err := s.rcs.Add(ctx, p); err != nil {
		if errors.Cause(err) == store.ErrGitNotInit {
			return nil
		}
		return errors.Wrapf(err, "failed to add '%s' to git", p)
	}

	if !ctxutil.IsGitCommit(ctx) {
		return nil
	}

	return s.gitCommitAndPush(ctx, name)
}
1089621
func (s *CreateStackSetInput) SetTemplateBody(v string) *CreateStackSetInput {
	s.TemplateBody = &v
	return s
}
87349
func (s *UpdateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *UpdateAutoScalingGroupInput {
	s.LaunchTemplate = v
	return s
}