| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto3"; | 5 syntax = "proto2"; |
| 6 option optimize_for = LITE_RUNTIME; | 6 option optimize_for = LITE_RUNTIME; |
| 7 | 7 |
| 8 package offline_pages.proto; | 8 package offline_pages.proto; |
| 9 ; | |
| 10 | 9 |
| 11 import "any.proto"; | 10 import "any.proto"; |
| 12 import "status.proto"; | 11 import "status.proto"; |
| 13 | 12 |
| 14 // This resource represents a long-running operation that is the result of a | 13 // This resource represents a long-running operation that is the result of a |
| 15 // network API call. | 14 // network API call. |
| 16 message Operation { | 15 message Operation { |
| 17 // The server-assigned name, which is only unique within the same service that | 16 // The server-assigned name, which is only unique within the same service that |
| 18 // originally returns it. | 17 // originally returns it. |
| 19 string name = 1; | 18 optional string name = 1; |
| 20 | 19 |
| 21 // Service-specific metadata associated with the operation. It typically | 20 // Service-specific metadata associated with the operation. It typically |
| 22 // contains progress information and common metadata such as create time. | 21 // contains progress information and common metadata such as create time. |
| 23 // Some services might not provide such metadata. Any method that returns a | 22 // Some services might not provide such metadata. Any method that returns a |
| 24 // long-running operation should document the metadata type, if any. | 23 // long-running operation should document the metadata type, if any. |
| 25 Any metadata = 2; | 24 optional Any metadata = 2; |
| 26 | 25 |
| 27 // If the value is 'false', it means the operation is still in progress. | 26 // If the value is 'false', it means the operation is still in progress. |
| 28 // If true, the operation is completed, and either 'error' or 'response' is | 27 // If true, the operation is completed, and either 'error' or 'response' is |
| 29 // available. | 28 // available. |
| 30 bool done = 3; | 29 optional bool done = 3; |
| 31 | 30 |
| 32 // The operation result, which can be either an 'error' or a valid 'response'. | 31 // The operation result, which can be either an 'error' or a valid 'response'. |
| 33 // If 'done' == 'false', neither 'error' nor 'response' is set. | 32 // If 'done' == 'false', neither 'error' nor 'response' is set. |
| 34 // If 'done' == 'true', exactly one of 'error' or 'response' is set. | 33 // If 'done' == 'true', exactly one of 'error' or 'response' is set. |
| 35 oneof result { | 34 oneof result { |
| 36 // The error result of the operation in case of failure or cancellation. | 35 // The error result of the operation in case of failure or cancellation. |
| 37 Status error = 4; | 36 Status error = 4; |
| 38 | 37 |
| 39 // The normal response of the operation in case of success. | 38 // The normal response of the operation in case of success. |
| 40 Any response = 5; | 39 Any response = 5; |
| 41 } | 40 } |
| 42 } | 41 } |
| OLD | NEW |