-
Notifications
You must be signed in to change notification settings - Fork 23
/
request_type.go
54 lines (46 loc) · 1.06 KB
/
request_type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package cloudtrail
import (
"time"
SDK "github.com/aws/aws-sdk-go/service/cloudtrail"
)
// LookupEventsInput is optional parameters for `LookupEvents`.
type LookupEventsInput struct {
StartTime time.Time
EndTime time.Time
MaxResults int64 // 1~50
EventCategory string
NextToken string
LookupAttributes []LookupAttribute
}
func (o LookupEventsInput) ToInput() *SDK.LookupEventsInput {
in := &SDK.LookupEventsInput{}
if !o.StartTime.IsZero() {
in.StartTime = &o.StartTime
}
if !o.EndTime.IsZero() {
in.EndTime = &o.EndTime
}
if o.MaxResults != 0 {
in.MaxResults = &o.MaxResults
}
if o.EventCategory != "" {
in.EventCategory = &o.EventCategory
}
if o.NextToken != "" {
in.NextToken = &o.NextToken
}
for _, v := range o.LookupAttributes {
in.LookupAttributes = append(in.LookupAttributes, v.ToSDKValue())
}
return in
}
type LookupAttribute struct {
Key string
Value string
}
func (a LookupAttribute) ToSDKValue() *SDK.LookupAttribute {
return &SDK.LookupAttribute{
AttributeKey: &a.Key,
AttributeValue: &a.Value,
}
}