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