xref: /aosp_15_r20/external/grpc-grpc-java/xds/third_party/envoy/src/main/proto/envoy/type/matcher/v3/value.proto (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1syntax = "proto3";
2
3package envoy.type.matcher.v3;
4
5import "envoy/type/matcher/v3/number.proto";
6import "envoy/type/matcher/v3/string.proto";
7
8import "udpa/annotations/status.proto";
9import "udpa/annotations/versioning.proto";
10import "validate/validate.proto";
11
12option java_package = "io.envoyproxy.envoy.type.matcher.v3";
13option java_outer_classname = "ValueProto";
14option java_multiple_files = true;
15option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
16option (udpa.annotations.file_status).package_version_status = ACTIVE;
17
18// [#protodoc-title: Value matcher]
19
20// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported.
21// StructValue is not supported and is always not matched.
22// [#next-free-field: 7]
23message ValueMatcher {
24  option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.ValueMatcher";
25
26  // NullMatch is an empty message to specify a null value.
27  message NullMatch {
28    option (udpa.annotations.versioning).previous_message_type =
29        "envoy.type.matcher.ValueMatcher.NullMatch";
30  }
31
32  // Specifies how to match a value.
33  oneof match_pattern {
34    option (validate.required) = true;
35
36    // If specified, a match occurs if and only if the target value is a NullValue.
37    NullMatch null_match = 1;
38
39    // If specified, a match occurs if and only if the target value is a double value and is
40    // matched to this field.
41    DoubleMatcher double_match = 2;
42
43    // If specified, a match occurs if and only if the target value is a string value and is
44    // matched to this field.
45    StringMatcher string_match = 3;
46
47    // If specified, a match occurs if and only if the target value is a bool value and is equal
48    // to this field.
49    bool bool_match = 4;
50
51    // If specified, value match will be performed based on whether the path is referring to a
52    // valid primitive value in the metadata. If the path is referring to a non-primitive value,
53    // the result is always not matched.
54    bool present_match = 5;
55
56    // If specified, a match occurs if and only if the target value is a list value and
57    // is matched to this field.
58    ListMatcher list_match = 6;
59  }
60}
61
62// Specifies the way to match a list value.
63message ListMatcher {
64  option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.ListMatcher";
65
66  oneof match_pattern {
67    option (validate.required) = true;
68
69    // If specified, at least one of the values in the list must match the value specified.
70    ValueMatcher one_of = 1;
71  }
72}
73