-
Notifications
You must be signed in to change notification settings - Fork 37
/
predicates.go
72 lines (56 loc) · 2.02 KB
/
predicates.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
62
63
64
65
66
67
68
69
70
71
72
package tenantactivitylogs
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type EventDataOperationPredicate struct {
Caller *string
CorrelationId *string
Description *string
EventDataId *string
EventTimestamp *string
Id *string
OperationId *string
ResourceGroupName *string
ResourceId *string
SubmissionTimestamp *string
SubscriptionId *string
TenantId *string
}
func (p EventDataOperationPredicate) Matches(input EventData) bool {
if p.Caller != nil && (input.Caller == nil || *p.Caller != *input.Caller) {
return false
}
if p.CorrelationId != nil && (input.CorrelationId == nil || *p.CorrelationId != *input.CorrelationId) {
return false
}
if p.Description != nil && (input.Description == nil || *p.Description != *input.Description) {
return false
}
if p.EventDataId != nil && (input.EventDataId == nil || *p.EventDataId != *input.EventDataId) {
return false
}
if p.EventTimestamp != nil && (input.EventTimestamp == nil || *p.EventTimestamp != *input.EventTimestamp) {
return false
}
if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) {
return false
}
if p.OperationId != nil && (input.OperationId == nil || *p.OperationId != *input.OperationId) {
return false
}
if p.ResourceGroupName != nil && (input.ResourceGroupName == nil || *p.ResourceGroupName != *input.ResourceGroupName) {
return false
}
if p.ResourceId != nil && (input.ResourceId == nil || *p.ResourceId != *input.ResourceId) {
return false
}
if p.SubmissionTimestamp != nil && (input.SubmissionTimestamp == nil || *p.SubmissionTimestamp != *input.SubmissionTimestamp) {
return false
}
if p.SubscriptionId != nil && (input.SubscriptionId == nil || *p.SubscriptionId != *input.SubscriptionId) {
return false
}
if p.TenantId != nil && (input.TenantId == nil || *p.TenantId != *input.TenantId) {
return false
}
return true
}