1+ // Copyright 2025 Google LLC
2+ // Copyright 2025 Yusuke Fredrick Tsutsumi
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS,
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+
16+ syntax = "proto3" ;
17+
18+ package aep.api ;
19+
20+ option cc_enable_arenas = true ;
21+ option java_multiple_files = true ;
22+ option java_outer_classname = "FieldBehaviorProto" ;
23+ option java_package = "dev.aep.api" ;
24+ option objc_class_prefix = "AEP" ;
25+
26+ // An indicator of the behavior of a given field (for example, that a field
27+ // is required in requests, or given as output but ignored as input).
28+ // This **does not** change the behavior in protocol buffers itself; it only
29+ // denotes the behavior and may affect how API tooling handles the field.
30+ //
31+ // Note: This enum **may** receive new values in the future.
32+ enum FieldBehavior {
33+ // Conventional default for enums. Do not use this.
34+ FIELD_BEHAVIOR_UNSPECIFIED = 0 ;
35+
36+ // Specifically denotes a field as optional.
37+ // While all fields in protocol buffers are optional, this may be specified
38+ // for emphasis if appropriate.
39+ OPTIONAL = 1 ;
40+
41+ // Denotes a field as required.
42+ // This indicates that the field **must** be provided as part of the request,
43+ // and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
44+ REQUIRED = 2 ;
45+
46+ // Denotes a field as output only.
47+ // This indicates that the field is provided in responses, but including the
48+ // field in a request does nothing (the server *must* ignore it and
49+ // *must not* throw an error as a result of the field's presence).
50+ OUTPUT_ONLY = 3 ;
51+
52+ // Denotes a field as input only.
53+ // This indicates that the field is provided in requests, and the
54+ // corresponding field is not included in output.
55+ INPUT_ONLY = 4 ;
56+
57+ // Denotes a field as immutable.
58+ // This indicates that the field may be set once in a request to create a
59+ // resource, but may not be changed thereafter.
60+ IMMUTABLE = 5 ;
61+
62+ // Denotes that a (repeated) field is an unordered list.
63+ // This indicates that the service may provide the elements of the list
64+ // in any arbitrary order, rather than the order the user originally
65+ // provided. Additionally, the list's order may or may not be stable.
66+ UNORDERED_LIST = 6 ;
67+
68+ // Denotes that this field returns a non-empty default value if not set.
69+ // This indicates that if the user provides the empty value in a request,
70+ // a non-empty value will be returned. The user will not be aware of what
71+ // non-empty value to expect.
72+ NON_EMPTY_DEFAULT = 7 ;
73+ }
0 commit comments