Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 34ff993

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#147)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 431698c commit 34ff993

File tree

33 files changed

+210
-207
lines changed

33 files changed

+210
-207
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.2.2" # {x-release-please-version}

google/cloud/datastream_v1/services/datastream/async_client.py

Lines changed: 46 additions & 50 deletions
Large diffs are not rendered by default.

google/cloud/datastream_v1/services/datastream/client.py

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.datastream_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -565,7 +566,7 @@ def list_connection_profiles(
565566
*,
566567
parent: Optional[str] = None,
567568
retry: OptionalRetry = gapic_v1.method.DEFAULT,
568-
timeout: Optional[float] = None,
569+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
569570
metadata: Sequence[Tuple[str, str]] = (),
570571
) -> pagers.ListConnectionProfilesPager:
571572
r"""Use this method to list connection profiles created
@@ -681,7 +682,7 @@ def get_connection_profile(
681682
*,
682683
name: Optional[str] = None,
683684
retry: OptionalRetry = gapic_v1.method.DEFAULT,
684-
timeout: Optional[float] = None,
685+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
685686
metadata: Sequence[Tuple[str, str]] = (),
686687
) -> datastream_resources.ConnectionProfile:
687688
r"""Use this method to get details about a connection
@@ -789,7 +790,7 @@ def create_connection_profile(
789790
connection_profile: Optional[datastream_resources.ConnectionProfile] = None,
790791
connection_profile_id: Optional[str] = None,
791792
retry: OptionalRetry = gapic_v1.method.DEFAULT,
792-
timeout: Optional[float] = None,
793+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
793794
metadata: Sequence[Tuple[str, str]] = (),
794795
) -> operation.Operation:
795796
r"""Use this method to create a connection profile in a
@@ -938,7 +939,7 @@ def update_connection_profile(
938939
connection_profile: Optional[datastream_resources.ConnectionProfile] = None,
939940
update_mask: Optional[field_mask_pb2.FieldMask] = None,
940941
retry: OptionalRetry = gapic_v1.method.DEFAULT,
941-
timeout: Optional[float] = None,
942+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
942943
metadata: Sequence[Tuple[str, str]] = (),
943944
) -> operation.Operation:
944945
r"""Use this method to update the parameters of a
@@ -1081,7 +1082,7 @@ def delete_connection_profile(
10811082
*,
10821083
name: Optional[str] = None,
10831084
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1084-
timeout: Optional[float] = None,
1085+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10851086
metadata: Sequence[Tuple[str, str]] = (),
10861087
) -> operation.Operation:
10871088
r"""Use this method to delete a connection profile.
@@ -1208,7 +1209,7 @@ def discover_connection_profile(
12081209
] = None,
12091210
*,
12101211
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1211-
timeout: Optional[float] = None,
1212+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12121213
metadata: Sequence[Tuple[str, str]] = (),
12131214
) -> datastream.DiscoverConnectionProfileResponse:
12141215
r"""Use this method to discover a connection profile.
@@ -1303,7 +1304,7 @@ def list_streams(
13031304
*,
13041305
parent: Optional[str] = None,
13051306
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1306-
timeout: Optional[float] = None,
1307+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13071308
metadata: Sequence[Tuple[str, str]] = (),
13081309
) -> pagers.ListStreamsPager:
13091310
r"""Use this method to list streams in a project and
@@ -1417,7 +1418,7 @@ def get_stream(
14171418
*,
14181419
name: Optional[str] = None,
14191420
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1420-
timeout: Optional[float] = None,
1421+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14211422
metadata: Sequence[Tuple[str, str]] = (),
14221423
) -> datastream_resources.Stream:
14231424
r"""Use this method to get details about a stream.
@@ -1521,7 +1522,7 @@ def create_stream(
15211522
stream: Optional[datastream_resources.Stream] = None,
15221523
stream_id: Optional[str] = None,
15231524
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1524-
timeout: Optional[float] = None,
1525+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15251526
metadata: Sequence[Tuple[str, str]] = (),
15261527
) -> operation.Operation:
15271528
r"""Use this method to create a stream.
@@ -1663,7 +1664,7 @@ def update_stream(
16631664
stream: Optional[datastream_resources.Stream] = None,
16641665
update_mask: Optional[field_mask_pb2.FieldMask] = None,
16651666
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1666-
timeout: Optional[float] = None,
1667+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16671668
metadata: Sequence[Tuple[str, str]] = (),
16681669
) -> operation.Operation:
16691670
r"""Use this method to update the configuration of a
@@ -1802,7 +1803,7 @@ def delete_stream(
18021803
*,
18031804
name: Optional[str] = None,
18041805
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1805-
timeout: Optional[float] = None,
1806+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18061807
metadata: Sequence[Tuple[str, str]] = (),
18071808
) -> operation.Operation:
18081809
r"""Use this method to delete a stream.
@@ -1926,7 +1927,7 @@ def get_stream_object(
19261927
*,
19271928
name: Optional[str] = None,
19281929
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1929-
timeout: Optional[float] = None,
1930+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19301931
metadata: Sequence[Tuple[str, str]] = (),
19311932
) -> datastream_resources.StreamObject:
19321933
r"""Use this method to get details about a stream object.
@@ -2027,7 +2028,7 @@ def lookup_stream_object(
20272028
request: Optional[Union[datastream.LookupStreamObjectRequest, dict]] = None,
20282029
*,
20292030
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2030-
timeout: Optional[float] = None,
2031+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20312032
metadata: Sequence[Tuple[str, str]] = (),
20322033
) -> datastream_resources.StreamObject:
20332034
r"""Use this method to look up a stream object by its
@@ -2115,7 +2116,7 @@ def list_stream_objects(
21152116
*,
21162117
parent: Optional[str] = None,
21172118
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2118-
timeout: Optional[float] = None,
2119+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21192120
metadata: Sequence[Tuple[str, str]] = (),
21202121
) -> pagers.ListStreamObjectsPager:
21212122
r"""Use this method to list the objects of a specific
@@ -2231,7 +2232,7 @@ def start_backfill_job(
22312232
*,
22322233
object_: Optional[str] = None,
22332234
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2234-
timeout: Optional[float] = None,
2235+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
22352236
metadata: Sequence[Tuple[str, str]] = (),
22362237
) -> datastream.StartBackfillJobResponse:
22372238
r"""Use this method to start a backfill job for the
@@ -2336,7 +2337,7 @@ def stop_backfill_job(
23362337
*,
23372338
object_: Optional[str] = None,
23382339
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2339-
timeout: Optional[float] = None,
2340+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
23402341
metadata: Sequence[Tuple[str, str]] = (),
23412342
) -> datastream.StopBackfillJobResponse:
23422343
r"""Use this method to stop a backfill job for the
@@ -2440,7 +2441,7 @@ def fetch_static_ips(
24402441
*,
24412442
name: Optional[str] = None,
24422443
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2443-
timeout: Optional[float] = None,
2444+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
24442445
metadata: Sequence[Tuple[str, str]] = (),
24452446
) -> pagers.FetchStaticIpsPager:
24462447
r"""The FetchStaticIps API call exposes the static IP
@@ -2561,7 +2562,7 @@ def create_private_connection(
25612562
private_connection: Optional[datastream_resources.PrivateConnection] = None,
25622563
private_connection_id: Optional[str] = None,
25632564
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2564-
timeout: Optional[float] = None,
2565+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
25652566
metadata: Sequence[Tuple[str, str]] = (),
25662567
) -> operation.Operation:
25672568
r"""Use this method to create a private connectivity
@@ -2703,7 +2704,7 @@ def get_private_connection(
27032704
*,
27042705
name: Optional[str] = None,
27052706
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2706-
timeout: Optional[float] = None,
2707+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
27072708
metadata: Sequence[Tuple[str, str]] = (),
27082709
) -> datastream_resources.PrivateConnection:
27092710
r"""Use this method to get details about a private
@@ -2808,7 +2809,7 @@ def list_private_connections(
28082809
*,
28092810
parent: Optional[str] = None,
28102811
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2811-
timeout: Optional[float] = None,
2812+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
28122813
metadata: Sequence[Tuple[str, str]] = (),
28132814
) -> pagers.ListPrivateConnectionsPager:
28142815
r"""Use this method to list private connectivity
@@ -2927,7 +2928,7 @@ def delete_private_connection(
29272928
*,
29282929
name: Optional[str] = None,
29292930
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2930-
timeout: Optional[float] = None,
2931+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
29312932
metadata: Sequence[Tuple[str, str]] = (),
29322933
) -> operation.Operation:
29332934
r"""Use this method to delete a private connectivity
@@ -3056,7 +3057,7 @@ def create_route(
30563057
route: Optional[datastream_resources.Route] = None,
30573058
route_id: Optional[str] = None,
30583059
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3059-
timeout: Optional[float] = None,
3060+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
30603061
metadata: Sequence[Tuple[str, str]] = (),
30613062
) -> operation.Operation:
30623063
r"""Use this method to create a route for a private
@@ -3194,7 +3195,7 @@ def get_route(
31943195
*,
31953196
name: Optional[str] = None,
31963197
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3197-
timeout: Optional[float] = None,
3198+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
31983199
metadata: Sequence[Tuple[str, str]] = (),
31993200
) -> datastream_resources.Route:
32003201
r"""Use this method to get details about a route.
@@ -3297,7 +3298,7 @@ def list_routes(
32973298
*,
32983299
parent: Optional[str] = None,
32993300
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3300-
timeout: Optional[float] = None,
3301+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
33013302
metadata: Sequence[Tuple[str, str]] = (),
33023303
) -> pagers.ListRoutesPager:
33033304
r"""Use this method to list routes created for a private
@@ -3411,7 +3412,7 @@ def delete_route(
34113412
*,
34123413
name: Optional[str] = None,
34133414
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3414-
timeout: Optional[float] = None,
3415+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
34153416
metadata: Sequence[Tuple[str, str]] = (),
34163417
) -> operation.Operation:
34173418
r"""Use this method to delete a route.
@@ -3546,7 +3547,7 @@ def list_operations(
35463547
request: Optional[operations_pb2.ListOperationsRequest] = None,
35473548
*,
35483549
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3549-
timeout: Optional[float] = None,
3550+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
35503551
metadata: Sequence[Tuple[str, str]] = (),
35513552
) -> operations_pb2.ListOperationsResponse:
35523553
r"""Lists operations that match the specified filter in the request.
@@ -3600,7 +3601,7 @@ def get_operation(
36003601
request: Optional[operations_pb2.GetOperationRequest] = None,
36013602
*,
36023603
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3603-
timeout: Optional[float] = None,
3604+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
36043605
metadata: Sequence[Tuple[str, str]] = (),
36053606
) -> operations_pb2.Operation:
36063607
r"""Gets the latest state of a long-running operation.
@@ -3654,7 +3655,7 @@ def delete_operation(
36543655
request: Optional[operations_pb2.DeleteOperationRequest] = None,
36553656
*,
36563657
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3657-
timeout: Optional[float] = None,
3658+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
36583659
metadata: Sequence[Tuple[str, str]] = (),
36593660
) -> None:
36603661
r"""Deletes a long-running operation.
@@ -3709,7 +3710,7 @@ def cancel_operation(
37093710
request: Optional[operations_pb2.CancelOperationRequest] = None,
37103711
*,
37113712
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3712-
timeout: Optional[float] = None,
3713+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
37133714
metadata: Sequence[Tuple[str, str]] = (),
37143715
) -> None:
37153716
r"""Starts asynchronous cancellation on a long-running operation.
@@ -3763,7 +3764,7 @@ def get_location(
37633764
request: Optional[locations_pb2.GetLocationRequest] = None,
37643765
*,
37653766
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3766-
timeout: Optional[float] = None,
3767+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
37673768
metadata: Sequence[Tuple[str, str]] = (),
37683769
) -> locations_pb2.Location:
37693770
r"""Gets information about a location.
@@ -3817,7 +3818,7 @@ def list_locations(
38173818
request: Optional[locations_pb2.ListLocationsRequest] = None,
38183819
*,
38193820
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3820-
timeout: Optional[float] = None,
3821+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
38213822
metadata: Sequence[Tuple[str, str]] = (),
38223823
) -> locations_pb2.ListLocationsResponse:
38233824
r"""Lists information about the supported locations for this service.
@@ -3867,14 +3868,9 @@ def list_locations(
38673868
return response
38683869

38693870

3870-
try:
3871-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3872-
gapic_version=pkg_resources.get_distribution(
3873-
"google-cloud-datastream",
3874-
).version,
3875-
)
3876-
except pkg_resources.DistributionNotFound:
3877-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
3871+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3872+
gapic_version=package_version.__version__
3873+
)
38783874

38793875

38803876
__all__ = ("DatastreamClient",)

google/cloud/datastream_v1/services/datastream/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@
2727
from google.iam.v1 import policy_pb2 # type: ignore
2828
from google.longrunning import operations_pb2 # type: ignore
2929
from google.oauth2 import service_account # type: ignore
30-
import pkg_resources
3130

31+
from google.cloud.datastream_v1 import gapic_version as package_version
3232
from google.cloud.datastream_v1.types import datastream, datastream_resources
3333

34-
try:
35-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
36-
gapic_version=pkg_resources.get_distribution(
37-
"google-cloud-datastream",
38-
).version,
39-
)
40-
except pkg_resources.DistributionNotFound:
41-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
34+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
35+
gapic_version=package_version.__version__
36+
)
4237

4338

4439
class DatastreamTransport(abc.ABC):
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.2.2" # {x-release-please-version}

0 commit comments

Comments
 (0)