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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#20)
Browse files Browse the repository at this point in the history
- [ ] 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: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent 8bf3167 commit 17baf34
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 203 deletions.
112 changes: 57 additions & 55 deletions google/cloud/deploy_v1/services/cloud_deploy/async_client.py

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions google/cloud/deploy_v1/services/cloud_deploy/client.py
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.deploy_v1.services.cloud_deploy import pagers
Expand Down Expand Up @@ -482,7 +484,7 @@ def list_delivery_pipelines(
request: Union[cloud_deploy.ListDeliveryPipelinesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListDeliveryPipelinesPager:
Expand Down Expand Up @@ -563,7 +565,7 @@ def get_delivery_pipeline(
request: Union[cloud_deploy.GetDeliveryPipelineRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.DeliveryPipeline:
Expand Down Expand Up @@ -640,7 +642,7 @@ def create_delivery_pipeline(
parent: str = None,
delivery_pipeline: cloud_deploy.DeliveryPipeline = None,
delivery_pipeline_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -743,7 +745,7 @@ def update_delivery_pipeline(
*,
delivery_pipeline: cloud_deploy.DeliveryPipeline = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -843,7 +845,7 @@ def delete_delivery_pipeline(
request: Union[cloud_deploy.DeleteDeliveryPipelineRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -936,7 +938,7 @@ def list_targets(
request: Union[cloud_deploy.ListTargetsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTargetsPager:
Expand Down Expand Up @@ -1016,7 +1018,7 @@ def get_target(
request: Union[cloud_deploy.GetTargetRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.Target:
Expand Down Expand Up @@ -1090,7 +1092,7 @@ def create_target(
parent: str = None,
target: cloud_deploy.Target = None,
target_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1191,7 +1193,7 @@ def update_target(
*,
target: cloud_deploy.Target = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1289,7 +1291,7 @@ def delete_target(
request: Union[cloud_deploy.DeleteTargetRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1382,7 +1384,7 @@ def list_releases(
request: Union[cloud_deploy.ListReleasesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListReleasesPager:
Expand Down Expand Up @@ -1461,7 +1463,7 @@ def get_release(
request: Union[cloud_deploy.GetReleaseRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.Release:
Expand Down Expand Up @@ -1535,7 +1537,7 @@ def create_release(
parent: str = None,
release: cloud_deploy.Release = None,
release_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1636,7 +1638,7 @@ def approve_rollout(
request: Union[cloud_deploy.ApproveRolloutRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.ApproveRolloutResponse:
Expand Down Expand Up @@ -1707,7 +1709,7 @@ def list_rollouts(
request: Union[cloud_deploy.ListRolloutsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListRolloutsPager:
Expand Down Expand Up @@ -1787,7 +1789,7 @@ def get_rollout(
request: Union[cloud_deploy.GetRolloutRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.Rollout:
Expand Down Expand Up @@ -1862,7 +1864,7 @@ def create_rollout(
parent: str = None,
rollout: cloud_deploy.Rollout = None,
rollout_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1963,7 +1965,7 @@ def get_config(
request: Union[cloud_deploy.GetConfigRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_deploy.Config:
Expand Down
37 changes: 2 additions & 35 deletions google/cloud/deploy_v1/services/cloud_deploy/transports/base.py
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

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

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class CloudDeployTransport(abc.ABC):
"""Abstract transport class for CloudDeploy."""
Expand Down Expand Up @@ -95,7 +85,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -128,29 +118,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down Expand Up @@ -325,7 +292,7 @@ def close(self):
raise NotImplementedError()

@property
def operations_client(self) -> operations_v1.OperationsClient:
def operations_client(self):
"""Return the client designed to process long-running operations."""
raise NotImplementedError()

Expand Down
Expand Up @@ -114,7 +114,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
Expand Up @@ -21,7 +21,6 @@
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down Expand Up @@ -161,7 +160,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
36 changes: 28 additions & 8 deletions google/cloud/deploy_v1/types/cloud_deploy.py
Expand Up @@ -74,6 +74,9 @@ class DeliveryPipeline(proto.Message):
A ``DeliveryPipeline`` defines a pipeline through which a Skaffold
configuration can progress.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
name (str):
Optional. Name of the ``DeliveryPipeline``. Format is
Expand All @@ -95,8 +98,8 @@ class DeliveryPipeline(proto.Message):
user and by Google Cloud Deploy. Labels must meet the
following constraints: Each resource is limited to 64
labels. Keys must conform to the regexp:
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
additionally constrained to be <= 128 bytes in size.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Time at which the pipeline was
Expand All @@ -107,6 +110,7 @@ class DeliveryPipeline(proto.Message):
serial_pipeline (google.cloud.deploy_v1.types.SerialPipeline):
SerialPipeline defines a sequential set of stages for a
``DeliveryPipeline``.
This field is a member of `oneof`_ ``pipeline``.
condition (google.cloud.deploy_v1.types.PipelineCondition):
Output only. Information around the state of
the Delivery Pipeline.
Expand Down Expand Up @@ -453,6 +457,9 @@ class Target(proto.Message):
A ``Target`` defines a location to which a Skaffold configuration
can be deployed.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
name (str):
Optional. Name of the ``Target``. Format is
Expand All @@ -476,8 +483,8 @@ class Target(proto.Message):
both the user and by Google Cloud Deploy. Labels must meet
the following constraints: Each resource is limited to 64
labels. Keys must conform to the regexp:
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
additionally constrained to be <= 128 bytes in size.
require_approval (bool):
Optional. Whether or not the ``Target`` requires approval.
Expand All @@ -488,6 +495,7 @@ class Target(proto.Message):
updated.
gke (google.cloud.deploy_v1.types.GkeCluster):
Information specifying a GKE Cluster.
This field is a member of `oneof`_ ``deployment_target``.
etag (str):
Optional. This checksum is computed by the
server based on the value of other fields, and
Expand Down Expand Up @@ -527,14 +535,23 @@ class ExecutionConfig(proto.Message):
r"""Configuration of the environment to use when calling
Skaffold.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
usages (Sequence[google.cloud.deploy_v1.types.ExecutionConfig.ExecutionEnvironmentUsage]):
Required. Usages when this configuration
should be applied.
default_pool (google.cloud.deploy_v1.types.DefaultPool):
Optional. Use default Cloud Build pool.
This field is a member of `oneof`_ ``execution_environment``.
private_pool (google.cloud.deploy_v1.types.PrivatePool):
Optional. Use private Cloud Build pool.
This field is a member of `oneof`_ ``execution_environment``.
"""

class ExecutionEnvironmentUsage(proto.Enum):
Expand Down Expand Up @@ -853,8 +870,8 @@ class Release(proto.Message):
user and by Google Cloud Deploy. Labels must meet the
following constraints: Each resource is limited to 64
labels. Keys must conform to the regexp:
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
additionally constrained to be <= 128 bytes in size.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Time at which the ``Release`` was created.
Expand Down Expand Up @@ -988,12 +1005,15 @@ class BuildArtifact(proto.Message):
class TargetArtifact(proto.Message):
r"""The artifacts produced by a target render operation.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
artifact_uri (str):
Output only. URI of a directory containing
the artifacts. This contains deployment
configuration used by Skaffold during a rollout,
and all paths are relative to this location.
This field is a member of `oneof`_ ``uri``.
skaffold_config_path (str):
Output only. File path of the resolved
Skaffold configuration relative to the URI.
Expand Down Expand Up @@ -1149,8 +1169,8 @@ class Rollout(proto.Message):
user and by Google Cloud Deploy. Labels must meet the
following constraints: Each resource is limited to 64
labels. Keys must conform to the regexp:
``[a-zA-Z][a-zA-Z0-9\_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9\_-]{0,63}``. Both keys and values are
``[a-zA-Z][a-zA-Z0-9_-]{0,62}``. Values must conform to the
regexp: ``[a-zA-Z0-9_-]{0,63}``. Both keys and values are
additionally constrained to be <= 128 bytes in size.
create_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Time at which the ``Rollout`` was created.
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -29,9 +29,8 @@
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
# Until this issue is closed
# https://github.com/googleapis/google-cloud-python/issues/10566
"google-api-core[grpc] >= 1.27.0, <3.0.0dev",
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
"proto-plus >= 1.15.0",
"packaging >= 14.3",
]

package_root = os.path.abspath(os.path.dirname(__file__))
Expand Down

0 comments on commit 17baf34

Please sign in to comment.