github.com/googleapis/api-linter@v1.65.2/docs/rules/0162/rollback-request-message-name.md (about)

     1  ---
     2  rule:
     3    aip: 162
     4    name: [core, '0162', rollback-request-message-name]
     5    summary: Rollback methods must have standardized request message names.
     6  permalink: /162/rollback-request-message-name
     7  redirect_from:
     8    - /0162/rollback-request-message-name
     9  ---
    10  
    11  # Rollback methods: Request message
    12  
    13  This rule enforces that all `Rollback` RPCs have a request message name of
    14  `Rollback*Request`, as mandated in [AIP-162][].
    15  
    16  ## Details
    17  
    18  This rule looks at any method beginning with `Rollback`, and complains
    19  if the name of the corresponding input message does not match the name of the
    20  RPC with the suffix `Request` appended.
    21  
    22  ## Examples
    23  
    24  **Incorrect** code for this rule:
    25  
    26  ```proto
    27  // Incorrect.
    28  // Should be `RollbackBookRequest`.
    29  rpc RollbackBook(UndoBookRequest) returns (Book) {
    30    option (google.api.http) = {
    31      post: "/v1/{name=publishers/*/books/*}:rollback"
    32      body: "*"
    33    };
    34  }
    35  ```
    36  
    37  **Correct** code for this rule:
    38  
    39  ```proto
    40  // Correct.
    41  rpc RollbackBook(RollbackBookRequest) returns (Book) {
    42    option (google.api.http) = {
    43      post: "/v1/{name=publishers/*/books/*}:rollback"
    44      body: "*"
    45    };
    46  }
    47  ```
    48  
    49  ## Disabling
    50  
    51  If you need to violate this rule, use a leading comment above the method.
    52  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    53  
    54  ```proto
    55  // (-- api-linter: core::0162::rollback-request-message-name=disabled
    56  //     aip.dev/not-precedent: We need to do this because reasons. --)
    57  rpc RollbackBook(UndoBookRequest) returns (Book) {
    58    option (google.api.http) = {
    59      post: "/v1/{name=publishers/*/books/*}:rollback"
    60      body: "*"
    61    };
    62  }
    63  ```
    64  
    65  If you need to violate this rule for an entire file, place the comment at the
    66  top of the file.
    67  
    68  [aip-162]: https://aip.dev/162
    69  [aip.dev/not-precedent]: https://aip.dev/not-precedent