-
Notifications
You must be signed in to change notification settings - Fork 17
/
NumericConditions.go
62 lines (59 loc) · 2.42 KB
/
NumericConditions.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
55
56
57
58
59
60
61
package awssns
// Conditions that can be applied to numeric attributes.
//
// Example:
// import lambda "github.com/aws/aws-cdk-go/awscdk"
// var fn function
//
//
// myTopic := sns.NewTopic(this, jsii.String("MyTopic"))
//
// // Lambda should receive only message matching the following conditions on attributes:
// // color: 'red' or 'orange' or begins with 'bl'
// // size: anything but 'small' or 'medium'
// // price: between 100 and 200 or greater than 300
// // store: attribute must be present
// myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{
// FilterPolicy: map[string]subscriptionFilter{
// "color": sns.*subscriptionFilter_stringFilter(&StringConditions{
// "allowlist": []*string{
// jsii.String("red"),
// jsii.String("orange"),
// },
// "matchPrefixes": []*string{
// jsii.String("bl"),
// },
// }),
// "size": sns.*subscriptionFilter_stringFilter(&StringConditions{
// "denylist": []*string{
// jsii.String("small"),
// jsii.String("medium"),
// },
// }),
// "price": sns.*subscriptionFilter_numericFilter(&NumericConditions{
// "between": &BetweenCondition{
// "start": jsii.Number(100),
// "stop": jsii.Number(200),
// },
// "greaterThan": jsii.Number(300),
// }),
// "store": sns.*subscriptionFilter_existsFilter(),
// },
// }))
//
type NumericConditions struct {
// Match one or more values.
Allowlist *[]*float64 `field:"optional" json:"allowlist" yaml:"allowlist"`
// Match values that are between the specified values.
Between *BetweenCondition `field:"optional" json:"between" yaml:"between"`
// Match values that are strictly between the specified values.
BetweenStrict *BetweenCondition `field:"optional" json:"betweenStrict" yaml:"betweenStrict"`
// Match values that are greater than the specified value.
GreaterThan *float64 `field:"optional" json:"greaterThan" yaml:"greaterThan"`
// Match values that are greater than or equal to the specified value.
GreaterThanOrEqualTo *float64 `field:"optional" json:"greaterThanOrEqualTo" yaml:"greaterThanOrEqualTo"`
// Match values that are less than the specified value.
LessThan *float64 `field:"optional" json:"lessThan" yaml:"lessThan"`
// Match values that are less than or equal to the specified value.
LessThanOrEqualTo *float64 `field:"optional" json:"lessThanOrEqualTo" yaml:"lessThanOrEqualTo"`
}