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

ses.NewCreateTemplateResult   A

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nop 1
dl 0
loc 7
rs 10
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
)
10
11
// CreateTemplate executes `CreateTemplate` operation.
12
func (svc *SES) CreateTemplate(ctx context.Context, r CreateTemplateRequest) (*CreateTemplateResult, error) {
13
	out, err := svc.RawCreateTemplate(ctx, r.ToInput())
14
	if err != nil {
15
		err = svc.errWrap(errors.ErrorData{
16
			Err:          err,
17
			AWSOperation: "CreateTemplate",
18
		})
19
		svc.Errorf(err.Error())
0 ignored issues
show
introduced by
can't check non-constant format in call to Errorf
Loading history...
20
		return nil, err
21
	}
22
	return NewCreateTemplateResult(out), nil
23
}
24
25
// CreateTemplateRequest has parameters for `CreateTemplate` operation.
26
type CreateTemplateRequest struct {
27
	Template Template
28
}
29
30
func (r CreateTemplateRequest) ToInput() *SDK.CreateTemplateInput {
0 ignored issues
show
introduced by
exported method CreateTemplateRequest.ToInput should have comment or be unexported
Loading history...
31
	in := &SDK.CreateTemplateInput{}
32
33
	in.Template = r.Template.ToSDK()
34
	return in
35
}
36
37
type CreateTemplateResult struct{}
0 ignored issues
show
introduced by
exported type CreateTemplateResult should have comment or be unexported
Loading history...
38
39
func NewCreateTemplateResult(o *SDK.CreateTemplateResponse) *CreateTemplateResult {
0 ignored issues
show
introduced by
exported function NewCreateTemplateResult should have comment or be unexported
Loading history...
40
	result := &CreateTemplateResult{}
41
	if o == nil {
42
		return result
43
	}
44
45
	return result
46
}
47