Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 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()) |
||
|
|||
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 { |
||
30 | in := &SDK.GetSendQuotaInput{} |
||
31 | return in |
||
32 | } |
||
33 | |||
34 | type GetSendQuotaResult struct { |
||
35 | Max24HourSend float64 |
||
36 | MaxSendRate float64 |
||
37 | SentLast24Hours float64 |
||
38 | } |
||
39 | |||
40 | func NewGetSendQuotaResult(o *SDK.GetSendQuotaResponse) *GetSendQuotaResult { |
||
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 |