Skip to content

Commit aaed69b

Browse files
ohmayrpartheagcf-owl-bot[bot]
authored
feat: add support for asynchronous long running operations (#724)
* feat: implement `OperationsRestAsyncTransport` to support long running operations (#700) * feat: Add OperationsRestAsyncTransport to support long running operations * update TODO comment * update TODO comment * address feedback * address feedback * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix mypy and lint issues * minor fix * add no cover * fix no cover tag * link coverage issue * silence coverage issue * fix statement name error * address PR feedback * address PR feedback * address PR comments --------- Co-authored-by: ohmayr <omairnaveed@ymail.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: implement async client for LROs (#707) * feat: implement `AbstractOperationsAsyncClient` to support long running operations * remove coverage guards * address presubmit failures * fix coverage for cancel operation * tests cleanup * fix incorrect tests * file bugs * add auth import * address PR comments * address PR comments * fix unit tests and address more comments * disable retry parameter * add retry parameter * address PR comments --------- Co-authored-by: ohmayr <omairnaveed@ymail.com> Co-authored-by: ohmayr <omairn@google.com> * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 84bf637 commit aaed69b

File tree

14 files changed

+2208
-551
lines changed

14 files changed

+2208
-551
lines changed

google/api_core/client_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ class ClientInfo(object):
5757
user_agent (Optional[str]): Prefix to the user agent header. This is
5858
used to supply information such as application name or partner tool.
5959
Recommended format: ``application-or-tool-ID/major.minor.version``.
60-
rest_version (Optional[str]): The requests library version.
60+
rest_version (Optional[str]): A string with labeled versions of the
61+
dependencies used for REST transport.
6162
"""
6263

6364
def __init__(

google/api_core/gapic_v1/client_info.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class ClientInfo(client_info.ClientInfo):
4545
user_agent (Optional[str]): Prefix to the user agent header. This is
4646
used to supply information such as application name or partner tool.
4747
Recommended format: ``application-or-tool-ID/major.minor.version``.
48+
rest_version (Optional[str]): A string with labeled versions of the
49+
dependencies used for REST transport.
4850
"""
4951

5052
def to_grpc_metadata(self):

google/api_core/operations_v1/__init__.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
"""Package for interacting with the google.longrunning.operations meta-API."""
1616

17-
from google.api_core.operations_v1.abstract_operations_client import (
18-
AbstractOperationsClient,
19-
)
17+
from google.api_core.operations_v1.abstract_operations_client import AbstractOperationsClient
2018
from google.api_core.operations_v1.operations_async_client import OperationsAsyncClient
2119
from google.api_core.operations_v1.operations_client import OperationsClient
2220
from google.api_core.operations_v1.transports.rest import OperationsRestTransport
@@ -25,5 +23,18 @@
2523
"AbstractOperationsClient",
2624
"OperationsAsyncClient",
2725
"OperationsClient",
28-
"OperationsRestTransport",
26+
"OperationsRestTransport"
2927
]
28+
29+
try:
30+
from google.api_core.operations_v1.transports.rest_asyncio import (
31+
AsyncOperationsRestTransport,
32+
)
33+
from google.api_core.operations_v1.operations_rest_client_async import AsyncOperationsRestClient
34+
35+
__all__ += ["AsyncOperationsRestClient", "AsyncOperationsRestTransport"]
36+
except ImportError:
37+
# This import requires the `async_rest` extra.
38+
# Don't raise an exception if `AsyncOperationsRestTransport` cannot be imported
39+
# as other transports are still available.
40+
pass

0 commit comments

Comments
 (0)