@@ -122,6 +122,22 @@ def _get_default_mtls_endpoint(api_endpoint):
122122 DEFAULT_ENDPOINT
123123 )
124124
125+ @classmethod
126+ def from_service_account_info (cls , info : dict , * args , ** kwargs ):
127+ """Creates an instance of this client using the provided credentials info.
128+
129+ Args:
130+ info (dict): The service account private key info.
131+ args: Additional arguments to pass to the constructor.
132+ kwargs: Additional arguments to pass to the constructor.
133+
134+ Returns:
135+ DocumentUnderstandingServiceClient: The constructed client.
136+ """
137+ credentials = service_account .Credentials .from_service_account_info (info )
138+ kwargs ["credentials" ] = credentials
139+ return cls (* args , ** kwargs )
140+
125141 @classmethod
126142 def from_service_account_file (cls , filename : str , * args , ** kwargs ):
127143 """Creates an instance of this client using the provided credentials
@@ -134,7 +150,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
134150 kwargs: Additional arguments to pass to the constructor.
135151
136152 Returns:
137- {@api.name} : The constructed client.
153+ DocumentUnderstandingServiceClient : The constructed client.
138154 """
139155 credentials = service_account .Credentials .from_service_account_file (filename )
140156 kwargs ["credentials" ] = credentials
@@ -226,10 +242,10 @@ def __init__(
226242 credentials identify the application to the service; if none
227243 are specified, the client will attempt to ascertain the
228244 credentials from the environment.
229- transport (Union[str, ~. DocumentUnderstandingServiceTransport]): The
245+ transport (Union[str, DocumentUnderstandingServiceTransport]): The
230246 transport to use. If set to None, a transport is chosen
231247 automatically.
232- client_options (client_options_lib .ClientOptions): Custom options for the
248+ client_options (google.api_core.client_options .ClientOptions): Custom options for the
233249 client. It won't take effect if a ``transport`` instance is provided.
234250 (1) The ``api_endpoint`` property can be used to override the
235251 default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -340,13 +356,14 @@ def batch_process_documents(
340356 written to Cloud Storage as JSON in the [Document] format.
341357
342358 Args:
343- request (:class:`~.document_understanding. BatchProcessDocumentsRequest` ):
359+ request (google.cloud.documentai_v1beta2.types. BatchProcessDocumentsRequest):
344360 The request object. Request to batch process documents
345361 as an asynchronous operation. The output is written to
346362 Cloud Storage as JSON in the [Document] format.
347- requests (:class:` Sequence[~.document_understanding. ProcessDocumentRequest]` ):
363+ requests (Sequence[google.cloud.documentai_v1beta2.types. ProcessDocumentRequest]):
348364 Required. Individual requests for
349365 each document.
366+
350367 This corresponds to the ``requests`` field
351368 on the ``request`` instance; if ``request`` is provided, this
352369 should not be set.
@@ -358,14 +375,11 @@ def batch_process_documents(
358375 sent along with the request as metadata.
359376
360377 Returns:
361- ~ .operation.Operation:
378+ google.api_core .operation.Operation:
362379 An object representing a long-running operation.
363380
364- The result type for the operation will be
365- :class:``~.document_understanding.BatchProcessDocumentsResponse``:
366- Response to an batch document processing request. This
367- is returned in the LRO Operation after the operation is
368- complete.
381+ The result type for the operation will be :class:`google.cloud.documentai_v1beta2.types.BatchProcessDocumentsResponse` Response to an batch document processing request. This is returned in
382+ the LRO Operation after the operation is complete.
369383
370384 """
371385 # Create or coerce a protobuf request object.
@@ -426,7 +440,7 @@ def process_document(
426440 r"""Processes a single document.
427441
428442 Args:
429- request (:class:`~.document_understanding. ProcessDocumentRequest` ):
443+ request (google.cloud.documentai_v1beta2.types. ProcessDocumentRequest):
430444 The request object. Request to process one document.
431445
432446 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -436,7 +450,7 @@ def process_document(
436450 sent along with the request as metadata.
437451
438452 Returns:
439- ~.document .Document:
453+ google.cloud.documentai_v1beta2.types .Document:
440454 Document represents the canonical
441455 document resource in Document
442456 Understanding AI. It is an interchange
0 commit comments