From e6d1b7642e9f4500199251a375cd62c7492b42a3 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 4 Aug 2023 14:12:12 -0700 Subject: [PATCH] fix(AIP-156): Do not define Update on singletons with only output only fields. (#1188) Clarifying that singletons with only OUTPUT_ONLY fields do not require an Update method. --- aip/general/0156.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aip/general/0156.md b/aip/general/0156.md index 6b6a1f0e38..a4bca0015e 100644 --- a/aip/general/0156.md +++ b/aip/general/0156.md @@ -20,6 +20,7 @@ always exist by virtue of the existence of its parent, with one and exactly one per parent. For example: + ```proto message Config { option (google.api.resource) = { @@ -32,6 +33,7 @@ message Config { ``` The `Config` singleton would have the following RPCs: + ```proto rpc GetConfig(GetConfigRequest) returns (Config) { option (google.api.http) = { @@ -57,12 +59,15 @@ rpc UpdateConfig(UpdateConfigRequest) returns (Config) { - Singleton resources **should** define the [`Get`][aip-131] and [`Update`][aip-134] methods, and **may** define custom methods as appropriate. + - However, singleton resources **must not** define the [`Update`][aip-134] + method if all fields on the resource are [output only][aip-203]. - Singleton resources are always singular. - - Example: 'users/1234/thing' + - Example: `users/1234/thing` - Singleton resources **may** parent other resources. ## Changelog +- **2023-07-26:** Clarified that read-only singletons should not have `Update`. - **2021-11-02:** Added an example message and state parent eligibility. - **2021-01-14:** Changed example from `settings` to `config` for clarity. @@ -72,3 +77,4 @@ rpc UpdateConfig(UpdateConfigRequest) returns (Config) { [aip-133]: ./0133.md [aip-134]: ./0134.md [aip-135]: ./0135.md +[aip-203]: ./0203.md#output-only