Passed
Push — master ( b5915d...a6ac05 )
by eval
01:23
created

ses.*SES.DeleteTemplate   A

Complexity

Conditions 2

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 9
nop 2
dl 0
loc 11
rs 9.95
c 0
b 0
f 0
1
package ses
2
3
import (
4
	"context"
5
6
	SDK "github.com/aws/aws-sdk-go-v2/service/ses"
7
8
	"github.com/evalphobia/aws-sdk-go-v2-wrapper/errors"
9
	"github.com/evalphobia/aws-sdk-go-v2-wrapper/private/pointers"
10
)
11
12
// DeleteTemplate executes `DeleteTemplate` operation.
13
func (svc *SES) DeleteTemplate(ctx context.Context, r DeleteTemplateRequest) (*DeleteTemplateResult, error) {
14
	out, err := svc.RawDeleteTemplate(ctx, r.ToInput())
15
	if err != nil {
16
		err = svc.errWrap(errors.ErrorData{
17
			Err:          err,
18
			AWSOperation: "DeleteTemplate",
19
		})
20
		svc.Errorf(err.Error())
0 ignored issues
show
introduced by
can't check non-constant format in call to Errorf
Loading history...
21
		return nil, err
22
	}
23
	return NewDeleteTemplateResult(out), nil
24
}
25
26
// DeleteTemplateRequest has parameters for `DeleteTemplate` operation.
27
type DeleteTemplateRequest struct {
28
	TemplateName string
29
}
30
31
func (r DeleteTemplateRequest) ToInput() *SDK.DeleteTemplateInput {
0 ignored issues
show
introduced by
exported method DeleteTemplateRequest.ToInput should have comment or be unexported
Loading history...
32
	in := &SDK.DeleteTemplateInput{}
33
34
	if r.TemplateName != "" {
35
		in.TemplateName = pointers.String(r.TemplateName)
36
	}
37
	return in
38
}
39
40
type DeleteTemplateResult struct{}
0 ignored issues
show
introduced by
exported type DeleteTemplateResult should have comment or be unexported
Loading history...
41
42
func NewDeleteTemplateResult(o *SDK.DeleteTemplateResponse) *DeleteTemplateResult {
0 ignored issues
show
introduced by
exported function NewDeleteTemplateResult should have comment or be unexported
Loading history...
43
	result := &DeleteTemplateResult{}
44
	if o == nil {
45
		return result
46
	}
47
48
	return result
49
}
50