Skip to content

Commit 3e0f7eb

Browse files
Google APIscopybara-github
authored andcommitted
feat: Move CommonOperationMetadata into a separate proto file for potential reuse.
PiperOrigin-RevId: 377562108
1 parent 060218c commit 3e0f7eb

4 files changed

Lines changed: 68 additions & 38 deletions

File tree

google/cloud/documentai/v1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ proto_library(
2525
"document_io.proto",
2626
"document_processor_service.proto",
2727
"geometry.proto",
28+
"operation_metadata.proto",
2829
],
2930
deps = [
3031
"//google/api:annotations_proto",

google/cloud/documentai/v1/document_processor_service.proto

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/documentai/v1/document.proto";
2424
import "google/cloud/documentai/v1/document_io.proto";
25+
import "google/cloud/documentai/v1/operation_metadata.proto";
2526
import "google/longrunning/operations.proto";
2627
import "google/protobuf/field_mask.proto";
2728
import "google/protobuf/timestamp.proto";
@@ -280,39 +281,3 @@ message ReviewDocumentOperationMetadata {
280281
// The basic metadata of the long running operation.
281282
CommonOperationMetadata common_metadata = 5;
282283
}
283-
284-
// The common metadata for long running operations.
285-
message CommonOperationMetadata {
286-
// State of the longrunning operation.
287-
enum State {
288-
// Unspecified state.
289-
STATE_UNSPECIFIED = 0;
290-
291-
// Operation is still running.
292-
RUNNING = 1;
293-
294-
// Operation is being cancelled.
295-
CANCELLING = 2;
296-
297-
// Operation succeeded.
298-
SUCCEEDED = 3;
299-
300-
// Operation failed.
301-
FAILED = 4;
302-
303-
// Operation is cancelled.
304-
CANCELLED = 5;
305-
}
306-
307-
// The state of the operation.
308-
State state = 1;
309-
310-
// A message providing more details about the current state of processing.
311-
string state_message = 2;
312-
313-
// The creation time of the operation.
314-
google.protobuf.Timestamp create_time = 3;
315-
316-
// The last update time of the operation.
317-
google.protobuf.Timestamp update_time = 4;
318-
}

google/cloud/documentai/v1/geometry.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ message Vertex {
3232
// X coordinate.
3333
int32 x = 1;
3434

35-
// Y coordinate.
35+
// Y coordinate (starts from the top of the image).
3636
int32 y = 2;
3737
}
3838

@@ -43,7 +43,7 @@ message NormalizedVertex {
4343
// X coordinate.
4444
float x = 1;
4545

46-
// Y coordinate.
46+
// Y coordinate (starts from the top of the image).
4747
float y = 2;
4848
}
4949

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.documentai.v1;
18+
19+
import "google/protobuf/timestamp.proto";
20+
import "google/api/annotations.proto";
21+
22+
option csharp_namespace = "Google.Cloud.DocumentAI.V1";
23+
option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai";
24+
option java_multiple_files = true;
25+
option java_outer_classname = "OperationMetadataProto";
26+
option java_package = "com.google.cloud.documentai.v1";
27+
option php_namespace = "Google\\Cloud\\DocumentAI\\V1";
28+
option ruby_package = "Google::Cloud::DocumentAI::V1";
29+
30+
// The common metadata for long running operations.
31+
message CommonOperationMetadata {
32+
// State of the longrunning operation.
33+
enum State {
34+
// Unspecified state.
35+
STATE_UNSPECIFIED = 0;
36+
37+
// Operation is still running.
38+
RUNNING = 1;
39+
40+
// Operation is being cancelled.
41+
CANCELLING = 2;
42+
43+
// Operation succeeded.
44+
SUCCEEDED = 3;
45+
46+
// Operation failed.
47+
FAILED = 4;
48+
49+
// Operation is cancelled.
50+
CANCELLED = 5;
51+
}
52+
53+
// The state of the operation.
54+
State state = 1;
55+
56+
// A message providing more details about the current state of processing.
57+
string state_message = 2;
58+
59+
// The creation time of the operation.
60+
google.protobuf.Timestamp create_time = 3;
61+
62+
// The last update time of the operation.
63+
google.protobuf.Timestamp update_time = 4;
64+
}

0 commit comments

Comments
 (0)