Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

feat: add new FieldBehavior NON_EMPTY_DEFAULT #191

Merged
merged 1 commit into from Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -116,6 +116,19 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum {
* <code>UNORDERED_LIST = 6;</code>
*/
UNORDERED_LIST(6),
/**
*
*
* <pre>
* Denotes that this field returns a non-empty default value if not set.
* This indicates that if the user provides the empty value in a request,
* a non-empty value will be returned. The user will not be aware of what
* non-empty value to expect.
* </pre>
*
* <code>NON_EMPTY_DEFAULT = 7;</code>
*/
NON_EMPTY_DEFAULT(7),
UNRECOGNIZED(-1),
;

Expand Down Expand Up @@ -203,6 +216,19 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum {
* <code>UNORDERED_LIST = 6;</code>
*/
public static final int UNORDERED_LIST_VALUE = 6;
/**
*
*
* <pre>
* Denotes that this field returns a non-empty default value if not set.
* This indicates that if the user provides the empty value in a request,
* a non-empty value will be returned. The user will not be aware of what
* non-empty value to expect.
* </pre>
*
* <code>NON_EMPTY_DEFAULT = 7;</code>
*/
public static final int NON_EMPTY_DEFAULT_VALUE = 7;

public final int getNumber() {
if (this == UNRECOGNIZED) {
Expand Down Expand Up @@ -242,6 +268,8 @@ public static FieldBehavior forNumber(int value) {
return IMMUTABLE;
case 6:
return UNORDERED_LIST;
case 7:
return NON_EMPTY_DEFAULT;
default:
return null;
}
Expand Down
Expand Up @@ -65,15 +65,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
java.lang.String[] descriptorData = {
"\n\037google/api/field_behavior.proto\022\ngoogl"
+ "e.api\032 google/protobuf/descriptor.proto*"
+ "\217\001\n\rFieldBehavior\022\036\n\032FIELD_BEHAVIOR_UNSP"
+ "\246\001\n\rFieldBehavior\022\036\n\032FIELD_BEHAVIOR_UNSP"
+ "ECIFIED\020\000\022\014\n\010OPTIONAL\020\001\022\014\n\010REQUIRED\020\002\022\017\n"
+ "\013OUTPUT_ONLY\020\003\022\016\n\nINPUT_ONLY\020\004\022\r\n\tIMMUTA"
+ "BLE\020\005\022\022\n\016UNORDERED_LIST\020\006:Q\n\016field_behav"
+ "ior\022\035.google.protobuf.FieldOptions\030\234\010 \003("
+ "\0162\031.google.api.FieldBehaviorBp\n\016com.goog"
+ "le.apiB\022FieldBehaviorProtoP\001ZAgoogle.gol"
+ "ang.org/genproto/googleapis/api/annotati"
+ "ons;annotations\242\002\004GAPIb\006proto3"
+ "BLE\020\005\022\022\n\016UNORDERED_LIST\020\006\022\025\n\021NON_EMPTY_D"
+ "EFAULT\020\007:Q\n\016field_behavior\022\035.google.prot"
+ "obuf.FieldOptions\030\234\010 \003(\0162\031.google.api.Fi"
+ "eldBehaviorBp\n\016com.google.apiB\022FieldBeha"
+ "viorProtoP\001ZAgoogle.golang.org/genproto/"
+ "googleapis/api/annotations;annotations\242\002"
+ "\004GAPIb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down
Expand Up @@ -81,4 +81,10 @@ enum FieldBehavior {
// in any arbitrary order, rather than the order the user originally
// provided. Additionally, the list's order may or may not be stable.
UNORDERED_LIST = 6;

// Denotes that this field returns a non-empty default value if not set.
// This indicates that if the user provides the empty value in a request,
// a non-empty value will be returned. The user will not be aware of what
// non-empty value to expect.
NON_EMPTY_DEFAULT = 7;
}
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-common-protos.git",
"sha": "a07fab7b05f993d850680cdee12087178f281c62"
"sha": "1086c1cb870e49bc4b68992d293176909bc58a2d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ba89dace27923254d96ab8339b831dc996e2112f",
"internalRef": "377318673"
"sha": "aa136fa6649f7d999bf3873d0e5fca75cb2354a5",
"internalRef": "382337225"
}
},
{
Expand Down