Skip to content
Permalink
Browse files
feat(v1): Move CommonOperationMetadata into a separate file for poten…
  • Loading branch information
gcf-owl-bot[bot] committed Jun 8, 2021
1 parent a1a92b2 commit c309f8f6f88e0308677fc68a7825b3eac7b57627
@@ -37,9 +37,6 @@
from google.cloud.documentai_v1.types.document_processor_service import (
BatchProcessResponse,
)
from google.cloud.documentai_v1.types.document_processor_service import (
CommonOperationMetadata,
)
from google.cloud.documentai_v1.types.document_processor_service import (
HumanReviewStatus,
)
@@ -57,6 +54,7 @@
from google.cloud.documentai_v1.types.geometry import BoundingPoly
from google.cloud.documentai_v1.types.geometry import NormalizedVertex
from google.cloud.documentai_v1.types.geometry import Vertex
from google.cloud.documentai_v1.types.operation_metadata import CommonOperationMetadata

__all__ = (
"DocumentProcessorServiceClient",
@@ -71,7 +69,6 @@
"BatchProcessMetadata",
"BatchProcessRequest",
"BatchProcessResponse",
"CommonOperationMetadata",
"HumanReviewStatus",
"ProcessRequest",
"ProcessResponse",
@@ -81,4 +78,5 @@
"BoundingPoly",
"NormalizedVertex",
"Vertex",
"CommonOperationMetadata",
)
@@ -27,7 +27,6 @@
from .types.document_processor_service import BatchProcessMetadata
from .types.document_processor_service import BatchProcessRequest
from .types.document_processor_service import BatchProcessResponse
from .types.document_processor_service import CommonOperationMetadata
from .types.document_processor_service import HumanReviewStatus
from .types.document_processor_service import ProcessRequest
from .types.document_processor_service import ProcessResponse
@@ -37,6 +36,7 @@
from .types.geometry import BoundingPoly
from .types.geometry import NormalizedVertex
from .types.geometry import Vertex
from .types.operation_metadata import CommonOperationMetadata

__all__ = (
"DocumentProcessorServiceAsyncClient",
@@ -26,7 +26,6 @@
BatchProcessMetadata,
BatchProcessRequest,
BatchProcessResponse,
CommonOperationMetadata,
HumanReviewStatus,
ProcessRequest,
ProcessResponse,
@@ -39,6 +38,7 @@
NormalizedVertex,
Vertex,
)
from .operation_metadata import CommonOperationMetadata

__all__ = (
"Document",
@@ -51,7 +51,6 @@
"BatchProcessMetadata",
"BatchProcessRequest",
"BatchProcessResponse",
"CommonOperationMetadata",
"HumanReviewStatus",
"ProcessRequest",
"ProcessResponse",
@@ -61,4 +60,5 @@
"BoundingPoly",
"NormalizedVertex",
"Vertex",
"CommonOperationMetadata",
)
@@ -17,6 +17,7 @@

from google.cloud.documentai_v1.types import document as gcd_document
from google.cloud.documentai_v1.types import document_io
from google.cloud.documentai_v1.types import operation_metadata
from google.protobuf import timestamp_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore

@@ -33,7 +34,6 @@
"ReviewDocumentRequest",
"ReviewDocumentResponse",
"ReviewDocumentOperationMetadata",
"CommonOperationMetadata",
},
)

@@ -242,37 +242,8 @@ class ReviewDocumentOperationMetadata(proto.Message):
"""

common_metadata = proto.Field(
proto.MESSAGE, number=5, message="CommonOperationMetadata",
proto.MESSAGE, number=5, message=operation_metadata.CommonOperationMetadata,
)


class CommonOperationMetadata(proto.Message):
r"""The common metadata for long running operations.
Attributes:
state (google.cloud.documentai_v1.types.CommonOperationMetadata.State):
The state of the operation.
state_message (str):
A message providing more details about the
current state of processing.
create_time (google.protobuf.timestamp_pb2.Timestamp):
The creation time of the operation.
update_time (google.protobuf.timestamp_pb2.Timestamp):
The last update time of the operation.
"""

class State(proto.Enum):
r"""State of the longrunning operation."""
STATE_UNSPECIFIED = 0
RUNNING = 1
CANCELLING = 2
SUCCEEDED = 3
FAILED = 4
CANCELLED = 5

state = proto.Field(proto.ENUM, number=1, enum=State,)
state_message = proto.Field(proto.STRING, number=2,)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)


__all__ = tuple(sorted(__protobuf__.manifest))
@@ -31,7 +31,8 @@ class Vertex(proto.Message):
x (int):
X coordinate.
y (int):
Y coordinate.
Y coordinate (starts from the top of the
image).
"""

x = proto.Field(proto.INT32, number=1,)
@@ -47,7 +48,8 @@ class NormalizedVertex(proto.Message):
x (float):
X coordinate.
y (float):
Y coordinate.
Y coordinate (starts from the top of the
image).
"""

x = proto.Field(proto.FLOAT, number=1,)
@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import proto # type: ignore

from google.protobuf import timestamp_pb2 # type: ignore


__protobuf__ = proto.module(
package="google.cloud.documentai.v1", manifest={"CommonOperationMetadata",},
)


class CommonOperationMetadata(proto.Message):
r"""The common metadata for long running operations.
Attributes:
state (google.cloud.documentai_v1.types.CommonOperationMetadata.State):
The state of the operation.
state_message (str):
A message providing more details about the
current state of processing.
create_time (google.protobuf.timestamp_pb2.Timestamp):
The creation time of the operation.
update_time (google.protobuf.timestamp_pb2.Timestamp):
The last update time of the operation.
"""

class State(proto.Enum):
r"""State of the longrunning operation."""
STATE_UNSPECIFIED = 0
RUNNING = 1
CANCELLING = 2
SUCCEEDED = 3
FAILED = 4
CANCELLED = 5

state = proto.Field(proto.ENUM, number=1, enum=State,)
state_message = proto.Field(proto.STRING, number=2,)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)


__all__ = tuple(sorted(__protobuf__.manifest))

0 comments on commit c309f8f

Please sign in to comment.