Skip to content

Commit

Permalink
feat: [common-protos,common-protos] add new FieldBehavior value IDENT…
Browse files Browse the repository at this point in the history
…IFIER (#1937)

* feat: add new FieldBehavior value IDENTIFIER

PiperOrigin-RevId: 559119958

Source-Link: googleapis/googleapis@f5987af

Source-Link: https://github.com/googleapis/googleapis-gen/commit/cdecaddcc425659d3fc2e43caa820ba067607961
Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJjZGVjYWRkY2M0MjU2NTlkM2ZjMmU0M2NhYTgyMGJhMDY3NjA3OTYxIn0=

feat: add new FieldBehavior value IDENTIFIER

PiperOrigin-RevId: 559119958

Source-Link: googleapis/googleapis@f5987af

Source-Link: https://github.com/googleapis/googleapis-gen/commit/cdecaddcc425659d3fc2e43caa820ba067607961
Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJjZGVjYWRkY2M0MjU2NTlkM2ZjMmU0M2NhYTgyMGJhMDY3NjA3OTYxIn0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 30, 2023
1 parent dde34fb commit 24ae2a3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,27 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum {
* <code>NON_EMPTY_DEFAULT = 7;</code>
*/
NON_EMPTY_DEFAULT(7),
/**
*
*
* <pre>
* Denotes that the field in a resource (a message annotated with
* google.api.resource) is used in the resource name to uniquely identify the
* resource. For AIP-compliant APIs, this should only be applied to the
* `name` field on the resource.
*
* This behavior should not be applied to references to other resources within
* the message.
*
* The identifier field of resources often have different field behavior
* depending on the request it is embedded in (e.g. for Create methods name
* is optional and unused, while for Update methods it is required). Instead
* of method-specific annotations, only `IDENTIFIER` is required.
* </pre>
*
* <code>IDENTIFIER = 8;</code>
*/
IDENTIFIER(8),
UNRECOGNIZED(-1),
;

Expand Down Expand Up @@ -230,6 +251,27 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum {
* <code>NON_EMPTY_DEFAULT = 7;</code>
*/
public static final int NON_EMPTY_DEFAULT_VALUE = 7;
/**
*
*
* <pre>
* Denotes that the field in a resource (a message annotated with
* google.api.resource) is used in the resource name to uniquely identify the
* resource. For AIP-compliant APIs, this should only be applied to the
* `name` field on the resource.
*
* This behavior should not be applied to references to other resources within
* the message.
*
* The identifier field of resources often have different field behavior
* depending on the request it is embedded in (e.g. for Create methods name
* is optional and unused, while for Update methods it is required). Instead
* of method-specific annotations, only `IDENTIFIER` is required.
* </pre>
*
* <code>IDENTIFIER = 8;</code>
*/
public static final int IDENTIFIER_VALUE = 8;

public final int getNumber() {
if (this == UNRECOGNIZED) {
Expand Down Expand Up @@ -271,6 +313,8 @@ public static FieldBehavior forNumber(int value) {
return UNORDERED_LIST;
case 7:
return NON_EMPTY_DEFAULT;
case 8:
return IDENTIFIER;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,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*"
+ "\246\001\n\rFieldBehavior\022\036\n\032FIELD_BEHAVIOR_UNSP"
+ "\266\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\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"
+ "EFAULT\020\007\022\016\n\nIDENTIFIER\020\010:Q\n\016field_behavi"
+ "or\022\035.google.protobuf.FieldOptions\030\234\010 \003(\016"
+ "2\031.google.api.FieldBehaviorBp\n\016com.googl"
+ "e.apiB\022FieldBehaviorProtoP\001ZAgoogle.gola"
+ "ng.org/genproto/googleapis/api/annotatio"
+ "ns;annotations\242\002\004GAPIb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,18 @@ enum FieldBehavior {
// a non-empty value will be returned. The user will not be aware of what
// non-empty value to expect.
NON_EMPTY_DEFAULT = 7;

// Denotes that the field in a resource (a message annotated with
// google.api.resource) is used in the resource name to uniquely identify the
// resource. For AIP-compliant APIs, this should only be applied to the
// `name` field on the resource.
//
// This behavior should not be applied to references to other resources within
// the message.
//
// The identifier field of resources often have different field behavior
// depending on the request it is embedded in (e.g. for Create methods name
// is optional and unused, while for Update methods it is required). Instead
// of method-specific annotations, only `IDENTIFIER` is required.
IDENTIFIER = 8;
}

0 comments on commit 24ae2a3

Please sign in to comment.