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

ses.NewGetSendQuotaResult   A

Complexity

Conditions 5

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 11
nop 1
dl 0
loc 16
rs 9.3333
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
// GetSendQuota executes `GetSendQuota` operation.
12
func (svc *SES) GetSendQuota(ctx context.Context, r GetSendQuotaRequest) (*GetSendQuotaResult, error) {
13
	out, err := svc.RawGetSendQuota(ctx, r.ToInput())
14
	if err != nil {
15
		err = svc.errWrap(errors.ErrorData{
16
			Err:          err,
17
			AWSOperation: "GetSendQuota",
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 NewGetSendQuotaResult(out), nil
23
}
24
25
// GetSendQuotaRequest has parameters for `GetSendQuota` operation.
26
type GetSendQuotaRequest struct {
27
}
28
29
func (r GetSendQuotaRequest) ToInput() *SDK.GetSendQuotaInput {
0 ignored issues
show
introduced by
exported method GetSendQuotaRequest.ToInput should have comment or be unexported
Loading history...
30
	in := &SDK.GetSendQuotaInput{}
31
	return in
32
}
33
34
type GetSendQuotaResult struct {
0 ignored issues
show
introduced by
exported type GetSendQuotaResult should have comment or be unexported
Loading history...
35
	Max24HourSend   float64
36
	MaxSendRate     float64
37
	SentLast24Hours float64
38
}
39
40
func NewGetSendQuotaResult(o *SDK.GetSendQuotaResponse) *GetSendQuotaResult {
0 ignored issues
show
introduced by
exported function NewGetSendQuotaResult should have comment or be unexported
Loading history...
41
	result := &GetSendQuotaResult{}
42
	if o == nil {
43
		return result
44
	}
45
46
	if o.Max24HourSend != nil {
47
		result.Max24HourSend = *o.Max24HourSend
48
	}
49
	if o.MaxSendRate != nil {
50
		result.MaxSendRate = *o.MaxSendRate
51
	}
52
	if o.SentLast24Hours != nil {
53
		result.SentLast24Hours = *o.SentLast24Hours
54
	}
55
	return result
56
}
57