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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#176)
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 41919bc commit 84914d5
Show file tree
Hide file tree
Showing 76 changed files with 489 additions and 1,747 deletions.
34 changes: 18 additions & 16 deletions google/cloud/talent_v4/services/company_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.talent_v4.services.company_service import pagers
from google.cloud.talent_v4.types import common
from google.cloud.talent_v4.types import company
Expand Down Expand Up @@ -171,18 +173,18 @@ def __init__(

async def create_company(
self,
request: company_service.CreateCompanyRequest = None,
request: Union[company_service.CreateCompanyRequest, dict] = None,
*,
parent: str = None,
company: gct_company.Company = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> gct_company.Company:
r"""Creates a new company entity.
Args:
request (:class:`google.cloud.talent_v4.types.CreateCompanyRequest`):
request (Union[google.cloud.talent_v4.types.CreateCompanyRequest, dict]):
The request object. The Request of the CreateCompany
method.
parent (:class:`str`):
Expand Down Expand Up @@ -258,17 +260,17 @@ async def create_company(

async def get_company(
self,
request: company_service.GetCompanyRequest = None,
request: Union[company_service.GetCompanyRequest, 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]] = (),
) -> company.Company:
r"""Retrieves specified company.
Args:
request (:class:`google.cloud.talent_v4.types.GetCompanyRequest`):
request (Union[google.cloud.talent_v4.types.GetCompanyRequest, dict]):
The request object. Request for getting a company by
name.
name (:class:`str`):
Expand Down Expand Up @@ -348,18 +350,18 @@ async def get_company(

async def update_company(
self,
request: company_service.UpdateCompanyRequest = None,
request: Union[company_service.UpdateCompanyRequest, dict] = None,
*,
company: gct_company.Company = 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]] = (),
) -> gct_company.Company:
r"""Updates specified company.
Args:
request (:class:`google.cloud.talent_v4.types.UpdateCompanyRequest`):
request (Union[google.cloud.talent_v4.types.UpdateCompanyRequest, dict]):
The request object. Request for updating a specified
company.
company (:class:`google.cloud.talent_v4.types.Company`):
Expand Down Expand Up @@ -445,10 +447,10 @@ async def update_company(

async def delete_company(
self,
request: company_service.DeleteCompanyRequest = None,
request: Union[company_service.DeleteCompanyRequest, 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]] = (),
) -> None:
Expand All @@ -457,7 +459,7 @@ async def delete_company(
it.
Args:
request (:class:`google.cloud.talent_v4.types.DeleteCompanyRequest`):
request (Union[google.cloud.talent_v4.types.DeleteCompanyRequest, dict]):
The request object. Request to delete a company.
name (:class:`str`):
Required. The resource name of the company to be
Expand Down Expand Up @@ -524,17 +526,17 @@ async def delete_company(

async def list_companies(
self,
request: company_service.ListCompaniesRequest = None,
request: Union[company_service.ListCompaniesRequest, 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.ListCompaniesAsyncPager:
r"""Lists all companies associated with the project.
Args:
request (:class:`google.cloud.talent_v4.types.ListCompaniesRequest`):
request (Union[google.cloud.talent_v4.types.ListCompaniesRequest, dict]):
The request object. List companies for which the client
has ACL visibility.
parent (:class:`str`):
Expand Down
12 changes: 7 additions & 5 deletions google/cloud/talent_v4/services/company_service/client.py
Original file line number Diff line number Diff line change
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.cloud.talent_v4.services.company_service import pagers
from google.cloud.talent_v4.types import common
from google.cloud.talent_v4.types import company
Expand Down Expand Up @@ -372,7 +374,7 @@ def create_company(
*,
parent: str = None,
company: gct_company.Company = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> gct_company.Company:
Expand Down Expand Up @@ -458,7 +460,7 @@ def get_company(
request: Union[company_service.GetCompanyRequest, 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]] = (),
) -> company.Company:
Expand Down Expand Up @@ -539,7 +541,7 @@ def update_company(
*,
company: gct_company.Company = 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]] = (),
) -> gct_company.Company:
Expand Down Expand Up @@ -635,7 +637,7 @@ def delete_company(
request: Union[company_service.DeleteCompanyRequest, 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]] = (),
) -> None:
Expand Down Expand Up @@ -704,7 +706,7 @@ def list_companies(
request: Union[company_service.ListCompaniesRequest, 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.ListCompaniesPager:
Expand Down
Original file line number Diff line number Diff line change
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 @@ -38,15 +37,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 CompanyServiceTransport(abc.ABC):
"""Abstract transport class for CompanyService."""
Expand Down Expand Up @@ -99,7 +89,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 @@ -132,29 +122,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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # 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
10 changes: 6 additions & 4 deletions google/cloud/talent_v4/services/completion/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.talent_v4.types import common
from google.cloud.talent_v4.types import completion_service
from .transports.base import CompletionTransport, DEFAULT_CLIENT_INFO
Expand Down Expand Up @@ -159,9 +161,9 @@ def __init__(

async def complete_query(
self,
request: completion_service.CompleteQueryRequest = None,
request: Union[completion_service.CompleteQueryRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> completion_service.CompleteQueryResponse:
Expand All @@ -170,7 +172,7 @@ async def complete_query(
complete search box.
Args:
request (:class:`google.cloud.talent_v4.types.CompleteQueryRequest`):
request (Union[google.cloud.talent_v4.types.CompleteQueryRequest, dict]):
The request object. Auto-complete parameters.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down
4 changes: 3 additions & 1 deletion google/cloud/talent_v4/services/completion/client.py
Original file line number Diff line number Diff line change
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.cloud.talent_v4.types import common
from google.cloud.talent_v4.types import completion_service
from .transports.base import CompletionTransport, DEFAULT_CLIENT_INFO
Expand Down Expand Up @@ -362,7 +364,7 @@ def complete_query(
self,
request: Union[completion_service.CompleteQueryRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> completion_service.CompleteQueryResponse:
Expand Down
35 changes: 1 addition & 34 deletions google/cloud/talent_v4/services/completion/transports/base.py
Original file line number Diff line number Diff line change
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 @@ -35,15 +34,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 CompletionTransport(abc.ABC):
"""Abstract transport class for Completion."""
Expand Down Expand Up @@ -96,7 +86,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 @@ -129,29 +119,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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # 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
Loading

0 comments on commit 84914d5

Please sign in to comment.