github.com/googleapis/api-linter@v1.65.2/docs/rules/0234/response-message-name.md (about)

     1  ---
     2  rule:
     3    aip: 234
     4    name: [core, '0234', response-message-name]
     5    summary: Batch Update methods must have standardized response message names.
     6  permalink: /234/response-message-name
     7  redirect_from:
     8    - /0234/response-message-name
     9  ---
    10  
    11  # Batch Update methods: Response message
    12  
    13  This rule enforces that all `BatchUpdate` RPCs have a response message name of
    14  `BatchUpdate*Response`, as mandated in [AIP-234][].
    15  
    16  ## Details
    17  
    18  This rule looks at any RPCs whose name starts with `BatchUpdate`, and
    19  complains if the name of the corresponding returned message does not match the
    20  name of the RPC with the suffix `Response` appended.
    21  
    22  It also permits a response of `google.longrunning.Operation`; in this case, it
    23  checks the `response_type` in the `google.longrunning.operation_info`
    24  annotation and ensures that _it_ corresponds to the name of the RPC with the
    25  suffix `Response` appended, as mandated in [AIP-151][].
    26  
    27  ## Examples
    28  
    29  **Incorrect** code for this rule:
    30  
    31  ```proto
    32  // Incorrect.
    33  // Should be `BatchUpdateBooksResponse`.
    34  rpc BatchUpdateBooks(BatchUpdateBooksRequest) returns (BooksResponse) {
    35    option (google.api.http) = {
    36      post: "/v1/{parent=publishers/*}/books:batchUpdate"
    37      body: "*"
    38    };
    39  }
    40  ```
    41  
    42  **Correct** code for this rule:
    43  
    44  ```proto
    45  // Correct.
    46  rpc BatchUpdateBooks(BatchUpdateBooksRequest) returns (BatchUpdateBooksResponse) {
    47    option (google.api.http) = {
    48      post: "/v1/{parent=publishers/*}/books:batchUpdate"
    49      body: "*"
    50    };
    51  }
    52  ```
    53  
    54  ## Disabling
    55  
    56  If you need to violate this rule, use a leading comment above the method.
    57  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    58  
    59  ```proto
    60  // (-- api-linter: core::0234::response-message-name=disabled
    61  //     aip.dev/not-precedent: We need to do this because reasons. --)
    62  rpc BatchUpdateBooks(BatchUpdateBooksRequest) returns (BooksResponse) {
    63    option (google.api.http) = {
    64      post: "/v1/{parent=publishers/*}/books:batchUpdate"
    65      body: "*"
    66    };
    67  }
    68  ```
    69  
    70  If you need to violate this rule for an entire file, place the comment at the
    71  top of the file.
    72  
    73  [aip-234]: https://aip.dev/234
    74  [aip-151]: https://aip.dev/151
    75  [aip.dev/not-precedent]: https://aip.dev/not-precedent