@@ -7,7 +7,7 @@ created: 2024-03-07
77# Automatically populate fields in the request message
88
99For APIs that leverage request idempotency as described via [ AIP-155] , APIs may
10- choose to have the client libraries automatically populate fields such as
10+ choose to have the client libraries automatically populate fields such as
1111` request_id ` if they are not already set by the customer.
1212
1313** Note:** This feature is primarily written for ` request_id ` fields within the
@@ -38,14 +38,21 @@ If the aforementioned requirements are met for a given field, client library
3838generators ** must** enable automatic population of said field in the
3939generated client.
4040
41+ The field ** must** be automatically populated if and only if one of the
42+ following conditions holds:
43+
44+ - The field supports explicit presence, and has ** not** been set by the user
45+ - The field doesn't support explicit presence, and its value is the empty
46+ string (i.e. the default value)
47+
4148If a field is specified in the ` auto_populated_fields ` , but does not meet the
4249structural requirements, the client library generators ** must not** enable
4350automatic population for that field. Client library generators ** may** emit an
4451error during generation.
4552
4653Client libraries ** must** reuse automatically populated values for retries of
47- the same request. In other words, the automatically populated fields ** must not **
48- be regenerated for each RPC attempt with the same request message.
54+ the same request. In other words, the automatically populated fields
55+ ** must not ** be regenerated for each RPC attempt with the same request message.
4956
5057[ AIP-155 ] : https://google.aip.dev/155
5158
0 commit comments