-
Notifications
You must be signed in to change notification settings - Fork 37
/
predicates.go
37 lines (28 loc) · 1.34 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
package locationbasedcapabilities
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type CapabilityPropertiesOperationPredicate struct {
FastProvisioningSupported *bool
GeoBackupSupported *bool
Status *string
ZoneRedundantHaAndGeoBackupSupported *bool
ZoneRedundantHaSupported *bool
}
func (p CapabilityPropertiesOperationPredicate) Matches(input CapabilityProperties) bool {
if p.FastProvisioningSupported != nil && (input.FastProvisioningSupported == nil || *p.FastProvisioningSupported != *input.FastProvisioningSupported) {
return false
}
if p.GeoBackupSupported != nil && (input.GeoBackupSupported == nil || *p.GeoBackupSupported != *input.GeoBackupSupported) {
return false
}
if p.Status != nil && (input.Status == nil || *p.Status != *input.Status) {
return false
}
if p.ZoneRedundantHaAndGeoBackupSupported != nil && (input.ZoneRedundantHaAndGeoBackupSupported == nil || *p.ZoneRedundantHaAndGeoBackupSupported != *input.ZoneRedundantHaAndGeoBackupSupported) {
return false
}
if p.ZoneRedundantHaSupported != nil && (input.ZoneRedundantHaSupported == nil || *p.ZoneRedundantHaSupported != *input.ZoneRedundantHaSupported) {
return false
}
return true
}