Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.52.0 (#3)
Browse files Browse the repository at this point in the history
Closes #5

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 399773015

Source-Link: googleapis/googleapis@410c184

Source-Link: googleapis/googleapis-gen@290e883
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjkwZTg4MzU0NWUzYWM5ZmYyYmQwMGNkMGRhY2IyOGYxYjhjYTk0NSJ9

chore(fix): improper types in pagers generation
chore(deps): add dependency google-cloud-common
  • Loading branch information
gcf-owl-bot[bot] authored Oct 2, 2021
1 parent 41bb17b commit 870f660
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.common import operation_metadata_pb2 # type: ignore
from google.cloud.common.types import operation_metadata as operation_metadata_pb2 # type: ignore
from google.cloud.filestore_v1.services.cloud_filestore_manager import pagers
from google.cloud.filestore_v1.types import cloud_filestore_service
from google.protobuf import empty_pb2 # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
Expand All @@ -32,7 +32,7 @@

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.common import operation_metadata_pb2 # type: ignore
from google.cloud.common.types import operation_metadata as operation_metadata_pb2 # type: ignore
from google.cloud.filestore_v1.services.cloud_filestore_manager import pagers
from google.cloud.filestore_v1.types import cloud_filestore_service
from google.protobuf import empty_pb2 # type: ignore
Expand Down Expand Up @@ -400,7 +400,7 @@ def __init__(

def list_instances(
self,
request: cloud_filestore_service.ListInstancesRequest = None,
request: Union[cloud_filestore_service.ListInstancesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -411,7 +411,7 @@ def list_instances(
specified location or for all locations.
Args:
request (google.cloud.filestore_v1.types.ListInstancesRequest):
request (Union[google.cloud.filestore_v1.types.ListInstancesRequest, dict]):
The request object. ListInstancesRequest lists
instances.
parent (str):
Expand Down Expand Up @@ -485,7 +485,7 @@ def list_instances(

def get_instance(
self,
request: cloud_filestore_service.GetInstanceRequest = None,
request: Union[cloud_filestore_service.GetInstanceRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -495,7 +495,7 @@ def get_instance(
r"""Gets the details of a specific instance.
Args:
request (google.cloud.filestore_v1.types.GetInstanceRequest):
request (Union[google.cloud.filestore_v1.types.GetInstanceRequest, dict]):
The request object. GetInstanceRequest gets the state of
an instance.
name (str):
Expand Down Expand Up @@ -554,7 +554,7 @@ def get_instance(

def create_instance(
self,
request: cloud_filestore_service.CreateInstanceRequest = None,
request: Union[cloud_filestore_service.CreateInstanceRequest, dict] = None,
*,
parent: str = None,
instance: cloud_filestore_service.Instance = None,
Expand All @@ -570,7 +570,7 @@ def create_instance(
the minimum capacity of the tier).
Args:
request (google.cloud.filestore_v1.types.CreateInstanceRequest):
request (Union[google.cloud.filestore_v1.types.CreateInstanceRequest, dict]):
The request object. CreateInstanceRequest creates an
instance.
parent (str):
Expand Down Expand Up @@ -663,7 +663,7 @@ def create_instance(

def update_instance(
self,
request: cloud_filestore_service.UpdateInstanceRequest = None,
request: Union[cloud_filestore_service.UpdateInstanceRequest, dict] = None,
*,
instance: cloud_filestore_service.Instance = None,
update_mask: field_mask_pb2.FieldMask = None,
Expand All @@ -674,7 +674,7 @@ def update_instance(
r"""Updates the settings of a specific instance.
Args:
request (google.cloud.filestore_v1.types.UpdateInstanceRequest):
request (Union[google.cloud.filestore_v1.types.UpdateInstanceRequest, dict]):
The request object. UpdateInstanceRequest updates the
settings of an instance.
instance (google.cloud.filestore_v1.types.Instance):
Expand Down Expand Up @@ -760,7 +760,7 @@ def update_instance(

def restore_instance(
self,
request: cloud_filestore_service.RestoreInstanceRequest = None,
request: Union[cloud_filestore_service.RestoreInstanceRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -773,7 +773,7 @@ def restore_instance(
to or larger than the minimum capacity of the tier).
Args:
request (google.cloud.filestore_v1.types.RestoreInstanceRequest):
request (Union[google.cloud.filestore_v1.types.RestoreInstanceRequest, dict]):
The request object. RestoreInstanceRequest restores an
existing instances's file share from a backup.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -825,7 +825,7 @@ def restore_instance(

def delete_instance(
self,
request: cloud_filestore_service.DeleteInstanceRequest = None,
request: Union[cloud_filestore_service.DeleteInstanceRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -835,7 +835,7 @@ def delete_instance(
r"""Deletes an instance.
Args:
request (google.cloud.filestore_v1.types.DeleteInstanceRequest):
request (Union[google.cloud.filestore_v1.types.DeleteInstanceRequest, dict]):
The request object. DeleteInstanceRequest deletes an
instance.
name (str):
Expand Down Expand Up @@ -917,7 +917,7 @@ def delete_instance(

def list_backups(
self,
request: cloud_filestore_service.ListBackupsRequest = None,
request: Union[cloud_filestore_service.ListBackupsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -928,7 +928,7 @@ def list_backups(
location or for all locations.
Args:
request (google.cloud.filestore_v1.types.ListBackupsRequest):
request (Union[google.cloud.filestore_v1.types.ListBackupsRequest, dict]):
The request object. ListBackupsRequest lists backups.
parent (str):
Required. The project and location for which to retrieve
Expand Down Expand Up @@ -1001,7 +1001,7 @@ def list_backups(

def get_backup(
self,
request: cloud_filestore_service.GetBackupRequest = None,
request: Union[cloud_filestore_service.GetBackupRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -1011,7 +1011,7 @@ def get_backup(
r"""Gets the details of a specific backup.
Args:
request (google.cloud.filestore_v1.types.GetBackupRequest):
request (Union[google.cloud.filestore_v1.types.GetBackupRequest, dict]):
The request object. GetBackupRequest gets the state of a
backup.
name (str):
Expand Down Expand Up @@ -1070,7 +1070,7 @@ def get_backup(

def create_backup(
self,
request: cloud_filestore_service.CreateBackupRequest = None,
request: Union[cloud_filestore_service.CreateBackupRequest, dict] = None,
*,
parent: str = None,
backup: cloud_filestore_service.Backup = None,
Expand All @@ -1082,7 +1082,7 @@ def create_backup(
r"""Creates a backup.
Args:
request (google.cloud.filestore_v1.types.CreateBackupRequest):
request (Union[google.cloud.filestore_v1.types.CreateBackupRequest, dict]):
The request object. CreateBackupRequest creates a
backup.
parent (str):
Expand Down Expand Up @@ -1180,7 +1180,7 @@ def create_backup(

def delete_backup(
self,
request: cloud_filestore_service.DeleteBackupRequest = None,
request: Union[cloud_filestore_service.DeleteBackupRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -1190,7 +1190,7 @@ def delete_backup(
r"""Deletes a backup.
Args:
request (google.cloud.filestore_v1.types.DeleteBackupRequest):
request (Union[google.cloud.filestore_v1.types.DeleteBackupRequest, dict]):
The request object. DeleteBackupRequest deletes a
backup.
name (str):
Expand Down Expand Up @@ -1272,7 +1272,7 @@ def delete_backup(

def update_backup(
self,
request: cloud_filestore_service.UpdateBackupRequest = None,
request: Union[cloud_filestore_service.UpdateBackupRequest, dict] = None,
*,
backup: cloud_filestore_service.Backup = None,
update_mask: field_mask_pb2.FieldMask = None,
Expand All @@ -1283,7 +1283,7 @@ def update_backup(
r"""Updates the settings of a specific backup.
Args:
request (google.cloud.filestore_v1.types.UpdateBackupRequest):
request (Union[google.cloud.filestore_v1.types.UpdateBackupRequest, dict]):
The request object. UpdateBackupRequest updates
description and/or labels for a backup.
backup (google.cloud.filestore_v1.types.Backup):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#
from typing import (
Any,
AsyncIterable,
AsyncIterator,
Awaitable,
Callable,
Iterable,
Sequence,
Tuple,
Optional,
Iterator,
)

from google.cloud.filestore_v1.types import cloud_filestore_service
Expand Down Expand Up @@ -74,14 +74,14 @@ def __getattr__(self, name: str) -> Any:
return getattr(self._response, name)

@property
def pages(self) -> Iterable[cloud_filestore_service.ListInstancesResponse]:
def pages(self) -> Iterator[cloud_filestore_service.ListInstancesResponse]:
yield self._response
while self._response.next_page_token:
self._request.page_token = self._response.next_page_token
self._response = self._method(self._request, metadata=self._metadata)
yield self._response

def __iter__(self) -> Iterable[cloud_filestore_service.Instance]:
def __iter__(self) -> Iterator[cloud_filestore_service.Instance]:
for page in self.pages:
yield from page.instances

Expand Down Expand Up @@ -138,14 +138,14 @@ def __getattr__(self, name: str) -> Any:
@property
async def pages(
self,
) -> AsyncIterable[cloud_filestore_service.ListInstancesResponse]:
) -> AsyncIterator[cloud_filestore_service.ListInstancesResponse]:
yield self._response
while self._response.next_page_token:
self._request.page_token = self._response.next_page_token
self._response = await self._method(self._request, metadata=self._metadata)
yield self._response

def __aiter__(self) -> AsyncIterable[cloud_filestore_service.Instance]:
def __aiter__(self) -> AsyncIterator[cloud_filestore_service.Instance]:
async def async_generator():
async for page in self.pages:
for response in page.instances:
Expand Down Expand Up @@ -204,14 +204,14 @@ def __getattr__(self, name: str) -> Any:
return getattr(self._response, name)

@property
def pages(self) -> Iterable[cloud_filestore_service.ListBackupsResponse]:
def pages(self) -> Iterator[cloud_filestore_service.ListBackupsResponse]:
yield self._response
while self._response.next_page_token:
self._request.page_token = self._response.next_page_token
self._response = self._method(self._request, metadata=self._metadata)
yield self._response

def __iter__(self) -> Iterable[cloud_filestore_service.Backup]:
def __iter__(self) -> Iterator[cloud_filestore_service.Backup]:
for page in self.pages:
yield from page.backups

Expand Down Expand Up @@ -266,14 +266,14 @@ def __getattr__(self, name: str) -> Any:
return getattr(self._response, name)

@property
async def pages(self) -> AsyncIterable[cloud_filestore_service.ListBackupsResponse]:
async def pages(self) -> AsyncIterator[cloud_filestore_service.ListBackupsResponse]:
yield self._response
while self._response.next_page_token:
self._request.page_token = self._response.next_page_token
self._response = await self._method(self._request, metadata=self._metadata)
yield self._response

def __aiter__(self) -> AsyncIterable[cloud_filestore_service.Backup]:
def __aiter__(self) -> AsyncIterator[cloud_filestore_service.Backup]:
async def async_generator():
async for page in self.pages:
for response in page.backups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(
**scopes_kwargs, quota_project_id=quota_project_id
)

# If the credentials is service account credentials, then always try to use self signed JWT.
# If the credentials are service account credentials, then always try to use self signed JWT.
if (
always_use_jwt_access
and isinstance(credentials, service_account.Credentials)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ def __init__(
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
If provided, it overrides the ``host`` argument and tries to create
a mutual TLS channel with client SSL credentials from
``client_cert_source`` or applicatin default SSL credentials.
``client_cert_source`` or application default SSL credentials.
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
Deprecated. A callback to provide client SSL certificate bytes and
private key bytes, both in PEM format. It is ignored if
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
for the grpc channel. It is ignored if ``channel`` is provided.
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
A callback to provide client certificate bytes and private key bytes,
both in PEM format. It is used to configure mutual TLS channel. It is
both in PEM format. It is used to configure a mutual TLS channel. It is
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ def __init__(
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
If provided, it overrides the ``host`` argument and tries to create
a mutual TLS channel with client SSL credentials from
``client_cert_source`` or applicatin default SSL credentials.
``client_cert_source`` or application default SSL credentials.
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
Deprecated. A callback to provide client SSL certificate bytes and
private key bytes, both in PEM format. It is ignored if
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
for the grpc channel. It is ignored if ``channel`` is provided.
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
A callback to provide client certificate bytes and private key bytes,
both in PEM format. It is used to configure mutual TLS channel. It is
both in PEM format. It is used to configure a mutual TLS channel. It is
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
Expand Down
6 changes: 6 additions & 0 deletions packages/google-cloud-filestore/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
default_version = "v1"

for library in s.get_staging_dirs(default_version):
s.replace(
library / "**/*.py",
"from google.cloud.common import operation_metadata_pb2",
"from google.cloud.common.types import operation_metadata as operation_metadata_pb2",
)

s.move(library, excludes=["setup.py", "README.rst", "docs/index.rst"])
s.remove_staging_dirs()

Expand Down
Loading

0 comments on commit 870f660

Please sign in to comment.