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

Commit 17baf34

Browse files
chore: use gapic-generator-python 0.53.4 (#20)
- [ ] Regenerate this pull request now. docs: list oneofs in docstring fix(deps): require google-api-core >= 1.28.0 fix(deps): drop packaging dependency committer: busunkim96@ PiperOrigin-RevId: 406468269 Source-Link: googleapis/googleapis@83d81b0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
1 parent 8bf3167 commit 17baf34

File tree

9 files changed

+120
-203
lines changed

9 files changed

+120
-203
lines changed

google/cloud/deploy_v1/services/cloud_deploy/async_client.py

Lines changed: 57 additions & 55 deletions
Large diffs are not rendered by default.

google/cloud/deploy_v1/services/cloud_deploy/client.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.api_core import operation # type: ignore
3436
from google.api_core import operation_async # type: ignore
3537
from google.cloud.deploy_v1.services.cloud_deploy import pagers
@@ -482,7 +484,7 @@ def list_delivery_pipelines(
482484
request: Union[cloud_deploy.ListDeliveryPipelinesRequest, dict] = None,
483485
*,
484486
parent: str = None,
485-
retry: retries.Retry = gapic_v1.method.DEFAULT,
487+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
486488
timeout: float = None,
487489
metadata: Sequence[Tuple[str, str]] = (),
488490
) -> pagers.ListDeliveryPipelinesPager:
@@ -563,7 +565,7 @@ def get_delivery_pipeline(
563565
request: Union[cloud_deploy.GetDeliveryPipelineRequest, dict] = None,
564566
*,
565567
name: str = None,
566-
retry: retries.Retry = gapic_v1.method.DEFAULT,
568+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
567569
timeout: float = None,
568570
metadata: Sequence[Tuple[str, str]] = (),
569571
) -> cloud_deploy.DeliveryPipeline:
@@ -640,7 +642,7 @@ def create_delivery_pipeline(
640642
parent: str = None,
641643
delivery_pipeline: cloud_deploy.DeliveryPipeline = None,
642644
delivery_pipeline_id: str = None,
643-
retry: retries.Retry = gapic_v1.method.DEFAULT,
645+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
644646
timeout: float = None,
645647
metadata: Sequence[Tuple[str, str]] = (),
646648
) -> operation.Operation:
@@ -743,7 +745,7 @@ def update_delivery_pipeline(
743745
*,
744746
delivery_pipeline: cloud_deploy.DeliveryPipeline = None,
745747
update_mask: field_mask_pb2.FieldMask = None,
746-
retry: retries.Retry = gapic_v1.method.DEFAULT,
748+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
747749
timeout: float = None,
748750
metadata: Sequence[Tuple[str, str]] = (),
749751
) -> operation.Operation:
@@ -843,7 +845,7 @@ def delete_delivery_pipeline(
843845
request: Union[cloud_deploy.DeleteDeliveryPipelineRequest, dict] = None,
844846
*,
845847
name: str = None,
846-
retry: retries.Retry = gapic_v1.method.DEFAULT,
848+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
847849
timeout: float = None,
848850
metadata: Sequence[Tuple[str, str]] = (),
849851
) -> operation.Operation:
@@ -936,7 +938,7 @@ def list_targets(
936938
request: Union[cloud_deploy.ListTargetsRequest, dict] = None,
937939
*,
938940
parent: str = None,
939-
retry: retries.Retry = gapic_v1.method.DEFAULT,
941+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
940942
timeout: float = None,
941943
metadata: Sequence[Tuple[str, str]] = (),
942944
) -> pagers.ListTargetsPager:
@@ -1016,7 +1018,7 @@ def get_target(
10161018
request: Union[cloud_deploy.GetTargetRequest, dict] = None,
10171019
*,
10181020
name: str = None,
1019-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1021+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10201022
timeout: float = None,
10211023
metadata: Sequence[Tuple[str, str]] = (),
10221024
) -> cloud_deploy.Target:
@@ -1090,7 +1092,7 @@ def create_target(
10901092
parent: str = None,
10911093
target: cloud_deploy.Target = None,
10921094
target_id: str = None,
1093-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1095+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10941096
timeout: float = None,
10951097
metadata: Sequence[Tuple[str, str]] = (),
10961098
) -> operation.Operation:
@@ -1191,7 +1193,7 @@ def update_target(
11911193
*,
11921194
target: cloud_deploy.Target = None,
11931195
update_mask: field_mask_pb2.FieldMask = None,
1194-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1196+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
11951197
timeout: float = None,
11961198
metadata: Sequence[Tuple[str, str]] = (),
11971199
) -> operation.Operation:
@@ -1289,7 +1291,7 @@ def delete_target(
12891291
request: Union[cloud_deploy.DeleteTargetRequest, dict] = None,
12901292
*,
12911293
name: str = None,
1292-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1294+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
12931295
timeout: float = None,
12941296
metadata: Sequence[Tuple[str, str]] = (),
12951297
) -> operation.Operation:
@@ -1382,7 +1384,7 @@ def list_releases(
13821384
request: Union[cloud_deploy.ListReleasesRequest, dict] = None,
13831385
*,
13841386
parent: str = None,
1385-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1387+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
13861388
timeout: float = None,
13871389
metadata: Sequence[Tuple[str, str]] = (),
13881390
) -> pagers.ListReleasesPager:
@@ -1461,7 +1463,7 @@ def get_release(
14611463
request: Union[cloud_deploy.GetReleaseRequest, dict] = None,
14621464
*,
14631465
name: str = None,
1464-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1466+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
14651467
timeout: float = None,
14661468
metadata: Sequence[Tuple[str, str]] = (),
14671469
) -> cloud_deploy.Release:
@@ -1535,7 +1537,7 @@ def create_release(
15351537
parent: str = None,
15361538
release: cloud_deploy.Release = None,
15371539
release_id: str = None,
1538-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1540+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
15391541
timeout: float = None,
15401542
metadata: Sequence[Tuple[str, str]] = (),
15411543
) -> operation.Operation:
@@ -1636,7 +1638,7 @@ def approve_rollout(
16361638
request: Union[cloud_deploy.ApproveRolloutRequest, dict] = None,
16371639
*,
16381640
name: str = None,
1639-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1641+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
16401642
timeout: float = None,
16411643
metadata: Sequence[Tuple[str, str]] = (),
16421644
) -> cloud_deploy.ApproveRolloutResponse:
@@ -1707,7 +1709,7 @@ def list_rollouts(
17071709
request: Union[cloud_deploy.ListRolloutsRequest, dict] = None,
17081710
*,
17091711
parent: str = None,
1710-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1712+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
17111713
timeout: float = None,
17121714
metadata: Sequence[Tuple[str, str]] = (),
17131715
) -> pagers.ListRolloutsPager:
@@ -1787,7 +1789,7 @@ def get_rollout(
17871789
request: Union[cloud_deploy.GetRolloutRequest, dict] = None,
17881790
*,
17891791
name: str = None,
1790-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1792+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
17911793
timeout: float = None,
17921794
metadata: Sequence[Tuple[str, str]] = (),
17931795
) -> cloud_deploy.Rollout:
@@ -1862,7 +1864,7 @@ def create_rollout(
18621864
parent: str = None,
18631865
rollout: cloud_deploy.Rollout = None,
18641866
rollout_id: str = None,
1865-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1867+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
18661868
timeout: float = None,
18671869
metadata: Sequence[Tuple[str, str]] = (),
18681870
) -> operation.Operation:
@@ -1963,7 +1965,7 @@ def get_config(
19631965
request: Union[cloud_deploy.GetConfigRequest, dict] = None,
19641966
*,
19651967
name: str = None,
1966-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1968+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
19671969
timeout: float = None,
19681970
metadata: Sequence[Tuple[str, str]] = (),
19691971
) -> cloud_deploy.Config:

google/cloud/deploy_v1/services/cloud_deploy/transports/base.py

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import abc
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18-
import packaging.version
1918
import pkg_resources
2019

2120
import google.auth # type: ignore
@@ -37,15 +36,6 @@
3736
except pkg_resources.DistributionNotFound:
3837
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
3938

40-
try:
41-
# google.auth.__version__ was added in 1.26.0
42-
_GOOGLE_AUTH_VERSION = google.auth.__version__
43-
except AttributeError:
44-
try: # try pkg_resources if it is available
45-
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
46-
except pkg_resources.DistributionNotFound: # pragma: NO COVER
47-
_GOOGLE_AUTH_VERSION = None
48-
4939

5040
class CloudDeployTransport(abc.ABC):
5141
"""Abstract transport class for CloudDeploy."""
@@ -95,7 +85,7 @@ def __init__(
9585
host += ":443"
9686
self._host = host
9787

98-
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
88+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9989

10090
# Save the scopes.
10191
self._scopes = scopes
@@ -128,29 +118,6 @@ def __init__(
128118
# Save the credentials.
129119
self._credentials = credentials
130120

131-
# TODO(busunkim): This method is in the base transport
132-
# to avoid duplicating code across the transport classes. These functions
133-
# should be deleted once the minimum required versions of google-auth is increased.
134-
135-
# TODO: Remove this function once google-auth >= 1.25.0 is required
136-
@classmethod
137-
def _get_scopes_kwargs(
138-
cls, host: str, scopes: Optional[Sequence[str]]
139-
) -> Dict[str, Optional[Sequence[str]]]:
140-
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""
141-
142-
scopes_kwargs = {}
143-
144-
if _GOOGLE_AUTH_VERSION and (
145-
packaging.version.parse(_GOOGLE_AUTH_VERSION)
146-
>= packaging.version.parse("1.25.0")
147-
):
148-
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
149-
else:
150-
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}
151-
152-
return scopes_kwargs
153-
154121
def _prep_wrapped_messages(self, client_info):
155122
# Precompute the wrapped methods.
156123
self._wrapped_methods = {
@@ -325,7 +292,7 @@ def close(self):
325292
raise NotImplementedError()
326293

327294
@property
328-
def operations_client(self) -> operations_v1.OperationsClient:
295+
def operations_client(self):
329296
"""Return the client designed to process long-running operations."""
330297
raise NotImplementedError()
331298

google/cloud/deploy_v1/services/cloud_deploy/transports/grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(
114114
self._grpc_channel = None
115115
self._ssl_channel_credentials = ssl_channel_credentials
116116
self._stubs: Dict[str, Callable] = {}
117-
self._operations_client = None
117+
self._operations_client: Optional[operations_v1.OperationsClient] = None
118118

119119
if api_mtls_endpoint:
120120
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

google/cloud/deploy_v1/services/cloud_deploy/transports/grpc_asyncio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from google.api_core import operations_v1 # type: ignore
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore
24-
import packaging.version
2524

2625
import grpc # type: ignore
2726
from grpc.experimental import aio # type: ignore
@@ -161,7 +160,7 @@ def __init__(
161160
self._grpc_channel = None
162161
self._ssl_channel_credentials = ssl_channel_credentials
163162
self._stubs: Dict[str, Callable] = {}
164-
self._operations_client = None
163+
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None
165164

166165
if api_mtls_endpoint:
167166
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

google/cloud/deploy_v1/types/cloud_deploy.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class DeliveryPipeline(proto.Message):
7474
A ``DeliveryPipeline`` defines a pipeline through which a Skaffold
7575
configuration can progress.
7676
77+
78+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
79+
7780
Attributes:
7881
name (str):
7982
Optional. Name of the ``DeliveryPipeline``. Format is
@@ -95,8 +98,8 @@ class DeliveryPipeline(proto.Message):
9598
user and by Google Cloud Deploy. Labels must meet the
9699
following constraints: Each resource is limited to 64
97100
labels. Keys must conform to the regexp:
98-
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
99-
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
101+
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
102+
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
100103
additionally constrained to be <= 128 bytes in size.
101104
create_time (google.protobuf.timestamp_pb2.Timestamp):
102105
Output only. Time at which the pipeline was
@@ -107,6 +110,7 @@ class DeliveryPipeline(proto.Message):
107110
serial_pipeline (google.cloud.deploy_v1.types.SerialPipeline):
108111
SerialPipeline defines a sequential set of stages for a
109112
``DeliveryPipeline``.
113+
This field is a member of `oneof`_ ``pipeline``.
110114
condition (google.cloud.deploy_v1.types.PipelineCondition):
111115
Output only. Information around the state of
112116
the Delivery Pipeline.
@@ -453,6 +457,9 @@ class Target(proto.Message):
453457
A ``Target`` defines a location to which a Skaffold configuration
454458
can be deployed.
455459
460+
461+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
462+
456463
Attributes:
457464
name (str):
458465
Optional. Name of the ``Target``. Format is
@@ -476,8 +483,8 @@ class Target(proto.Message):
476483
both the user and by Google Cloud Deploy. Labels must meet
477484
the following constraints: Each resource is limited to 64
478485
labels. Keys must conform to the regexp:
479-
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
480-
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
486+
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
487+
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
481488
additionally constrained to be <= 128 bytes in size.
482489
require_approval (bool):
483490
Optional. Whether or not the ``Target`` requires approval.
@@ -488,6 +495,7 @@ class Target(proto.Message):
488495
updated.
489496
gke (google.cloud.deploy_v1.types.GkeCluster):
490497
Information specifying a GKE Cluster.
498+
This field is a member of `oneof`_ ``deployment_target``.
491499
etag (str):
492500
Optional. This checksum is computed by the
493501
server based on the value of other fields, and
@@ -527,14 +535,23 @@ class ExecutionConfig(proto.Message):
527535
r"""Configuration of the environment to use when calling
528536
Skaffold.
529537
538+
This message has `oneof`_ fields (mutually exclusive fields).
539+
For each oneof, at most one member field can be set at the same time.
540+
Setting any member of the oneof automatically clears all other
541+
members.
542+
543+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
544+
530545
Attributes:
531546
usages (Sequence[google.cloud.deploy_v1.types.ExecutionConfig.ExecutionEnvironmentUsage]):
532547
Required. Usages when this configuration
533548
should be applied.
534549
default_pool (google.cloud.deploy_v1.types.DefaultPool):
535550
Optional. Use default Cloud Build pool.
551+
This field is a member of `oneof`_ ``execution_environment``.
536552
private_pool (google.cloud.deploy_v1.types.PrivatePool):
537553
Optional. Use private Cloud Build pool.
554+
This field is a member of `oneof`_ ``execution_environment``.
538555
"""
539556

540557
class ExecutionEnvironmentUsage(proto.Enum):
@@ -853,8 +870,8 @@ class Release(proto.Message):
853870
user and by Google Cloud Deploy. Labels must meet the
854871
following constraints: Each resource is limited to 64
855872
labels. Keys must conform to the regexp:
856-
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
857-
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
873+
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
874+
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
858875
additionally constrained to be <= 128 bytes in size.
859876
create_time (google.protobuf.timestamp_pb2.Timestamp):
860877
Output only. Time at which the ``Release`` was created.
@@ -988,12 +1005,15 @@ class BuildArtifact(proto.Message):
9881005
class TargetArtifact(proto.Message):
9891006
r"""The artifacts produced by a target render operation.
9901007
1008+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1009+
9911010
Attributes:
9921011
artifact_uri (str):
9931012
Output only. URI of a directory containing
9941013
the artifacts. This contains deployment
9951014
configuration used by Skaffold during a rollout,
9961015
and all paths are relative to this location.
1016+
This field is a member of `oneof`_ ``uri``.
9971017
skaffold_config_path (str):
9981018
Output only. File path of the resolved
9991019
Skaffold configuration relative to the URI.
@@ -1149,8 +1169,8 @@ class Rollout(proto.Message):
11491169
user and by Google Cloud Deploy. Labels must meet the
11501170
following constraints: Each resource is limited to 64
11511171
labels. Keys must conform to the regexp:
1152-
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
1153-
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
1172+
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
1173+
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
11541174
additionally constrained to be <= 128 bytes in size.
11551175
create_time (google.protobuf.timestamp_pb2.Timestamp):
11561176
Output only. Time at which the ``Rollout`` was created.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
3030
# Until this issue is closed
3131
# https://github.com/googleapis/google-cloud-python/issues/10566
32-
"google-api-core[grpc] >= 1.27.0, <3.0.0dev",
32+
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
3333
"proto-plus >= 1.15.0",
34-
"packaging >= 14.3",
3534
]
3635

3736
package_root = os.path.abspath(os.path.dirname(__file__))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy