diff --git a/.flake8 b/.flake8 index 29227d4c..2e438749 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 87dd0061..757c9dca 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 00000000..311ebbb8 --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 00000000..41bff0b5 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +requestsize: + enabled: true diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb8..238b87b9 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a77..46d23716 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ebc4b4..585bebd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ [1]: https://pypi.org/project/google-cloud-talent/#history +## [2.6.0](https://github.com/googleapis/python-talent/compare/v2.5.2...v2.6.0) (2022-06-06) + + +### Features + +* Add a new operator on companyDisplayNames filter to further support fuzzy match by treating input value as a multi word token ([#248](https://github.com/googleapis/python-talent/issues/248)) ([aeab3a0](https://github.com/googleapis/python-talent/commit/aeab3a023ae19f313f7ea8e75d7e48fbb784fbcc)) +* Add a new option TELECOMMUTE_JOBS_EXCLUDED under enum TelecommutePreference to completely filter out the telecommute jobs in response ([aeab3a0](https://github.com/googleapis/python-talent/commit/aeab3a023ae19f313f7ea8e75d7e48fbb784fbcc)) + + +### Bug Fixes + +* **deps:** require protobuf <4.0.0dev ([#251](https://github.com/googleapis/python-talent/issues/251)) ([75b11a6](https://github.com/googleapis/python-talent/commit/75b11a6cbb8a872d6766d0aa31d97efc765318cd)) + + +### Documentation + +* Deprecate option TELECOMMUTE_EXCLUDED under enum TelecommutePreference ([aeab3a0](https://github.com/googleapis/python-talent/commit/aeab3a023ae19f313f7ea8e75d7e48fbb784fbcc)) + ### [2.5.2](https://github.com/googleapis/python-talent/compare/v2.5.1...v2.5.2) (2022-03-29) diff --git a/docs/conf.py b/docs/conf.py index 7d020712..d9877db1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/google/cloud/talent/__init__.py b/google/cloud/talent/__init__.py index 40c7b53a..128ead7f 100644 --- a/google/cloud/talent/__init__.py +++ b/google/cloud/talent/__init__.py @@ -14,88 +14,97 @@ # limitations under the License. # -from google.cloud.talent_v4.services.company_service.client import CompanyServiceClient from google.cloud.talent_v4.services.company_service.async_client import ( CompanyServiceAsyncClient, ) -from google.cloud.talent_v4.services.completion.client import CompletionClient +from google.cloud.talent_v4.services.company_service.client import CompanyServiceClient from google.cloud.talent_v4.services.completion.async_client import ( CompletionAsyncClient, ) -from google.cloud.talent_v4.services.event_service.client import EventServiceClient +from google.cloud.talent_v4.services.completion.client import CompletionClient from google.cloud.talent_v4.services.event_service.async_client import ( EventServiceAsyncClient, ) -from google.cloud.talent_v4.services.job_service.client import JobServiceClient +from google.cloud.talent_v4.services.event_service.client import EventServiceClient from google.cloud.talent_v4.services.job_service.async_client import ( JobServiceAsyncClient, ) -from google.cloud.talent_v4.services.tenant_service.client import TenantServiceClient +from google.cloud.talent_v4.services.job_service.client import JobServiceClient from google.cloud.talent_v4.services.tenant_service.async_client import ( TenantServiceAsyncClient, ) - -from google.cloud.talent_v4.types.common import BatchOperationMetadata -from google.cloud.talent_v4.types.common import CompensationInfo -from google.cloud.talent_v4.types.common import CustomAttribute -from google.cloud.talent_v4.types.common import DeviceInfo -from google.cloud.talent_v4.types.common import Location -from google.cloud.talent_v4.types.common import RequestMetadata -from google.cloud.talent_v4.types.common import ResponseMetadata -from google.cloud.talent_v4.types.common import SpellingCorrection -from google.cloud.talent_v4.types.common import TimestampRange -from google.cloud.talent_v4.types.common import CommuteMethod -from google.cloud.talent_v4.types.common import CompanySize -from google.cloud.talent_v4.types.common import DegreeType -from google.cloud.talent_v4.types.common import EmploymentType -from google.cloud.talent_v4.types.common import HtmlSanitization -from google.cloud.talent_v4.types.common import JobBenefit -from google.cloud.talent_v4.types.common import JobCategory -from google.cloud.talent_v4.types.common import JobLevel -from google.cloud.talent_v4.types.common import PostingRegion -from google.cloud.talent_v4.types.common import Visibility +from google.cloud.talent_v4.services.tenant_service.client import TenantServiceClient +from google.cloud.talent_v4.types.common import ( + BatchOperationMetadata, + CommuteMethod, + CompanySize, + CompensationInfo, + CustomAttribute, + DegreeType, + DeviceInfo, + EmploymentType, + HtmlSanitization, + JobBenefit, + JobCategory, + JobLevel, + Location, + PostingRegion, + RequestMetadata, + ResponseMetadata, + SpellingCorrection, + TimestampRange, + Visibility, +) from google.cloud.talent_v4.types.company import Company -from google.cloud.talent_v4.types.company_service import CreateCompanyRequest -from google.cloud.talent_v4.types.company_service import DeleteCompanyRequest -from google.cloud.talent_v4.types.company_service import GetCompanyRequest -from google.cloud.talent_v4.types.company_service import ListCompaniesRequest -from google.cloud.talent_v4.types.company_service import ListCompaniesResponse -from google.cloud.talent_v4.types.company_service import UpdateCompanyRequest -from google.cloud.talent_v4.types.completion_service import CompleteQueryRequest -from google.cloud.talent_v4.types.completion_service import CompleteQueryResponse -from google.cloud.talent_v4.types.event import ClientEvent -from google.cloud.talent_v4.types.event import JobEvent +from google.cloud.talent_v4.types.company_service import ( + CreateCompanyRequest, + DeleteCompanyRequest, + GetCompanyRequest, + ListCompaniesRequest, + ListCompaniesResponse, + UpdateCompanyRequest, +) +from google.cloud.talent_v4.types.completion_service import ( + CompleteQueryRequest, + CompleteQueryResponse, +) +from google.cloud.talent_v4.types.event import ClientEvent, JobEvent from google.cloud.talent_v4.types.event_service import CreateClientEventRequest -from google.cloud.talent_v4.types.filters import CommuteFilter -from google.cloud.talent_v4.types.filters import CompensationFilter -from google.cloud.talent_v4.types.filters import JobQuery -from google.cloud.talent_v4.types.filters import LocationFilter -from google.cloud.talent_v4.types.histogram import HistogramQuery -from google.cloud.talent_v4.types.histogram import HistogramQueryResult +from google.cloud.talent_v4.types.filters import ( + CommuteFilter, + CompensationFilter, + JobQuery, + LocationFilter, +) +from google.cloud.talent_v4.types.histogram import HistogramQuery, HistogramQueryResult from google.cloud.talent_v4.types.job import Job -from google.cloud.talent_v4.types.job_service import BatchCreateJobsRequest -from google.cloud.talent_v4.types.job_service import BatchCreateJobsResponse -from google.cloud.talent_v4.types.job_service import BatchDeleteJobsRequest -from google.cloud.talent_v4.types.job_service import BatchDeleteJobsResponse -from google.cloud.talent_v4.types.job_service import BatchUpdateJobsRequest -from google.cloud.talent_v4.types.job_service import BatchUpdateJobsResponse -from google.cloud.talent_v4.types.job_service import CreateJobRequest -from google.cloud.talent_v4.types.job_service import DeleteJobRequest -from google.cloud.talent_v4.types.job_service import GetJobRequest -from google.cloud.talent_v4.types.job_service import JobResult -from google.cloud.talent_v4.types.job_service import ListJobsRequest -from google.cloud.talent_v4.types.job_service import ListJobsResponse -from google.cloud.talent_v4.types.job_service import SearchJobsRequest -from google.cloud.talent_v4.types.job_service import SearchJobsResponse -from google.cloud.talent_v4.types.job_service import UpdateJobRequest -from google.cloud.talent_v4.types.job_service import JobView +from google.cloud.talent_v4.types.job_service import ( + BatchCreateJobsRequest, + BatchCreateJobsResponse, + BatchDeleteJobsRequest, + BatchDeleteJobsResponse, + BatchUpdateJobsRequest, + BatchUpdateJobsResponse, + CreateJobRequest, + DeleteJobRequest, + GetJobRequest, + JobResult, + JobView, + ListJobsRequest, + ListJobsResponse, + SearchJobsRequest, + SearchJobsResponse, + UpdateJobRequest, +) from google.cloud.talent_v4.types.tenant import Tenant -from google.cloud.talent_v4.types.tenant_service import CreateTenantRequest -from google.cloud.talent_v4.types.tenant_service import DeleteTenantRequest -from google.cloud.talent_v4.types.tenant_service import GetTenantRequest -from google.cloud.talent_v4.types.tenant_service import ListTenantsRequest -from google.cloud.talent_v4.types.tenant_service import ListTenantsResponse -from google.cloud.talent_v4.types.tenant_service import UpdateTenantRequest +from google.cloud.talent_v4.types.tenant_service import ( + CreateTenantRequest, + DeleteTenantRequest, + GetTenantRequest, + ListTenantsRequest, + ListTenantsResponse, + UpdateTenantRequest, +) __all__ = ( "CompanyServiceClient", diff --git a/google/cloud/talent_v4/__init__.py b/google/cloud/talent_v4/__init__.py index 8c60c340..0253937b 100644 --- a/google/cloud/talent_v4/__init__.py +++ b/google/cloud/talent_v4/__init__.py @@ -14,78 +14,74 @@ # limitations under the License. # -from .services.company_service import CompanyServiceClient -from .services.company_service import CompanyServiceAsyncClient -from .services.completion import CompletionClient -from .services.completion import CompletionAsyncClient -from .services.event_service import EventServiceClient -from .services.event_service import EventServiceAsyncClient -from .services.job_service import JobServiceClient -from .services.job_service import JobServiceAsyncClient -from .services.tenant_service import TenantServiceClient -from .services.tenant_service import TenantServiceAsyncClient - -from .types.common import BatchOperationMetadata -from .types.common import CompensationInfo -from .types.common import CustomAttribute -from .types.common import DeviceInfo -from .types.common import Location -from .types.common import RequestMetadata -from .types.common import ResponseMetadata -from .types.common import SpellingCorrection -from .types.common import TimestampRange -from .types.common import CommuteMethod -from .types.common import CompanySize -from .types.common import DegreeType -from .types.common import EmploymentType -from .types.common import HtmlSanitization -from .types.common import JobBenefit -from .types.common import JobCategory -from .types.common import JobLevel -from .types.common import PostingRegion -from .types.common import Visibility +from .services.company_service import CompanyServiceAsyncClient, CompanyServiceClient +from .services.completion import CompletionAsyncClient, CompletionClient +from .services.event_service import EventServiceAsyncClient, EventServiceClient +from .services.job_service import JobServiceAsyncClient, JobServiceClient +from .services.tenant_service import TenantServiceAsyncClient, TenantServiceClient +from .types.common import ( + BatchOperationMetadata, + CommuteMethod, + CompanySize, + CompensationInfo, + CustomAttribute, + DegreeType, + DeviceInfo, + EmploymentType, + HtmlSanitization, + JobBenefit, + JobCategory, + JobLevel, + Location, + PostingRegion, + RequestMetadata, + ResponseMetadata, + SpellingCorrection, + TimestampRange, + Visibility, +) from .types.company import Company -from .types.company_service import CreateCompanyRequest -from .types.company_service import DeleteCompanyRequest -from .types.company_service import GetCompanyRequest -from .types.company_service import ListCompaniesRequest -from .types.company_service import ListCompaniesResponse -from .types.company_service import UpdateCompanyRequest -from .types.completion_service import CompleteQueryRequest -from .types.completion_service import CompleteQueryResponse -from .types.event import ClientEvent -from .types.event import JobEvent +from .types.company_service import ( + CreateCompanyRequest, + DeleteCompanyRequest, + GetCompanyRequest, + ListCompaniesRequest, + ListCompaniesResponse, + UpdateCompanyRequest, +) +from .types.completion_service import CompleteQueryRequest, CompleteQueryResponse +from .types.event import ClientEvent, JobEvent from .types.event_service import CreateClientEventRequest -from .types.filters import CommuteFilter -from .types.filters import CompensationFilter -from .types.filters import JobQuery -from .types.filters import LocationFilter -from .types.histogram import HistogramQuery -from .types.histogram import HistogramQueryResult +from .types.filters import CommuteFilter, CompensationFilter, JobQuery, LocationFilter +from .types.histogram import HistogramQuery, HistogramQueryResult from .types.job import Job -from .types.job_service import BatchCreateJobsRequest -from .types.job_service import BatchCreateJobsResponse -from .types.job_service import BatchDeleteJobsRequest -from .types.job_service import BatchDeleteJobsResponse -from .types.job_service import BatchUpdateJobsRequest -from .types.job_service import BatchUpdateJobsResponse -from .types.job_service import CreateJobRequest -from .types.job_service import DeleteJobRequest -from .types.job_service import GetJobRequest -from .types.job_service import JobResult -from .types.job_service import ListJobsRequest -from .types.job_service import ListJobsResponse -from .types.job_service import SearchJobsRequest -from .types.job_service import SearchJobsResponse -from .types.job_service import UpdateJobRequest -from .types.job_service import JobView +from .types.job_service import ( + BatchCreateJobsRequest, + BatchCreateJobsResponse, + BatchDeleteJobsRequest, + BatchDeleteJobsResponse, + BatchUpdateJobsRequest, + BatchUpdateJobsResponse, + CreateJobRequest, + DeleteJobRequest, + GetJobRequest, + JobResult, + JobView, + ListJobsRequest, + ListJobsResponse, + SearchJobsRequest, + SearchJobsResponse, + UpdateJobRequest, +) from .types.tenant import Tenant -from .types.tenant_service import CreateTenantRequest -from .types.tenant_service import DeleteTenantRequest -from .types.tenant_service import GetTenantRequest -from .types.tenant_service import ListTenantsRequest -from .types.tenant_service import ListTenantsResponse -from .types.tenant_service import UpdateTenantRequest +from .types.tenant_service import ( + CreateTenantRequest, + DeleteTenantRequest, + GetTenantRequest, + ListTenantsRequest, + ListTenantsResponse, + UpdateTenantRequest, +) __all__ = ( "CompanyServiceAsyncClient", diff --git a/google/cloud/talent_v4/services/company_service/__init__.py b/google/cloud/talent_v4/services/company_service/__init__.py index 499d74d4..045ec5d4 100644 --- a/google/cloud/talent_v4/services/company_service/__init__.py +++ b/google/cloud/talent_v4/services/company_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CompanyServiceClient from .async_client import CompanyServiceAsyncClient +from .client import CompanyServiceClient __all__ = ( "CompanyServiceClient", diff --git a/google/cloud/talent_v4/services/company_service/async_client.py b/google/cloud/talent_v4/services/company_service/async_client.py index 8c150161..a33ed454 100644 --- a/google/cloud/talent_v4/services/company_service/async_client.py +++ b/google/cloud/talent_v4/services/company_service/async_client.py @@ -16,30 +16,32 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore + 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 from google.cloud.talent_v4.types import company as gct_company from google.cloud.talent_v4.types import company_service -from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import CompanyServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport + from .client import CompanyServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, CompanyServiceTransport +from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport class CompanyServiceAsyncClient: @@ -226,9 +228,9 @@ async def create_company( from google.cloud import talent_v4 - def sample_create_company(): + async def sample_create_company(): # Create a client - client = talent_v4.CompanyServiceClient() + client = talent_v4.CompanyServiceAsyncClient() # Initialize request argument(s) company = talent_v4.Company() @@ -241,7 +243,7 @@ def sample_create_company(): ) # Make the request - response = client.create_company(request=request) + response = await client.create_company(request=request) # Handle the response print(response) @@ -341,9 +343,9 @@ async def get_company( from google.cloud import talent_v4 - def sample_get_company(): + async def sample_get_company(): # Create a client - client = talent_v4.CompanyServiceClient() + client = talent_v4.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4.GetCompanyRequest( @@ -351,7 +353,7 @@ def sample_get_company(): ) # Make the request - response = client.get_company(request=request) + response = await client.get_company(request=request) # Handle the response print(response) @@ -456,9 +458,9 @@ async def update_company( from google.cloud import talent_v4 - def sample_update_company(): + async def sample_update_company(): # Create a client - client = talent_v4.CompanyServiceClient() + client = talent_v4.CompanyServiceAsyncClient() # Initialize request argument(s) company = talent_v4.Company() @@ -470,7 +472,7 @@ def sample_update_company(): ) # Make the request - response = client.update_company(request=request) + response = await client.update_company(request=request) # Handle the response print(response) @@ -578,14 +580,13 @@ async def delete_company( Prerequisite: The company has no jobs associated with it. - .. code-block:: python from google.cloud import talent_v4 - def sample_delete_company(): + async def sample_delete_company(): # Create a client - client = talent_v4.CompanyServiceClient() + client = talent_v4.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4.DeleteCompanyRequest( @@ -593,7 +594,7 @@ def sample_delete_company(): ) # Make the request - client.delete_company(request=request) + await client.delete_company(request=request) Args: request (Union[google.cloud.talent_v4.types.DeleteCompanyRequest, dict]): @@ -679,9 +680,9 @@ async def list_companies( from google.cloud import talent_v4 - def sample_list_companies(): + async def sample_list_companies(): # Create a client - client = talent_v4.CompanyServiceClient() + client = talent_v4.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4.ListCompaniesRequest( @@ -692,7 +693,7 @@ def sample_list_companies(): page_result = client.list_companies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4/services/company_service/client.py b/google/cloud/talent_v4/services/company_service/client.py index b253b267..e850016b 100644 --- a/google/cloud/talent_v4/services/company_service/client.py +++ b/google/cloud/talent_v4/services/company_service/client.py @@ -16,31 +16,33 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore + 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 from google.cloud.talent_v4.types import company as gct_company from google.cloud.talent_v4.types import company_service -from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, CompanyServiceTransport from .transports.grpc import CompanyServiceGrpcTransport from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport @@ -807,7 +809,6 @@ def delete_company( Prerequisite: The company has no jobs associated with it. - .. code-block:: python from google.cloud import talent_v4 diff --git a/google/cloud/talent_v4/services/company_service/pagers.py b/google/cloud/talent_v4/services/company_service/pagers.py index bb3e0e6e..bdc2e3bf 100644 --- a/google/cloud/talent_v4/services/company_service/pagers.py +++ b/google/cloud/talent_v4/services/company_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4.types import company -from google.cloud.talent_v4.types import company_service +from google.cloud.talent_v4.types import company, company_service class ListCompaniesPager: diff --git a/google/cloud/talent_v4/services/company_service/transports/__init__.py b/google/cloud/talent_v4/services/company_service/transports/__init__.py index 40885605..66f5d7ba 100644 --- a/google/cloud/talent_v4/services/company_service/transports/__init__.py +++ b/google/cloud/talent_v4/services/company_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CompanyServiceGrpcTransport from .grpc_asyncio import CompanyServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CompanyServiceTransport]] _transport_registry["grpc"] = CompanyServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/company_service/transports/base.py b/google/cloud/talent_v4/services/company_service/transports/base.py index 73f6828b..e67abf0b 100644 --- a/google/cloud/talent_v4/services/company_service/transports/base.py +++ b/google/cloud/talent_v4/services/company_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4.types import company from google.cloud.talent_v4.types import company as gct_company from google.cloud.talent_v4.types import company_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -240,5 +241,9 @@ def list_companies( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CompanyServiceTransport",) diff --git a/google/cloud/talent_v4/services/company_service/transports/grpc.py b/google/cloud/talent_v4/services/company_service/transports/grpc.py index b54271f1..410b5d4d 100644 --- a/google/cloud/talent_v4/services/company_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/company_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4.types import company from google.cloud.talent_v4.types import company as gct_company from google.cloud.talent_v4.types import company_service -from google.protobuf import empty_pb2 # type: ignore -from .base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompanyServiceTransport class CompanyServiceGrpcTransport(CompanyServiceTransport): @@ -368,5 +367,9 @@ def list_companies( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CompanyServiceGrpcTransport",) diff --git a/google/cloud/talent_v4/services/company_service/transports/grpc_asyncio.py b/google/cloud/talent_v4/services/company_service/transports/grpc_asyncio.py index 0455ec8c..38ac77b9 100644 --- a/google/cloud/talent_v4/services/company_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4/services/company_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4.types import company from google.cloud.talent_v4.types import company as gct_company from google.cloud.talent_v4.types import company_service -from google.protobuf import empty_pb2 # type: ignore -from .base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompanyServiceTransport from .grpc import CompanyServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/completion/__init__.py b/google/cloud/talent_v4/services/completion/__init__.py index 998d1060..2880c509 100644 --- a/google/cloud/talent_v4/services/completion/__init__.py +++ b/google/cloud/talent_v4/services/completion/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CompletionClient from .async_client import CompletionAsyncClient +from .client import CompletionClient __all__ = ( "CompletionClient", diff --git a/google/cloud/talent_v4/services/completion/async_client.py b/google/cloud/talent_v4/services/completion/async_client.py index 43358219..1ae67f96 100644 --- a/google/cloud/talent_v4/services/completion/async_client.py +++ b/google/cloud/talent_v4/services/completion/async_client.py @@ -16,26 +16,26 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -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 -from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport +from google.cloud.talent_v4.types import common, completion_service + from .client import CompletionClient +from .transports.base import DEFAULT_CLIENT_INFO, CompletionTransport +from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport class CompletionAsyncClient: @@ -210,14 +210,13 @@ async def complete_query( suggestions. Intended for use by a job search auto-complete search box. - .. code-block:: python from google.cloud import talent_v4 - def sample_complete_query(): + async def sample_complete_query(): # Create a client - client = talent_v4.CompletionClient() + client = talent_v4.CompletionAsyncClient() # Initialize request argument(s) request = talent_v4.CompleteQueryRequest( @@ -227,7 +226,7 @@ def sample_complete_query(): ) # Make the request - response = client.complete_query(request=request) + response = await client.complete_query(request=request) # Handle the response print(response) diff --git a/google/cloud/talent_v4/services/completion/client.py b/google/cloud/talent_v4/services/completion/client.py index 44c94dd7..100a2956 100644 --- a/google/cloud/talent_v4/services/completion/client.py +++ b/google/cloud/talent_v4/services/completion/client.py @@ -16,27 +16,27 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -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 +from google.cloud.talent_v4.types import common, completion_service + +from .transports.base import DEFAULT_CLIENT_INFO, CompletionTransport from .transports.grpc import CompletionGrpcTransport from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport @@ -453,7 +453,6 @@ def complete_query( suggestions. Intended for use by a job search auto-complete search box. - .. code-block:: python from google.cloud import talent_v4 diff --git a/google/cloud/talent_v4/services/completion/transports/__init__.py b/google/cloud/talent_v4/services/completion/transports/__init__.py index e3da6795..187001a3 100644 --- a/google/cloud/talent_v4/services/completion/transports/__init__.py +++ b/google/cloud/talent_v4/services/completion/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CompletionGrpcTransport from .grpc_asyncio import CompletionGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CompletionTransport]] _transport_registry["grpc"] = CompletionGrpcTransport diff --git a/google/cloud/talent_v4/services/completion/transports/base.py b/google/cloud/talent_v4/services/completion/transports/base.py index aefdac63..28f59a49 100644 --- a/google/cloud/talent_v4/services/completion/transports/base.py +++ b/google/cloud/talent_v4/services/completion/transports/base.py @@ -15,15 +15,15 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources from google.cloud.talent_v4.types import completion_service @@ -83,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -161,5 +162,9 @@ def complete_query( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CompletionTransport",) diff --git a/google/cloud/talent_v4/services/completion/transports/grpc.py b/google/cloud/talent_v4/services/completion/transports/grpc.py index 804bc357..15f044a1 100644 --- a/google/cloud/talent_v4/services/completion/transports/grpc.py +++ b/google/cloud/talent_v4/services/completion/transports/grpc.py @@ -13,19 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from google.cloud.talent_v4.types import completion_service -from .base import CompletionTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompletionTransport class CompletionGrpcTransport(CompletionTransport): @@ -261,5 +260,9 @@ def complete_query( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CompletionGrpcTransport",) diff --git a/google/cloud/talent_v4/services/completion/transports/grpc_asyncio.py b/google/cloud/talent_v4/services/completion/transports/grpc_asyncio.py index c8f6ab25..ba3c3149 100644 --- a/google/cloud/talent_v4/services/completion/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4/services/completion/transports/grpc_asyncio.py @@ -13,19 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4.types import completion_service -from .base import CompletionTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompletionTransport from .grpc import CompletionGrpcTransport diff --git a/google/cloud/talent_v4/services/event_service/__init__.py b/google/cloud/talent_v4/services/event_service/__init__.py index 32ddeddc..a3fd326d 100644 --- a/google/cloud/talent_v4/services/event_service/__init__.py +++ b/google/cloud/talent_v4/services/event_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import EventServiceClient from .async_client import EventServiceAsyncClient +from .client import EventServiceClient __all__ = ( "EventServiceClient", diff --git a/google/cloud/talent_v4/services/event_service/async_client.py b/google/cloud/talent_v4/services/event_service/async_client.py index 55d111c0..bc74ed49 100644 --- a/google/cloud/talent_v4/services/event_service/async_client.py +++ b/google/cloud/talent_v4/services/event_service/async_client.py @@ -16,27 +16,28 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import EventServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport + +from google.cloud.talent_v4.types import event, event_service + from .client import EventServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, EventServiceTransport +from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport class EventServiceAsyncClient: @@ -217,14 +218,13 @@ async def create_client_event( more `__ about self service tools. - .. code-block:: python from google.cloud import talent_v4 - def sample_create_client_event(): + async def sample_create_client_event(): # Create a client - client = talent_v4.EventServiceClient() + client = talent_v4.EventServiceAsyncClient() # Initialize request argument(s) client_event = talent_v4.ClientEvent() @@ -238,7 +238,7 @@ def sample_create_client_event(): ) # Make the request - response = client.create_client_event(request=request) + response = await client.create_client_event(request=request) # Handle the response print(response) diff --git a/google/cloud/talent_v4/services/event_service/client.py b/google/cloud/talent_v4/services/event_service/client.py index 2aa3962f..5f72f913 100644 --- a/google/cloud/talent_v4/services/event_service/client.py +++ b/google/cloud/talent_v4/services/event_service/client.py @@ -16,28 +16,29 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import EventServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.talent_v4.types import event, event_service + +from .transports.base import DEFAULT_CLIENT_INFO, EventServiceTransport from .transports.grpc import EventServiceGrpcTransport from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport @@ -438,7 +439,6 @@ def create_client_event( more `__ about self service tools. - .. code-block:: python from google.cloud import talent_v4 diff --git a/google/cloud/talent_v4/services/event_service/transports/__init__.py b/google/cloud/talent_v4/services/event_service/transports/__init__.py index 6b72ca4d..5c44f457 100644 --- a/google/cloud/talent_v4/services/event_service/transports/__init__.py +++ b/google/cloud/talent_v4/services/event_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import EventServiceGrpcTransport from .grpc_asyncio import EventServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[EventServiceTransport]] _transport_registry["grpc"] = EventServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/event_service/transports/base.py b/google/cloud/talent_v4/services/event_service/transports/base.py index f4989503..53e2ce85 100644 --- a/google/cloud/talent_v4/services/event_service/transports/base.py +++ b/google/cloud/talent_v4/services/event_service/transports/base.py @@ -15,18 +15,17 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service +from google.cloud.talent_v4.types import event, event_service try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -84,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -149,5 +149,9 @@ def create_client_event( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("EventServiceTransport",) diff --git a/google/cloud/talent_v4/services/event_service/transports/grpc.py b/google/cloud/talent_v4/services/event_service/transports/grpc.py index a1e570c9..4cfd5091 100644 --- a/google/cloud/talent_v4/services/event_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/event_service/transports/grpc.py @@ -13,20 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service -from .base import EventServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.talent_v4.types import event, event_service + +from .base import DEFAULT_CLIENT_INFO, EventServiceTransport class EventServiceGrpcTransport(EventServiceTransport): @@ -263,5 +261,9 @@ def create_client_event( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("EventServiceGrpcTransport",) diff --git a/google/cloud/talent_v4/services/event_service/transports/grpc_asyncio.py b/google/cloud/talent_v4/services/event_service/transports/grpc_asyncio.py index d4cd9de5..5f71048b 100644 --- a/google/cloud/talent_v4/services/event_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4/services/event_service/transports/grpc_asyncio.py @@ -13,20 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service -from .base import EventServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.talent_v4.types import event, event_service + +from .base import DEFAULT_CLIENT_INFO, EventServiceTransport from .grpc import EventServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/job_service/__init__.py b/google/cloud/talent_v4/services/job_service/__init__.py index 3d885808..56f42874 100644 --- a/google/cloud/talent_v4/services/job_service/__init__.py +++ b/google/cloud/talent_v4/services/job_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import JobServiceClient from .async_client import JobServiceAsyncClient +from .client import JobServiceClient __all__ = ( "JobServiceClient", diff --git a/google/cloud/talent_v4/services/job_service/async_client.py b/google/cloud/talent_v4/services/job_service/async_client.py index 01d1f768..5ee005b6 100644 --- a/google/cloud/talent_v4/services/job_service/async_client.py +++ b/google/cloud/talent_v4/services/job_service/async_client.py @@ -16,15 +16,15 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,17 +33,18 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.talent_v4.services.job_service import pagers -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import histogram +from google.cloud.talent_v4.types import common, histogram from google.cloud.talent_v4.types import job from google.cloud.talent_v4.types import job as gct_job from google.cloud.talent_v4.types import job_service -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport + from .client import JobServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, JobServiceTransport +from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport class JobServiceAsyncClient: @@ -224,14 +225,13 @@ async def create_job( Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 - def sample_create_job(): + async def sample_create_job(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) job = talent_v4.Job() @@ -246,7 +246,7 @@ def sample_create_job(): ) # Make the request - response = client.create_job(request=request) + response = await client.create_job(request=request) # Handle the response print(response) @@ -344,9 +344,9 @@ async def batch_create_jobs( from google.cloud import talent_v4 - def sample_batch_create_jobs(): + async def sample_batch_create_jobs(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) jobs = talent_v4.Job() @@ -365,7 +365,7 @@ def sample_batch_create_jobs(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -472,14 +472,13 @@ async def get_job( r"""Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. - .. code-block:: python from google.cloud import talent_v4 - def sample_get_job(): + async def sample_get_job(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.GetJobRequest( @@ -487,7 +486,7 @@ def sample_get_job(): ) # Make the request - response = client.get_job(request=request) + response = await client.get_job(request=request) # Handle the response print(response) @@ -586,14 +585,13 @@ async def update_job( results within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 - def sample_update_job(): + async def sample_update_job(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) job = talent_v4.Job() @@ -607,7 +605,7 @@ def sample_update_job(): ) # Make the request - response = client.update_job(request=request) + response = await client.update_job(request=request) # Handle the response print(response) @@ -710,9 +708,9 @@ async def batch_update_jobs( from google.cloud import talent_v4 - def sample_batch_update_jobs(): + async def sample_batch_update_jobs(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) jobs = talent_v4.Job() @@ -731,7 +729,7 @@ def sample_batch_update_jobs(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -839,14 +837,13 @@ async def delete_job( Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 - def sample_delete_job(): + async def sample_delete_job(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.DeleteJobRequest( @@ -854,7 +851,7 @@ def sample_delete_job(): ) # Make the request - client.delete_job(request=request) + await client.delete_job(request=request) Args: request (Union[google.cloud.talent_v4.types.DeleteJobRequest, dict]): @@ -940,9 +937,9 @@ async def batch_delete_jobs( from google.cloud import talent_v4 - def sample_batch_delete_jobs(): + async def sample_batch_delete_jobs(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.BatchDeleteJobsRequest( @@ -954,7 +951,7 @@ def sample_batch_delete_jobs(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1072,9 +1069,9 @@ async def list_jobs( from google.cloud import talent_v4 - def sample_list_jobs(): + async def sample_list_jobs(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.ListJobsRequest( @@ -1086,7 +1083,7 @@ def sample_list_jobs(): page_result = client.list_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1228,14 +1225,13 @@ async def search_jobs( present in the database, and only returns jobs that the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4 - def sample_search_jobs(): + async def sample_search_jobs(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.SearchJobsRequest( @@ -1243,7 +1239,7 @@ def sample_search_jobs(): ) # Make the request - response = client.search_jobs(request=request) + response = await client.search_jobs(request=request) # Handle the response print(response) @@ -1312,14 +1308,13 @@ async def search_jobs_for_alert( present in the database, and only returns jobs the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4 - def sample_search_jobs_for_alert(): + async def sample_search_jobs_for_alert(): # Create a client - client = talent_v4.JobServiceClient() + client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.SearchJobsRequest( @@ -1327,7 +1322,7 @@ def sample_search_jobs_for_alert(): ) # Make the request - response = client.search_jobs_for_alert(request=request) + response = await client.search_jobs_for_alert(request=request) # Handle the response print(response) diff --git a/google/cloud/talent_v4/services/job_service/client.py b/google/cloud/talent_v4/services/job_service/client.py index cc8bca50..2210ca24 100644 --- a/google/cloud/talent_v4/services/job_service/client.py +++ b/google/cloud/talent_v4/services/job_service/client.py @@ -16,18 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,15 +36,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.talent_v4.services.job_service import pagers -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import histogram +from google.cloud.talent_v4.types import common, histogram from google.cloud.talent_v4.types import job from google.cloud.talent_v4.types import job as gct_job from google.cloud.talent_v4.types import job_service -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, JobServiceTransport from .transports.grpc import JobServiceGrpcTransport from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport @@ -487,7 +488,6 @@ def create_job( Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 @@ -735,7 +735,6 @@ def get_job( r"""Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. - .. code-block:: python from google.cloud import talent_v4 @@ -839,7 +838,6 @@ def update_job( results within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 @@ -1092,7 +1090,6 @@ def delete_job( Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4 @@ -1461,7 +1458,6 @@ def search_jobs( present in the database, and only returns jobs that the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4 @@ -1546,7 +1542,6 @@ def search_jobs_for_alert( present in the database, and only returns jobs the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4 diff --git a/google/cloud/talent_v4/services/job_service/pagers.py b/google/cloud/talent_v4/services/job_service/pagers.py index 91c4eb4e..675f51d4 100644 --- a/google/cloud/talent_v4/services/job_service/pagers.py +++ b/google/cloud/talent_v4/services/job_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4.types import job -from google.cloud.talent_v4.types import job_service +from google.cloud.talent_v4.types import job, job_service class ListJobsPager: diff --git a/google/cloud/talent_v4/services/job_service/transports/__init__.py b/google/cloud/talent_v4/services/job_service/transports/__init__.py index bb641d64..58f50acc 100644 --- a/google/cloud/talent_v4/services/job_service/transports/__init__.py +++ b/google/cloud/talent_v4/services/job_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import JobServiceGrpcTransport from .grpc_asyncio import JobServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[JobServiceTransport]] _transport_registry["grpc"] = JobServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/job_service/transports/base.py b/google/cloud/talent_v4/services/job_service/transports/base.py index f8032b20..da0e24f1 100644 --- a/google/cloud/talent_v4/services/job_service/transports/base.py +++ b/google/cloud/talent_v4/services/job_service/transports/base.py @@ -15,22 +15,21 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4.types import job from google.cloud.talent_v4.types import job as gct_job from google.cloud.talent_v4.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -88,6 +87,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -313,5 +313,9 @@ def search_jobs_for_alert( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("JobServiceTransport",) diff --git a/google/cloud/talent_v4/services/job_service/transports/grpc.py b/google/cloud/talent_v4/services/job_service/transports/grpc.py index 5054d204..08b1d87f 100644 --- a/google/cloud/talent_v4/services/job_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/job_service/transports/grpc.py @@ -13,24 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4.types import job from google.cloud.talent_v4.types import job as gct_job from google.cloud.talent_v4.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, JobServiceTransport class JobServiceGrpcTransport(JobServiceTransport): @@ -529,5 +527,9 @@ def search_jobs_for_alert( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("JobServiceGrpcTransport",) diff --git a/google/cloud/talent_v4/services/job_service/transports/grpc_asyncio.py b/google/cloud/talent_v4/services/job_service/transports/grpc_asyncio.py index d78598cd..e18c49d0 100644 --- a/google/cloud/talent_v4/services/job_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4/services/job_service/transports/grpc_asyncio.py @@ -13,24 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.api_core import operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4.types import job from google.cloud.talent_v4.types import job as gct_job from google.cloud.talent_v4.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, JobServiceTransport from .grpc import JobServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/tenant_service/__init__.py b/google/cloud/talent_v4/services/tenant_service/__init__.py index e7e4e302..f89e5b38 100644 --- a/google/cloud/talent_v4/services/tenant_service/__init__.py +++ b/google/cloud/talent_v4/services/tenant_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import TenantServiceClient from .async_client import TenantServiceAsyncClient +from .client import TenantServiceClient __all__ = ( "TenantServiceClient", diff --git a/google/cloud/talent_v4/services/tenant_service/async_client.py b/google/cloud/talent_v4/services/tenant_service/async_client.py index 8bde14b7..b127f7d3 100644 --- a/google/cloud/talent_v4/services/tenant_service/async_client.py +++ b/google/cloud/talent_v4/services/tenant_service/async_client.py @@ -16,29 +16,31 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore + from google.cloud.talent_v4.services.tenant_service import pagers from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import TenantServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport + from .client import TenantServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, TenantServiceTransport +from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport class TenantServiceAsyncClient: @@ -223,9 +225,9 @@ async def create_tenant( from google.cloud import talent_v4 - def sample_create_tenant(): + async def sample_create_tenant(): # Create a client - client = talent_v4.TenantServiceClient() + client = talent_v4.TenantServiceAsyncClient() # Initialize request argument(s) tenant = talent_v4.Tenant() @@ -237,7 +239,7 @@ def sample_create_tenant(): ) # Make the request - response = client.create_tenant(request=request) + response = await client.create_tenant(request=request) # Handle the response print(response) @@ -337,9 +339,9 @@ async def get_tenant( from google.cloud import talent_v4 - def sample_get_tenant(): + async def sample_get_tenant(): # Create a client - client = talent_v4.TenantServiceClient() + client = talent_v4.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4.GetTenantRequest( @@ -347,7 +349,7 @@ def sample_get_tenant(): ) # Make the request - response = client.get_tenant(request=request) + response = await client.get_tenant(request=request) # Handle the response print(response) @@ -452,9 +454,9 @@ async def update_tenant( from google.cloud import talent_v4 - def sample_update_tenant(): + async def sample_update_tenant(): # Create a client - client = talent_v4.TenantServiceClient() + client = talent_v4.TenantServiceAsyncClient() # Initialize request argument(s) tenant = talent_v4.Tenant() @@ -465,7 +467,7 @@ def sample_update_tenant(): ) # Make the request - response = client.update_tenant(request=request) + response = await client.update_tenant(request=request) # Handle the response print(response) @@ -576,9 +578,9 @@ async def delete_tenant( from google.cloud import talent_v4 - def sample_delete_tenant(): + async def sample_delete_tenant(): # Create a client - client = talent_v4.TenantServiceClient() + client = talent_v4.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4.DeleteTenantRequest( @@ -586,7 +588,7 @@ def sample_delete_tenant(): ) # Make the request - client.delete_tenant(request=request) + await client.delete_tenant(request=request) Args: request (Union[google.cloud.talent_v4.types.DeleteTenantRequest, dict]): @@ -671,9 +673,9 @@ async def list_tenants( from google.cloud import talent_v4 - def sample_list_tenants(): + async def sample_list_tenants(): # Create a client - client = talent_v4.TenantServiceClient() + client = talent_v4.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4.ListTenantsRequest( @@ -684,7 +686,7 @@ def sample_list_tenants(): page_result = client.list_tenants(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4/services/tenant_service/client.py b/google/cloud/talent_v4/services/tenant_service/client.py index 45525be8..56fe233a 100644 --- a/google/cloud/talent_v4/services/tenant_service/client.py +++ b/google/cloud/talent_v4/services/tenant_service/client.py @@ -16,30 +16,32 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore + from google.cloud.talent_v4.services.tenant_service import pagers from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, TenantServiceTransport from .transports.grpc import TenantServiceGrpcTransport from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport diff --git a/google/cloud/talent_v4/services/tenant_service/pagers.py b/google/cloud/talent_v4/services/tenant_service/pagers.py index 98812270..22de788f 100644 --- a/google/cloud/talent_v4/services/tenant_service/pagers.py +++ b/google/cloud/talent_v4/services/tenant_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4.types import tenant -from google.cloud.talent_v4.types import tenant_service +from google.cloud.talent_v4.types import tenant, tenant_service class ListTenantsPager: diff --git a/google/cloud/talent_v4/services/tenant_service/transports/__init__.py b/google/cloud/talent_v4/services/tenant_service/transports/__init__.py index ca79f6cc..752911d6 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/__init__.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import TenantServiceGrpcTransport from .grpc_asyncio import TenantServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[TenantServiceTransport]] _transport_registry["grpc"] = TenantServiceGrpcTransport diff --git a/google/cloud/talent_v4/services/tenant_service/transports/base.py b/google/cloud/talent_v4/services/tenant_service/transports/base.py index 5a27b67e..e19cd228 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/base.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -240,5 +241,9 @@ def list_tenants( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("TenantServiceTransport",) diff --git a/google/cloud/talent_v4/services/tenant_service/transports/grpc.py b/google/cloud/talent_v4/services/tenant_service/transports/grpc.py index 4b60c231..3ca6b64b 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore -from .base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, TenantServiceTransport class TenantServiceGrpcTransport(TenantServiceTransport): @@ -364,5 +363,9 @@ def list_tenants( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("TenantServiceGrpcTransport",) diff --git a/google/cloud/talent_v4/services/tenant_service/transports/grpc_asyncio.py b/google/cloud/talent_v4/services/tenant_service/transports/grpc_asyncio.py index 4d4eee48..ce003f04 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore -from .base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, TenantServiceTransport from .grpc import TenantServiceGrpcTransport diff --git a/google/cloud/talent_v4/types/__init__.py b/google/cloud/talent_v4/types/__init__.py index 74bd5168..2aaa3283 100644 --- a/google/cloud/talent_v4/types/__init__.py +++ b/google/cloud/talent_v4/types/__init__.py @@ -15,23 +15,23 @@ # from .common import ( BatchOperationMetadata, - CompensationInfo, - CustomAttribute, - DeviceInfo, - Location, - RequestMetadata, - ResponseMetadata, - SpellingCorrection, - TimestampRange, CommuteMethod, CompanySize, + CompensationInfo, + CustomAttribute, DegreeType, + DeviceInfo, EmploymentType, HtmlSanitization, JobBenefit, JobCategory, JobLevel, + Location, PostingRegion, + RequestMetadata, + ResponseMetadata, + SpellingCorrection, + TimestampRange, Visibility, ) from .company import Company @@ -43,25 +43,11 @@ ListCompaniesResponse, UpdateCompanyRequest, ) -from .completion_service import ( - CompleteQueryRequest, - CompleteQueryResponse, -) -from .event import ( - ClientEvent, - JobEvent, -) +from .completion_service import CompleteQueryRequest, CompleteQueryResponse +from .event import ClientEvent, JobEvent from .event_service import CreateClientEventRequest -from .filters import ( - CommuteFilter, - CompensationFilter, - JobQuery, - LocationFilter, -) -from .histogram import ( - HistogramQuery, - HistogramQueryResult, -) +from .filters import CommuteFilter, CompensationFilter, JobQuery, LocationFilter +from .histogram import HistogramQuery, HistogramQueryResult from .job import Job from .job_service import ( BatchCreateJobsRequest, @@ -74,12 +60,12 @@ DeleteJobRequest, GetJobRequest, JobResult, + JobView, ListJobsRequest, ListJobsResponse, SearchJobsRequest, SearchJobsResponse, UpdateJobRequest, - JobView, ) from .tenant import Tenant from .tenant_service import ( diff --git a/google/cloud/talent_v4/types/common.py b/google/cloud/talent_v4/types/common.py index 1f0946df..34774d2b 100644 --- a/google/cloud/talent_v4/types/common.py +++ b/google/cloud/talent_v4/types/common.py @@ -13,14 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import money_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.talent.v4", diff --git a/google/cloud/talent_v4/types/company.py b/google/cloud/talent_v4/types/company.py index 0b9497bc..1783fc47 100644 --- a/google/cloud/talent_v4/types/company.py +++ b/google/cloud/talent_v4/types/company.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4.types import common - __protobuf__ = proto.module( package="google.cloud.talent.v4", manifest={ diff --git a/google/cloud/talent_v4/types/company_service.py b/google/cloud/talent_v4/types/company_service.py index 3f4d7338..acc4c9e7 100644 --- a/google/cloud/talent_v4/types/company_service.py +++ b/google/cloud/talent_v4/types/company_service.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4.types import common from google.cloud.talent_v4.types import company as gct_company -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4", diff --git a/google/cloud/talent_v4/types/completion_service.py b/google/cloud/talent_v4/types/completion_service.py index 5f7f0a4f..f582b0a6 100644 --- a/google/cloud/talent_v4/types/completion_service.py +++ b/google/cloud/talent_v4/types/completion_service.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4.types import common - __protobuf__ = proto.module( package="google.cloud.talent.v4", manifest={ diff --git a/google/cloud/talent_v4/types/event.py b/google/cloud/talent_v4/types/event.py index f7f2d1ee..d8ae957a 100644 --- a/google/cloud/talent_v4/types/event.py +++ b/google/cloud/talent_v4/types/event.py @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.talent.v4", diff --git a/google/cloud/talent_v4/types/event_service.py b/google/cloud/talent_v4/types/event_service.py index dcd8ec08..00fbfe8d 100644 --- a/google/cloud/talent_v4/types/event_service.py +++ b/google/cloud/talent_v4/types/event_service.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4.types import event - __protobuf__ = proto.module( package="google.cloud.talent.v4", manifest={ diff --git a/google/cloud/talent_v4/types/filters.py b/google/cloud/talent_v4/types/filters.py index 4f6a368b..6c67a48d 100644 --- a/google/cloud/talent_v4/types/filters.py +++ b/google/cloud/talent_v4/types/filters.py @@ -13,13 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4.types import common from google.protobuf import duration_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import timeofday_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4.types import common __protobuf__ = proto.module( package="google.cloud.talent.v4", @@ -111,14 +110,22 @@ class JobQuery(proto.Message): This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] of the jobs to search against. The company name must match - the value exactly (case sensitive). + the value exactly. + + Alternatively, the value being searched for can be wrapped + in different match operators. ``SUBSTRING_MATCH([value])`` + The company name must contain a case insensitive substring + match of the value. Using this function may increase + latency. + + Sample Value: ``SUBSTRING_MATCH(google)`` - Alternatively, if the value being searched for is wrapped in - ``SUBSTRING_MATCH([value])``, the company name must contain - a case insensitive substring match of the value. Using this + ``MULTI_WORD_TOKEN_MATCH([value])`` The value will be + treated as a multi word token and the company name must + contain a case insensitive match of the value. Using this function may increase latency. - Sample Values: ``["Google LLC", "SUBSTRING_MATCH(google)"]`` + Sample Value: ``MULTI_WORD_TOKEN_MATCH(google)`` If a value isn't specified, jobs within the search results are associated with any company. @@ -302,7 +309,7 @@ class LocationFilter(proto.Message): telecommute_preference (google.cloud.talent_v4.types.LocationFilter.TelecommutePreference): Allows the client to return jobs without a set location, specifically, telecommuting jobs (telecommuting is - considered by the service as a special location. + considered by the service as a special location). [Job.posting_region][google.cloud.talent.v4.Job.posting_region] indicates if a job permits telecommuting. If this field is set to @@ -337,6 +344,7 @@ class TelecommutePreference(proto.Enum): TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 TELECOMMUTE_EXCLUDED = 1 TELECOMMUTE_ALLOWED = 2 + TELECOMMUTE_JOBS_EXCLUDED = 3 address = proto.Field( proto.STRING, diff --git a/google/cloud/talent_v4/types/histogram.py b/google/cloud/talent_v4/types/histogram.py index 3e0650e9..9dd54572 100644 --- a/google/cloud/talent_v4/types/histogram.py +++ b/google/cloud/talent_v4/types/histogram.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4", manifest={ @@ -52,7 +51,7 @@ class HistogramQueryResult(proto.Message): Attributes: histogram_query (str): Requested histogram expression. - histogram (Sequence[google.cloud.talent_v4.types.HistogramQueryResult.HistogramEntry]): + histogram (Mapping[str, int]): A map from the values of the facet associated with distinct values to the number of matching entries with corresponding value. diff --git a/google/cloud/talent_v4/types/job.py b/google/cloud/talent_v4/types/job.py index c983bcbd..65a547f1 100644 --- a/google/cloud/talent_v4/types/job.py +++ b/google/cloud/talent_v4/types/job.py @@ -13,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4.types import common -from google.protobuf import timestamp_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4", @@ -132,7 +131,7 @@ class Job(proto.Message): Job compensation information (a.k.a. "pay rate") i.e., the compensation that will paid to the employee. - custom_attributes (Sequence[google.cloud.talent_v4.types.Job.CustomAttributesEntry]): + custom_attributes (Mapping[str, google.cloud.talent_v4.types.CustomAttribute]): A map of fields to hold both filterable and non-filterable custom job attributes that are not covered by the provided structured fields. diff --git a/google/cloud/talent_v4/types/job_service.py b/google/cloud/talent_v4/types/job_service.py index 889403c9..5f48bc28 100644 --- a/google/cloud/talent_v4/types/job_service.py +++ b/google/cloud/talent_v4/types/job_service.py @@ -13,16 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import filters -from google.cloud.talent_v4.types import histogram -from google.cloud.talent_v4.types import job as gct_job from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4.types import common, filters, histogram +from google.cloud.talent_v4.types import job as gct_job __protobuf__ = proto.module( package="google.cloud.talent.v4", diff --git a/google/cloud/talent_v4/types/tenant.py b/google/cloud/talent_v4/types/tenant.py index aeab18c9..7c4309a9 100644 --- a/google/cloud/talent_v4/types/tenant.py +++ b/google/cloud/talent_v4/types/tenant.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4", manifest={ diff --git a/google/cloud/talent_v4/types/tenant_service.py b/google/cloud/talent_v4/types/tenant_service.py index eed43ef8..30bd814c 100644 --- a/google/cloud/talent_v4/types/tenant_service.py +++ b/google/cloud/talent_v4/types/tenant_service.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4.types import common from google.cloud.talent_v4.types import tenant as gct_tenant -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4", diff --git a/google/cloud/talent_v4beta1/__init__.py b/google/cloud/talent_v4beta1/__init__.py index 4914e860..740e2f47 100644 --- a/google/cloud/talent_v4beta1/__init__.py +++ b/google/cloud/talent_v4beta1/__init__.py @@ -14,132 +14,139 @@ # limitations under the License. # -from .services.application_service import ApplicationServiceClient -from .services.application_service import ApplicationServiceAsyncClient -from .services.company_service import CompanyServiceClient -from .services.company_service import CompanyServiceAsyncClient -from .services.completion import CompletionClient -from .services.completion import CompletionAsyncClient -from .services.event_service import EventServiceClient -from .services.event_service import EventServiceAsyncClient -from .services.job_service import JobServiceClient -from .services.job_service import JobServiceAsyncClient -from .services.profile_service import ProfileServiceClient -from .services.profile_service import ProfileServiceAsyncClient -from .services.tenant_service import TenantServiceClient -from .services.tenant_service import TenantServiceAsyncClient - +from .services.application_service import ( + ApplicationServiceAsyncClient, + ApplicationServiceClient, +) +from .services.company_service import CompanyServiceAsyncClient, CompanyServiceClient +from .services.completion import CompletionAsyncClient, CompletionClient +from .services.event_service import EventServiceAsyncClient, EventServiceClient +from .services.job_service import JobServiceAsyncClient, JobServiceClient +from .services.profile_service import ProfileServiceAsyncClient, ProfileServiceClient +from .services.tenant_service import TenantServiceAsyncClient, TenantServiceClient from .types.application import Application -from .types.application_service import CreateApplicationRequest -from .types.application_service import DeleteApplicationRequest -from .types.application_service import GetApplicationRequest -from .types.application_service import ListApplicationsRequest -from .types.application_service import ListApplicationsResponse -from .types.application_service import UpdateApplicationRequest -from .types.common import BatchOperationMetadata -from .types.common import Certification -from .types.common import CompensationInfo -from .types.common import CustomAttribute -from .types.common import DeviceInfo -from .types.common import Interview -from .types.common import Location -from .types.common import Rating -from .types.common import RequestMetadata -from .types.common import ResponseMetadata -from .types.common import Skill -from .types.common import SpellingCorrection -from .types.common import TimestampRange -from .types.common import AvailabilitySignalType -from .types.common import CommuteMethod -from .types.common import CompanySize -from .types.common import ContactInfoUsage -from .types.common import DegreeType -from .types.common import EmploymentType -from .types.common import HtmlSanitization -from .types.common import JobBenefit -from .types.common import JobCategory -from .types.common import JobLevel -from .types.common import Outcome -from .types.common import PostingRegion -from .types.common import SkillProficiencyLevel -from .types.common import Visibility +from .types.application_service import ( + CreateApplicationRequest, + DeleteApplicationRequest, + GetApplicationRequest, + ListApplicationsRequest, + ListApplicationsResponse, + UpdateApplicationRequest, +) +from .types.common import ( + AvailabilitySignalType, + BatchOperationMetadata, + Certification, + CommuteMethod, + CompanySize, + CompensationInfo, + ContactInfoUsage, + CustomAttribute, + DegreeType, + DeviceInfo, + EmploymentType, + HtmlSanitization, + Interview, + JobBenefit, + JobCategory, + JobLevel, + Location, + Outcome, + PostingRegion, + Rating, + RequestMetadata, + ResponseMetadata, + Skill, + SkillProficiencyLevel, + SpellingCorrection, + TimestampRange, + Visibility, +) from .types.company import Company -from .types.company_service import CreateCompanyRequest -from .types.company_service import DeleteCompanyRequest -from .types.company_service import GetCompanyRequest -from .types.company_service import ListCompaniesRequest -from .types.company_service import ListCompaniesResponse -from .types.company_service import UpdateCompanyRequest -from .types.completion_service import CompleteQueryRequest -from .types.completion_service import CompleteQueryResponse -from .types.event import ClientEvent -from .types.event import JobEvent -from .types.event import ProfileEvent +from .types.company_service import ( + CreateCompanyRequest, + DeleteCompanyRequest, + GetCompanyRequest, + ListCompaniesRequest, + ListCompaniesResponse, + UpdateCompanyRequest, +) +from .types.completion_service import CompleteQueryRequest, CompleteQueryResponse +from .types.event import ClientEvent, JobEvent, ProfileEvent from .types.event_service import CreateClientEventRequest -from .types.filters import ApplicationDateFilter -from .types.filters import ApplicationJobFilter -from .types.filters import ApplicationOutcomeNotesFilter -from .types.filters import AvailabilityFilter -from .types.filters import CandidateAvailabilityFilter -from .types.filters import CommuteFilter -from .types.filters import CompensationFilter -from .types.filters import EducationFilter -from .types.filters import EmployerFilter -from .types.filters import JobQuery -from .types.filters import JobTitleFilter -from .types.filters import LocationFilter -from .types.filters import PersonNameFilter -from .types.filters import ProfileQuery -from .types.filters import SkillFilter -from .types.filters import TimeFilter -from .types.filters import WorkExperienceFilter -from .types.histogram import HistogramQuery -from .types.histogram import HistogramQueryResult +from .types.filters import ( + ApplicationDateFilter, + ApplicationJobFilter, + ApplicationOutcomeNotesFilter, + AvailabilityFilter, + CandidateAvailabilityFilter, + CommuteFilter, + CompensationFilter, + EducationFilter, + EmployerFilter, + JobQuery, + JobTitleFilter, + LocationFilter, + PersonNameFilter, + ProfileQuery, + SkillFilter, + TimeFilter, + WorkExperienceFilter, +) +from .types.histogram import HistogramQuery, HistogramQueryResult from .types.job import Job -from .types.job_service import BatchCreateJobsRequest -from .types.job_service import BatchDeleteJobsRequest -from .types.job_service import BatchUpdateJobsRequest -from .types.job_service import CreateJobRequest -from .types.job_service import DeleteJobRequest -from .types.job_service import GetJobRequest -from .types.job_service import JobOperationResult -from .types.job_service import ListJobsRequest -from .types.job_service import ListJobsResponse -from .types.job_service import SearchJobsRequest -from .types.job_service import SearchJobsResponse -from .types.job_service import UpdateJobRequest -from .types.job_service import JobView -from .types.profile import Activity -from .types.profile import AdditionalContactInfo -from .types.profile import Address -from .types.profile import AvailabilitySignal -from .types.profile import Degree -from .types.profile import EducationRecord -from .types.profile import Email -from .types.profile import EmploymentRecord -from .types.profile import Patent -from .types.profile import PersonalUri -from .types.profile import PersonName -from .types.profile import Phone -from .types.profile import Profile -from .types.profile import Publication -from .types.profile import Resume -from .types.profile_service import CreateProfileRequest -from .types.profile_service import DeleteProfileRequest -from .types.profile_service import GetProfileRequest -from .types.profile_service import ListProfilesRequest -from .types.profile_service import ListProfilesResponse -from .types.profile_service import SearchProfilesRequest -from .types.profile_service import SearchProfilesResponse -from .types.profile_service import SummarizedProfile -from .types.profile_service import UpdateProfileRequest +from .types.job_service import ( + BatchCreateJobsRequest, + BatchDeleteJobsRequest, + BatchUpdateJobsRequest, + CreateJobRequest, + DeleteJobRequest, + GetJobRequest, + JobOperationResult, + JobView, + ListJobsRequest, + ListJobsResponse, + SearchJobsRequest, + SearchJobsResponse, + UpdateJobRequest, +) +from .types.profile import ( + Activity, + AdditionalContactInfo, + Address, + AvailabilitySignal, + Degree, + EducationRecord, + Email, + EmploymentRecord, + Patent, + PersonalUri, + PersonName, + Phone, + Profile, + Publication, + Resume, +) +from .types.profile_service import ( + CreateProfileRequest, + DeleteProfileRequest, + GetProfileRequest, + ListProfilesRequest, + ListProfilesResponse, + SearchProfilesRequest, + SearchProfilesResponse, + SummarizedProfile, + UpdateProfileRequest, +) from .types.tenant import Tenant -from .types.tenant_service import CreateTenantRequest -from .types.tenant_service import DeleteTenantRequest -from .types.tenant_service import GetTenantRequest -from .types.tenant_service import ListTenantsRequest -from .types.tenant_service import ListTenantsResponse -from .types.tenant_service import UpdateTenantRequest +from .types.tenant_service import ( + CreateTenantRequest, + DeleteTenantRequest, + GetTenantRequest, + ListTenantsRequest, + ListTenantsResponse, + UpdateTenantRequest, +) __all__ = ( "ApplicationServiceAsyncClient", diff --git a/google/cloud/talent_v4beta1/services/application_service/__init__.py b/google/cloud/talent_v4beta1/services/application_service/__init__.py index 4e078046..782d0859 100644 --- a/google/cloud/talent_v4beta1/services/application_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/application_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import ApplicationServiceClient from .async_client import ApplicationServiceAsyncClient +from .client import ApplicationServiceClient __all__ = ( "ApplicationServiceClient", diff --git a/google/cloud/talent_v4beta1/services/application_service/async_client.py b/google/cloud/talent_v4beta1/services/application_service/async_client.py index 05dcb98e..bdeec858 100644 --- a/google/cloud/talent_v4beta1/services/application_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/application_service/async_client.py @@ -16,32 +16,33 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.services.application_service import pagers -from google.cloud.talent_v4beta1.types import application -from google.cloud.talent_v4beta1.types import application as gct_application -from google.cloud.talent_v4beta1.types import application_service -from google.cloud.talent_v4beta1.types import common from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore -from .transports.base import ApplicationServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import ApplicationServiceGrpcAsyncIOTransport + +from google.cloud.talent_v4beta1.services.application_service import pagers +from google.cloud.talent_v4beta1.types import application +from google.cloud.talent_v4beta1.types import application as gct_application +from google.cloud.talent_v4beta1.types import application_service, common + from .client import ApplicationServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, ApplicationServiceTransport +from .transports.grpc_asyncio import ApplicationServiceGrpcAsyncIOTransport class ApplicationServiceAsyncClient: @@ -235,9 +236,9 @@ async def create_application( from google.cloud import talent_v4beta1 - def sample_create_application(): + async def sample_create_application(): # Create a client - client = talent_v4beta1.ApplicationServiceClient() + client = talent_v4beta1.ApplicationServiceAsyncClient() # Initialize request argument(s) application = talent_v4beta1.Application() @@ -251,7 +252,7 @@ def sample_create_application(): ) # Make the request - response = client.create_application(request=request) + response = await client.create_application(request=request) # Handle the response print(response) @@ -349,9 +350,9 @@ async def get_application( from google.cloud import talent_v4beta1 - def sample_get_application(): + async def sample_get_application(): # Create a client - client = talent_v4beta1.ApplicationServiceClient() + client = talent_v4beta1.ApplicationServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.GetApplicationRequest( @@ -359,7 +360,7 @@ def sample_get_application(): ) # Make the request - response = client.get_application(request=request) + response = await client.get_application(request=request) # Handle the response print(response) @@ -459,9 +460,9 @@ async def update_application( from google.cloud import talent_v4beta1 - def sample_update_application(): + async def sample_update_application(): # Create a client - client = talent_v4beta1.ApplicationServiceClient() + client = talent_v4beta1.ApplicationServiceAsyncClient() # Initialize request argument(s) application = talent_v4beta1.Application() @@ -474,7 +475,7 @@ def sample_update_application(): ) # Make the request - response = client.update_application(request=request) + response = await client.update_application(request=request) # Handle the response print(response) @@ -562,9 +563,9 @@ async def delete_application( from google.cloud import talent_v4beta1 - def sample_delete_application(): + async def sample_delete_application(): # Create a client - client = talent_v4beta1.ApplicationServiceClient() + client = talent_v4beta1.ApplicationServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.DeleteApplicationRequest( @@ -572,7 +573,7 @@ def sample_delete_application(): ) # Make the request - client.delete_application(request=request) + await client.delete_application(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.DeleteApplicationRequest, dict]): @@ -659,9 +660,9 @@ async def list_applications( from google.cloud import talent_v4beta1 - def sample_list_applications(): + async def sample_list_applications(): # Create a client - client = talent_v4beta1.ApplicationServiceClient() + client = talent_v4beta1.ApplicationServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.ListApplicationsRequest( @@ -672,7 +673,7 @@ def sample_list_applications(): page_result = client.list_applications(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4beta1/services/application_service/client.py b/google/cloud/talent_v4beta1/services/application_service/client.py index 168610ff..3e6b992d 100644 --- a/google/cloud/talent_v4beta1/services/application_service/client.py +++ b/google/cloud/talent_v4beta1/services/application_service/client.py @@ -16,33 +16,34 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.services.application_service import pagers -from google.cloud.talent_v4beta1.types import application -from google.cloud.talent_v4beta1.types import application as gct_application -from google.cloud.talent_v4beta1.types import application_service -from google.cloud.talent_v4beta1.types import common from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore -from .transports.base import ApplicationServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.talent_v4beta1.services.application_service import pagers +from google.cloud.talent_v4beta1.types import application +from google.cloud.talent_v4beta1.types import application as gct_application +from google.cloud.talent_v4beta1.types import application_service, common + +from .transports.base import DEFAULT_CLIENT_INFO, ApplicationServiceTransport from .transports.grpc import ApplicationServiceGrpcTransport from .transports.grpc_asyncio import ApplicationServiceGrpcAsyncIOTransport diff --git a/google/cloud/talent_v4beta1/services/application_service/pagers.py b/google/cloud/talent_v4beta1/services/application_service/pagers.py index c6fcde4e..31c8be33 100644 --- a/google/cloud/talent_v4beta1/services/application_service/pagers.py +++ b/google/cloud/talent_v4beta1/services/application_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4beta1.types import application -from google.cloud.talent_v4beta1.types import application_service +from google.cloud.talent_v4beta1.types import application, application_service class ListApplicationsPager: diff --git a/google/cloud/talent_v4beta1/services/application_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/application_service/transports/__init__.py index 5856e987..97897959 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import ApplicationServiceGrpcTransport from .grpc_asyncio import ApplicationServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = ( OrderedDict() diff --git a/google/cloud/talent_v4beta1/services/application_service/transports/base.py b/google/cloud/talent_v4beta1/services/application_service/transports/base.py index 9a9ab85c..f8ca497a 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import application from google.cloud.talent_v4beta1.types import application as gct_application from google.cloud.talent_v4beta1.types import application_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -240,5 +241,9 @@ def list_applications( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("ApplicationServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py index 196f3182..30f6d433 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4beta1.types import application from google.cloud.talent_v4beta1.types import application as gct_application from google.cloud.talent_v4beta1.types import application_service -from google.protobuf import empty_pb2 # type: ignore -from .base import ApplicationServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ApplicationServiceTransport class ApplicationServiceGrpcTransport(ApplicationServiceTransport): @@ -371,5 +370,9 @@ def list_applications( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("ApplicationServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/application_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/application_service/transports/grpc_asyncio.py index 78b33509..1e936ae2 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import application from google.cloud.talent_v4beta1.types import application as gct_application from google.cloud.talent_v4beta1.types import application_service -from google.protobuf import empty_pb2 # type: ignore -from .base import ApplicationServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ApplicationServiceTransport from .grpc import ApplicationServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/company_service/__init__.py b/google/cloud/talent_v4beta1/services/company_service/__init__.py index 499d74d4..045ec5d4 100644 --- a/google/cloud/talent_v4beta1/services/company_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/company_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CompanyServiceClient from .async_client import CompanyServiceAsyncClient +from .client import CompanyServiceClient __all__ = ( "CompanyServiceClient", diff --git a/google/cloud/talent_v4beta1/services/company_service/async_client.py b/google/cloud/talent_v4beta1/services/company_service/async_client.py index 79f2954e..7cb6620e 100644 --- a/google/cloud/talent_v4beta1/services/company_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/company_service/async_client.py @@ -16,15 +16,15 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,9 +36,10 @@ from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from .transports.base import CompanyServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport + from .client import CompanyServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, CompanyServiceTransport +from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport class CompanyServiceAsyncClient: @@ -223,9 +224,9 @@ async def create_company( from google.cloud import talent_v4beta1 - def sample_create_company(): + async def sample_create_company(): # Create a client - client = talent_v4beta1.CompanyServiceClient() + client = talent_v4beta1.CompanyServiceAsyncClient() # Initialize request argument(s) company = talent_v4beta1.Company() @@ -238,7 +239,7 @@ def sample_create_company(): ) # Make the request - response = client.create_company(request=request) + response = await client.create_company(request=request) # Handle the response print(response) @@ -340,9 +341,9 @@ async def get_company( from google.cloud import talent_v4beta1 - def sample_get_company(): + async def sample_get_company(): # Create a client - client = talent_v4beta1.CompanyServiceClient() + client = talent_v4beta1.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.GetCompanyRequest( @@ -350,7 +351,7 @@ def sample_get_company(): ) # Make the request - response = client.get_company(request=request) + response = await client.get_company(request=request) # Handle the response print(response) @@ -457,9 +458,9 @@ async def update_company( from google.cloud import talent_v4beta1 - def sample_update_company(): + async def sample_update_company(): # Create a client - client = talent_v4beta1.CompanyServiceClient() + client = talent_v4beta1.CompanyServiceAsyncClient() # Initialize request argument(s) company = talent_v4beta1.Company() @@ -471,7 +472,7 @@ def sample_update_company(): ) # Make the request - response = client.update_company(request=request) + response = await client.update_company(request=request) # Handle the response print(response) @@ -561,14 +562,13 @@ async def delete_company( Prerequisite: The company has no jobs associated with it. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_delete_company(): + async def sample_delete_company(): # Create a client - client = talent_v4beta1.CompanyServiceClient() + client = talent_v4beta1.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.DeleteCompanyRequest( @@ -576,7 +576,7 @@ def sample_delete_company(): ) # Make the request - client.delete_company(request=request) + await client.delete_company(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.DeleteCompanyRequest, dict]): @@ -665,9 +665,9 @@ async def list_companies( from google.cloud import talent_v4beta1 - def sample_list_companies(): + async def sample_list_companies(): # Create a client - client = talent_v4beta1.CompanyServiceClient() + client = talent_v4beta1.CompanyServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.ListCompaniesRequest( @@ -678,7 +678,7 @@ def sample_list_companies(): page_result = client.list_companies(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4beta1/services/company_service/client.py b/google/cloud/talent_v4beta1/services/company_service/client.py index c3d6485a..2228d2ec 100644 --- a/google/cloud/talent_v4beta1/services/company_service/client.py +++ b/google/cloud/talent_v4beta1/services/company_service/client.py @@ -16,18 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -39,7 +39,8 @@ from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from .transports.base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, CompanyServiceTransport from .transports.grpc import CompanyServiceGrpcTransport from .transports.grpc_asyncio import CompanyServiceGrpcAsyncIOTransport @@ -775,7 +776,6 @@ def delete_company( Prerequisite: The company has no jobs associated with it. - .. code-block:: python from google.cloud import talent_v4beta1 diff --git a/google/cloud/talent_v4beta1/services/company_service/pagers.py b/google/cloud/talent_v4beta1/services/company_service/pagers.py index edd4a5d9..b0963fd7 100644 --- a/google/cloud/talent_v4beta1/services/company_service/pagers.py +++ b/google/cloud/talent_v4beta1/services/company_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4beta1.types import company -from google.cloud.talent_v4beta1.types import company_service +from google.cloud.talent_v4beta1.types import company, company_service class ListCompaniesPager: diff --git a/google/cloud/talent_v4beta1/services/company_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/company_service/transports/__init__.py index 40885605..66f5d7ba 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CompanyServiceGrpcTransport from .grpc_asyncio import CompanyServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CompanyServiceTransport]] _transport_registry["grpc"] = CompanyServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/company_service/transports/base.py b/google/cloud/talent_v4beta1/services/company_service/transports/base.py index 2a483226..8498b74b 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -240,5 +241,9 @@ def list_companies( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CompanyServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py index 7a4ba433..796d40b7 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from google.protobuf import empty_pb2 # type: ignore -from .base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompanyServiceTransport class CompanyServiceGrpcTransport(CompanyServiceTransport): @@ -368,5 +367,9 @@ def list_companies( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CompanyServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/company_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/company_service/transports/grpc_asyncio.py index d59fa78e..040d81d0 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from google.protobuf import empty_pb2 # type: ignore -from .base import CompanyServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompanyServiceTransport from .grpc import CompanyServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/completion/__init__.py b/google/cloud/talent_v4beta1/services/completion/__init__.py index 998d1060..2880c509 100644 --- a/google/cloud/talent_v4beta1/services/completion/__init__.py +++ b/google/cloud/talent_v4beta1/services/completion/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CompletionClient from .async_client import CompletionAsyncClient +from .client import CompletionClient __all__ = ( "CompletionClient", diff --git a/google/cloud/talent_v4beta1/services/completion/async_client.py b/google/cloud/talent_v4beta1/services/completion/async_client.py index 37d2a0a0..0eacec76 100644 --- a/google/cloud/talent_v4beta1/services/completion/async_client.py +++ b/google/cloud/talent_v4beta1/services/completion/async_client.py @@ -16,26 +16,26 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import completion_service -from .transports.base import CompletionTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport +from google.cloud.talent_v4beta1.types import common, completion_service + from .client import CompletionClient +from .transports.base import DEFAULT_CLIENT_INFO, CompletionTransport +from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport class CompletionAsyncClient: @@ -208,14 +208,13 @@ async def complete_query( suggestions. Intended for use by a job search auto-complete search box. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_complete_query(): + async def sample_complete_query(): # Create a client - client = talent_v4beta1.CompletionClient() + client = talent_v4beta1.CompletionAsyncClient() # Initialize request argument(s) request = talent_v4beta1.CompleteQueryRequest( @@ -225,7 +224,7 @@ def sample_complete_query(): ) # Make the request - response = client.complete_query(request=request) + response = await client.complete_query(request=request) # Handle the response print(response) diff --git a/google/cloud/talent_v4beta1/services/completion/client.py b/google/cloud/talent_v4beta1/services/completion/client.py index 9a5881ae..94742550 100644 --- a/google/cloud/talent_v4beta1/services/completion/client.py +++ b/google/cloud/talent_v4beta1/services/completion/client.py @@ -16,27 +16,27 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import completion_service -from .transports.base import CompletionTransport, DEFAULT_CLIENT_INFO +from google.cloud.talent_v4beta1.types import common, completion_service + +from .transports.base import DEFAULT_CLIENT_INFO, CompletionTransport from .transports.grpc import CompletionGrpcTransport from .transports.grpc_asyncio import CompletionGrpcAsyncIOTransport @@ -436,7 +436,6 @@ def complete_query( suggestions. Intended for use by a job search auto-complete search box. - .. code-block:: python from google.cloud import talent_v4beta1 diff --git a/google/cloud/talent_v4beta1/services/completion/transports/__init__.py b/google/cloud/talent_v4beta1/services/completion/transports/__init__.py index e3da6795..187001a3 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CompletionGrpcTransport from .grpc_asyncio import CompletionGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CompletionTransport]] _transport_registry["grpc"] = CompletionGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/completion/transports/base.py b/google/cloud/talent_v4beta1/services/completion/transports/base.py index 665d72f4..f988e063 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/base.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/base.py @@ -15,15 +15,15 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import completion_service @@ -83,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -161,5 +162,9 @@ def complete_query( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CompletionTransport",) diff --git a/google/cloud/talent_v4beta1/services/completion/transports/grpc.py b/google/cloud/talent_v4beta1/services/completion/transports/grpc.py index bb90484a..0b0e3c19 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/grpc.py @@ -13,19 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from google.cloud.talent_v4beta1.types import completion_service -from .base import CompletionTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompletionTransport class CompletionGrpcTransport(CompletionTransport): @@ -261,5 +260,9 @@ def complete_query( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CompletionGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/completion/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/completion/transports/grpc_asyncio.py index bab27f1c..b3fae966 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/grpc_asyncio.py @@ -13,19 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import completion_service -from .base import CompletionTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CompletionTransport from .grpc import CompletionGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/event_service/__init__.py b/google/cloud/talent_v4beta1/services/event_service/__init__.py index 32ddeddc..a3fd326d 100644 --- a/google/cloud/talent_v4beta1/services/event_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/event_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import EventServiceClient from .async_client import EventServiceAsyncClient +from .client import EventServiceClient __all__ = ( "EventServiceClient", diff --git a/google/cloud/talent_v4beta1/services/event_service/async_client.py b/google/cloud/talent_v4beta1/services/event_service/async_client.py index 8b4d8276..12c16f8a 100644 --- a/google/cloud/talent_v4beta1/services/event_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/event_service/async_client.py @@ -16,27 +16,28 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import EventServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport + +from google.cloud.talent_v4beta1.types import event, event_service + from .client import EventServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, EventServiceTransport +from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport class EventServiceAsyncClient: @@ -217,14 +218,13 @@ async def create_client_event( more `__ about self service tools. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_create_client_event(): + async def sample_create_client_event(): # Create a client - client = talent_v4beta1.EventServiceClient() + client = talent_v4beta1.EventServiceAsyncClient() # Initialize request argument(s) client_event = talent_v4beta1.ClientEvent() @@ -238,7 +238,7 @@ def sample_create_client_event(): ) # Make the request - response = client.create_client_event(request=request) + response = await client.create_client_event(request=request) # Handle the response print(response) diff --git a/google/cloud/talent_v4beta1/services/event_service/client.py b/google/cloud/talent_v4beta1/services/event_service/client.py index 184aa5ff..914eb6fe 100644 --- a/google/cloud/talent_v4beta1/services/event_service/client.py +++ b/google/cloud/talent_v4beta1/services/event_service/client.py @@ -16,28 +16,29 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import EventServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.talent_v4beta1.types import event, event_service + +from .transports.base import DEFAULT_CLIENT_INFO, EventServiceTransport from .transports.grpc import EventServiceGrpcTransport from .transports.grpc_asyncio import EventServiceGrpcAsyncIOTransport @@ -443,7 +444,6 @@ def create_client_event( more `__ about self service tools. - .. code-block:: python from google.cloud import talent_v4beta1 diff --git a/google/cloud/talent_v4beta1/services/event_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/event_service/transports/__init__.py index 6b72ca4d..5c44f457 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import EventServiceGrpcTransport from .grpc_asyncio import EventServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[EventServiceTransport]] _transport_registry["grpc"] = EventServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/event_service/transports/base.py b/google/cloud/talent_v4beta1/services/event_service/transports/base.py index ac91edfd..3bb46a7b 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/base.py @@ -15,18 +15,17 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service +from google.cloud.talent_v4beta1.types import event, event_service try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -84,6 +83,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -149,5 +149,9 @@ def create_client_event( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("EventServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py index 50579247..4dfbdd08 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py @@ -13,20 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service -from .base import EventServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.talent_v4beta1.types import event, event_service + +from .base import DEFAULT_CLIENT_INFO, EventServiceTransport class EventServiceGrpcTransport(EventServiceTransport): @@ -263,5 +261,9 @@ def create_client_event( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("EventServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/event_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/event_service/transports/grpc_asyncio.py index d583889e..78fc17bd 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/grpc_asyncio.py @@ -13,20 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service -from .base import EventServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.talent_v4beta1.types import event, event_service + +from .base import DEFAULT_CLIENT_INFO, EventServiceTransport from .grpc import EventServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/job_service/__init__.py b/google/cloud/talent_v4beta1/services/job_service/__init__.py index 3d885808..56f42874 100644 --- a/google/cloud/talent_v4beta1/services/job_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/job_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import JobServiceClient from .async_client import JobServiceAsyncClient +from .client import JobServiceClient __all__ = ( "JobServiceClient", diff --git a/google/cloud/talent_v4beta1/services/job_service/async_client.py b/google/cloud/talent_v4beta1/services/job_service/async_client.py index 6bdd959c..4c2af6c7 100644 --- a/google/cloud/talent_v4beta1/services/job_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/job_service/async_client.py @@ -16,15 +16,15 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,15 +33,17 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.talent_v4beta1.services.job_service import pagers from google.cloud.talent_v4beta1.types import common from google.cloud.talent_v4beta1.types import job from google.cloud.talent_v4beta1.types import job as gct_job from google.cloud.talent_v4beta1.types import job_service -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport + from .client import JobServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, JobServiceTransport +from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport class JobServiceAsyncClient: @@ -220,14 +222,13 @@ async def create_job( Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_create_job(): + async def sample_create_job(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) job = talent_v4beta1.Job() @@ -242,7 +243,7 @@ def sample_create_job(): ) # Make the request - response = client.create_job(request=request) + response = await client.create_job(request=request) # Handle the response print(response) @@ -342,9 +343,9 @@ async def batch_create_jobs( from google.cloud import talent_v4beta1 - def sample_batch_create_jobs(): + async def sample_batch_create_jobs(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) jobs = talent_v4beta1.Job() @@ -363,7 +364,7 @@ def sample_batch_create_jobs(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -470,14 +471,13 @@ async def get_job( r"""Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_get_job(): + async def sample_get_job(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.GetJobRequest( @@ -485,7 +485,7 @@ def sample_get_job(): ) # Make the request - response = client.get_job(request=request) + response = await client.get_job(request=request) # Handle the response print(response) @@ -586,14 +586,13 @@ async def update_job( results within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_update_job(): + async def sample_update_job(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) job = talent_v4beta1.Job() @@ -607,7 +606,7 @@ def sample_update_job(): ) # Make the request - response = client.update_job(request=request) + response = await client.update_job(request=request) # Handle the response print(response) @@ -692,9 +691,9 @@ async def batch_update_jobs( from google.cloud import talent_v4beta1 - def sample_batch_update_jobs(): + async def sample_batch_update_jobs(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) jobs = talent_v4beta1.Job() @@ -713,7 +712,7 @@ def sample_batch_update_jobs(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -821,14 +820,13 @@ async def delete_job( Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_delete_job(): + async def sample_delete_job(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.DeleteJobRequest( @@ -836,7 +834,7 @@ def sample_delete_job(): ) # Make the request - client.delete_job(request=request) + await client.delete_job(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.DeleteJobRequest, dict]): @@ -922,14 +920,13 @@ async def batch_delete_jobs( r"""Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_batch_delete_jobs(): + async def sample_batch_delete_jobs(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.BatchDeleteJobsRequest( @@ -938,7 +935,7 @@ def sample_batch_delete_jobs(): ) # Make the request - client.batch_delete_jobs(request=request) + await client.batch_delete_jobs(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.BatchDeleteJobsRequest, dict]): @@ -1036,9 +1033,9 @@ async def list_jobs( from google.cloud import talent_v4beta1 - def sample_list_jobs(): + async def sample_list_jobs(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.ListJobsRequest( @@ -1050,7 +1047,7 @@ def sample_list_jobs(): page_result = client.list_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1189,14 +1186,13 @@ async def search_jobs( present in the database, and only returns jobs that the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_search_jobs(): + async def sample_search_jobs(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.SearchJobsRequest( @@ -1207,7 +1203,7 @@ def sample_search_jobs(): page_result = client.search_jobs(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1287,14 +1283,13 @@ async def search_jobs_for_alert( present in the database, and only returns jobs the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_search_jobs_for_alert(): + async def sample_search_jobs_for_alert(): # Create a client - client = talent_v4beta1.JobServiceClient() + client = talent_v4beta1.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.SearchJobsRequest( @@ -1305,7 +1300,7 @@ def sample_search_jobs_for_alert(): page_result = client.search_jobs_for_alert(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4beta1/services/job_service/client.py b/google/cloud/talent_v4beta1/services/job_service/client.py index 6f55c031..f63a2cd2 100644 --- a/google/cloud/talent_v4beta1/services/job_service/client.py +++ b/google/cloud/talent_v4beta1/services/job_service/client.py @@ -16,18 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,13 +36,15 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.talent_v4beta1.services.job_service import pagers from google.cloud.talent_v4beta1.types import common from google.cloud.talent_v4beta1.types import job from google.cloud.talent_v4beta1.types import job as gct_job from google.cloud.talent_v4beta1.types import job_service -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, JobServiceTransport from .transports.grpc import JobServiceGrpcTransport from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport @@ -468,7 +470,6 @@ def create_job( Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -718,7 +719,6 @@ def get_job( r"""Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -824,7 +824,6 @@ def update_job( results within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -1059,7 +1058,6 @@ def delete_job( Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -1150,7 +1148,6 @@ def batch_delete_jobs( r"""Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -1407,7 +1404,6 @@ def search_jobs( present in the database, and only returns jobs that the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -1506,7 +1502,6 @@ def search_jobs_for_alert( present in the database, and only returns jobs the caller has permission to search against. - .. code-block:: python from google.cloud import talent_v4beta1 diff --git a/google/cloud/talent_v4beta1/services/job_service/pagers.py b/google/cloud/talent_v4beta1/services/job_service/pagers.py index b8665485..ae5fb682 100644 --- a/google/cloud/talent_v4beta1/services/job_service/pagers.py +++ b/google/cloud/talent_v4beta1/services/job_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4beta1.types import job -from google.cloud.talent_v4beta1.types import job_service +from google.cloud.talent_v4beta1.types import job, job_service class ListJobsPager: diff --git a/google/cloud/talent_v4beta1/services/job_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/job_service/transports/__init__.py index bb641d64..58f50acc 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import JobServiceGrpcTransport from .grpc_asyncio import JobServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[JobServiceTransport]] _transport_registry["grpc"] = JobServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/job_service/transports/base.py b/google/cloud/talent_v4beta1/services/job_service/transports/base.py index 267ed024..8847c535 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/base.py @@ -15,22 +15,21 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import job from google.cloud.talent_v4beta1.types import job as gct_job from google.cloud.talent_v4beta1.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -88,6 +87,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -313,5 +313,9 @@ def search_jobs_for_alert( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("JobServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py index 1d0cd3dd..48296d44 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py @@ -13,24 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4beta1.types import job from google.cloud.talent_v4beta1.types import job as gct_job from google.cloud.talent_v4beta1.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, JobServiceTransport class JobServiceGrpcTransport(JobServiceTransport): @@ -530,5 +528,9 @@ def search_jobs_for_alert( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("JobServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/job_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/job_service/transports/grpc_asyncio.py index 2b34e0ca..708460a5 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/grpc_asyncio.py @@ -13,24 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.api_core import operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import job from google.cloud.talent_v4beta1.types import job as gct_job from google.cloud.talent_v4beta1.types import job_service -from google.longrunning import operations_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import JobServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, JobServiceTransport from .grpc import JobServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/profile_service/__init__.py b/google/cloud/talent_v4beta1/services/profile_service/__init__.py index 4f95f6a2..79f99f9b 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/profile_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import ProfileServiceClient from .async_client import ProfileServiceAsyncClient +from .client import ProfileServiceClient __all__ = ( "ProfileServiceClient", diff --git a/google/cloud/talent_v4beta1/services/profile_service/async_client.py b/google/cloud/talent_v4beta1/services/profile_service/async_client.py index 171dd0e4..7d28c354 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/profile_service/async_client.py @@ -16,32 +16,33 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.protobuf import wrappers_pb2 # type: ignore + from google.cloud.talent_v4beta1.services.profile_service import pagers -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import histogram +from google.cloud.talent_v4beta1.types import common, histogram from google.cloud.talent_v4beta1.types import profile from google.cloud.talent_v4beta1.types import profile as gct_profile from google.cloud.talent_v4beta1.types import profile_service -from google.protobuf import timestamp_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore -from .transports.base import ProfileServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import ProfileServiceGrpcAsyncIOTransport + from .client import ProfileServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, ProfileServiceTransport +from .transports.grpc_asyncio import ProfileServiceGrpcAsyncIOTransport class ProfileServiceAsyncClient: @@ -227,9 +228,9 @@ async def list_profiles( from google.cloud import talent_v4beta1 - def sample_list_profiles(): + async def sample_list_profiles(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.ListProfilesRequest( @@ -240,7 +241,7 @@ def sample_list_profiles(): page_result = client.list_profiles(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -348,9 +349,9 @@ async def create_profile( from google.cloud import talent_v4beta1 - def sample_create_profile(): + async def sample_create_profile(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.CreateProfileRequest( @@ -358,7 +359,7 @@ def sample_create_profile(): ) # Make the request - response = client.create_profile(request=request) + response = await client.create_profile(request=request) # Handle the response print(response) @@ -455,9 +456,9 @@ async def get_profile( from google.cloud import talent_v4beta1 - def sample_get_profile(): + async def sample_get_profile(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.GetProfileRequest( @@ -465,7 +466,7 @@ def sample_get_profile(): ) # Make the request - response = client.get_profile(request=request) + response = await client.get_profile(request=request) # Handle the response print(response) @@ -561,21 +562,20 @@ async def update_profile( r"""Updates the specified profile and returns the updated result. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_update_profile(): + async def sample_update_profile(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.UpdateProfileRequest( ) # Make the request - response = client.update_profile(request=request) + response = await client.update_profile(request=request) # Handle the response print(response) @@ -659,14 +659,13 @@ async def delete_profile( Prerequisite: The profile has no associated applications or assignments associated. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_delete_profile(): + async def sample_delete_profile(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.DeleteProfileRequest( @@ -674,7 +673,7 @@ def sample_delete_profile(): ) # Make the request - client.delete_profile(request=request) + await client.delete_profile(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.DeleteProfileRequest, dict]): @@ -762,14 +761,13 @@ async def search_profiles( [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information. - .. code-block:: python from google.cloud import talent_v4beta1 - def sample_search_profiles(): + async def sample_search_profiles(): # Create a client - client = talent_v4beta1.ProfileServiceClient() + client = talent_v4beta1.ProfileServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.SearchProfilesRequest( @@ -780,7 +778,7 @@ def sample_search_profiles(): page_result = client.search_profiles(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4beta1/services/profile_service/client.py b/google/cloud/talent_v4beta1/services/profile_service/client.py index b69f6cd3..820ac697 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/client.py +++ b/google/cloud/talent_v4beta1/services/profile_service/client.py @@ -16,33 +16,34 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.protobuf import wrappers_pb2 # type: ignore + from google.cloud.talent_v4beta1.services.profile_service import pagers -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import histogram +from google.cloud.talent_v4beta1.types import common, histogram from google.cloud.talent_v4beta1.types import profile from google.cloud.talent_v4beta1.types import profile as gct_profile from google.cloud.talent_v4beta1.types import profile_service -from google.protobuf import timestamp_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore -from .transports.base import ProfileServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, ProfileServiceTransport from .transports.grpc import ProfileServiceGrpcTransport from .transports.grpc_asyncio import ProfileServiceGrpcAsyncIOTransport @@ -780,7 +781,6 @@ def update_profile( r"""Updates the specified profile and returns the updated result. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -878,7 +878,6 @@ def delete_profile( Prerequisite: The profile has no associated applications or assignments associated. - .. code-block:: python from google.cloud import talent_v4beta1 @@ -971,7 +970,6 @@ def search_profiles( [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information. - .. code-block:: python from google.cloud import talent_v4beta1 diff --git a/google/cloud/talent_v4beta1/services/profile_service/pagers.py b/google/cloud/talent_v4beta1/services/profile_service/pagers.py index 2900209e..a979d99c 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/pagers.py +++ b/google/cloud/talent_v4beta1/services/profile_service/pagers.py @@ -18,15 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4beta1.types import histogram -from google.cloud.talent_v4beta1.types import profile -from google.cloud.talent_v4beta1.types import profile_service +from google.cloud.talent_v4beta1.types import histogram, profile, profile_service class ListProfilesPager: diff --git a/google/cloud/talent_v4beta1/services/profile_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/profile_service/transports/__init__.py index d1f25cc1..f46de9fa 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import ProfileServiceGrpcTransport from .grpc_asyncio import ProfileServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[ProfileServiceTransport]] _transport_registry["grpc"] = ProfileServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/profile_service/transports/base.py b/google/cloud/talent_v4beta1/services/profile_service/transports/base.py index 87ac0042..b6f77bb6 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import profile from google.cloud.talent_v4beta1.types import profile as gct_profile from google.cloud.talent_v4beta1.types import profile_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -257,5 +258,9 @@ def search_profiles( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("ProfileServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py index 589439c0..b29bbe6f 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4beta1.types import profile from google.cloud.talent_v4beta1.types import profile as gct_profile from google.cloud.talent_v4beta1.types import profile_service -from google.protobuf import empty_pb2 # type: ignore -from .base import ProfileServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ProfileServiceTransport class ProfileServiceGrpcTransport(ProfileServiceTransport): @@ -405,5 +404,9 @@ def search_profiles( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("ProfileServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/profile_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/profile_service/transports/grpc_asyncio.py index f2b37004..f5af98e0 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import profile from google.cloud.talent_v4beta1.types import profile as gct_profile from google.cloud.talent_v4beta1.types import profile_service -from google.protobuf import empty_pb2 # type: ignore -from .base import ProfileServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, ProfileServiceTransport from .grpc import ProfileServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/tenant_service/__init__.py b/google/cloud/talent_v4beta1/services/tenant_service/__init__.py index e7e4e302..f89e5b38 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/__init__.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import TenantServiceClient from .async_client import TenantServiceAsyncClient +from .client import TenantServiceClient __all__ = ( "TenantServiceClient", diff --git a/google/cloud/talent_v4beta1/services/tenant_service/async_client.py b/google/cloud/talent_v4beta1/services/tenant_service/async_client.py index 5c98059d..6c433492 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/async_client.py @@ -16,15 +16,15 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -35,9 +35,10 @@ from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from .transports.base import TenantServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport + from .client import TenantServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, TenantServiceTransport +from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport class TenantServiceAsyncClient: @@ -222,9 +223,9 @@ async def create_tenant( from google.cloud import talent_v4beta1 - def sample_create_tenant(): + async def sample_create_tenant(): # Create a client - client = talent_v4beta1.TenantServiceClient() + client = talent_v4beta1.TenantServiceAsyncClient() # Initialize request argument(s) tenant = talent_v4beta1.Tenant() @@ -236,7 +237,7 @@ def sample_create_tenant(): ) # Make the request - response = client.create_tenant(request=request) + response = await client.create_tenant(request=request) # Handle the response print(response) @@ -336,9 +337,9 @@ async def get_tenant( from google.cloud import talent_v4beta1 - def sample_get_tenant(): + async def sample_get_tenant(): # Create a client - client = talent_v4beta1.TenantServiceClient() + client = talent_v4beta1.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.GetTenantRequest( @@ -346,7 +347,7 @@ def sample_get_tenant(): ) # Make the request - response = client.get_tenant(request=request) + response = await client.get_tenant(request=request) # Handle the response print(response) @@ -450,9 +451,9 @@ async def update_tenant( from google.cloud import talent_v4beta1 - def sample_update_tenant(): + async def sample_update_tenant(): # Create a client - client = talent_v4beta1.TenantServiceClient() + client = talent_v4beta1.TenantServiceAsyncClient() # Initialize request argument(s) tenant = talent_v4beta1.Tenant() @@ -463,7 +464,7 @@ def sample_update_tenant(): ) # Make the request - response = client.update_tenant(request=request) + response = await client.update_tenant(request=request) # Handle the response print(response) @@ -556,9 +557,9 @@ async def delete_tenant( from google.cloud import talent_v4beta1 - def sample_delete_tenant(): + async def sample_delete_tenant(): # Create a client - client = talent_v4beta1.TenantServiceClient() + client = talent_v4beta1.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.DeleteTenantRequest( @@ -566,7 +567,7 @@ def sample_delete_tenant(): ) # Make the request - client.delete_tenant(request=request) + await client.delete_tenant(request=request) Args: request (Union[google.cloud.talent_v4beta1.types.DeleteTenantRequest, dict]): @@ -651,9 +652,9 @@ async def list_tenants( from google.cloud import talent_v4beta1 - def sample_list_tenants(): + async def sample_list_tenants(): # Create a client - client = talent_v4beta1.TenantServiceClient() + client = talent_v4beta1.TenantServiceAsyncClient() # Initialize request argument(s) request = talent_v4beta1.ListTenantsRequest( @@ -664,7 +665,7 @@ def sample_list_tenants(): page_result = client.list_tenants(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/talent_v4beta1/services/tenant_service/client.py b/google/cloud/talent_v4beta1/services/tenant_service/client.py index 35e6bc5b..e63985a0 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/client.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/client.py @@ -16,18 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -38,7 +38,8 @@ from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from .transports.base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, TenantServiceTransport from .transports.grpc import TenantServiceGrpcTransport from .transports.grpc_asyncio import TenantServiceGrpcAsyncIOTransport diff --git a/google/cloud/talent_v4beta1/services/tenant_service/pagers.py b/google/cloud/talent_v4beta1/services/tenant_service/pagers.py index a17f849f..66831461 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/pagers.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.talent_v4beta1.types import tenant -from google.cloud.talent_v4beta1.types import tenant_service +from google.cloud.talent_v4beta1.types import tenant, tenant_service class ListTenantsPager: diff --git a/google/cloud/talent_v4beta1/services/tenant_service/transports/__init__.py b/google/cloud/talent_v4beta1/services/tenant_service/transports/__init__.py index ca79f6cc..752911d6 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/__init__.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import TenantServiceGrpcTransport from .grpc_asyncio import TenantServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[TenantServiceTransport]] _transport_registry["grpc"] = TenantServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py b/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py index 3d9b7105..0a01a0ed 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py @@ -15,20 +15,20 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -86,6 +86,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -240,5 +241,9 @@ def list_tenants( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("TenantServiceTransport",) diff --git a/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py b/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py index af8b2bc7..ae25b0c5 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore -from .base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, TenantServiceTransport class TenantServiceGrpcTransport(TenantServiceTransport): @@ -364,5 +363,9 @@ def list_tenants( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("TenantServiceGrpcTransport",) diff --git a/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc_asyncio.py b/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc_asyncio.py index fbb30a8e..1a755f22 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc_asyncio.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc_asyncio.py @@ -13,22 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from google.protobuf import empty_pb2 # type: ignore -from .base import TenantServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, TenantServiceTransport from .grpc import TenantServiceGrpcTransport diff --git a/google/cloud/talent_v4beta1/types/__init__.py b/google/cloud/talent_v4beta1/types/__init__.py index 482b7f04..30fad4ce 100644 --- a/google/cloud/talent_v4beta1/types/__init__.py +++ b/google/cloud/talent_v4beta1/types/__init__.py @@ -23,32 +23,32 @@ UpdateApplicationRequest, ) from .common import ( + AvailabilitySignalType, BatchOperationMetadata, Certification, - CompensationInfo, - CustomAttribute, - DeviceInfo, - Interview, - Location, - Rating, - RequestMetadata, - ResponseMetadata, - Skill, - SpellingCorrection, - TimestampRange, - AvailabilitySignalType, CommuteMethod, CompanySize, + CompensationInfo, ContactInfoUsage, + CustomAttribute, DegreeType, + DeviceInfo, EmploymentType, HtmlSanitization, + Interview, JobBenefit, JobCategory, JobLevel, + Location, Outcome, PostingRegion, + Rating, + RequestMetadata, + ResponseMetadata, + Skill, SkillProficiencyLevel, + SpellingCorrection, + TimestampRange, Visibility, ) from .company import Company @@ -60,15 +60,8 @@ ListCompaniesResponse, UpdateCompanyRequest, ) -from .completion_service import ( - CompleteQueryRequest, - CompleteQueryResponse, -) -from .event import ( - ClientEvent, - JobEvent, - ProfileEvent, -) +from .completion_service import CompleteQueryRequest, CompleteQueryResponse +from .event import ClientEvent, JobEvent, ProfileEvent from .event_service import CreateClientEventRequest from .filters import ( ApplicationDateFilter, @@ -89,10 +82,7 @@ TimeFilter, WorkExperienceFilter, ) -from .histogram import ( - HistogramQuery, - HistogramQueryResult, -) +from .histogram import HistogramQuery, HistogramQueryResult from .job import Job from .job_service import ( BatchCreateJobsRequest, @@ -102,12 +92,12 @@ DeleteJobRequest, GetJobRequest, JobOperationResult, + JobView, ListJobsRequest, ListJobsResponse, SearchJobsRequest, SearchJobsResponse, UpdateJobRequest, - JobView, ) from .profile import ( Activity, diff --git a/google/cloud/talent_v4beta1/types/application.py b/google/cloud/talent_v4beta1/types/application.py index fcf38e19..de0328c3 100644 --- a/google/cloud/talent_v4beta1/types/application.py +++ b/google/cloud/talent_v4beta1/types/application.py @@ -13,13 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4beta1.types import common from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4beta1.types import common __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/application_service.py b/google/cloud/talent_v4beta1/types/application_service.py index 6847c428..0ba66923 100644 --- a/google/cloud/talent_v4beta1/types/application_service.py +++ b/google/cloud/talent_v4beta1/types/application_service.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4beta1.types import application as gct_application from google.cloud.talent_v4beta1.types import common -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/common.py b/google/cloud/talent_v4beta1/types/common.py index 24991d6a..5298e857 100644 --- a/google/cloud/talent_v4beta1/types/common.py +++ b/google/cloud/talent_v4beta1/types/common.py @@ -13,15 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import money_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/company.py b/google/cloud/talent_v4beta1/types/company.py index f70bafec..c6d1c45f 100644 --- a/google/cloud/talent_v4beta1/types/company.py +++ b/google/cloud/talent_v4beta1/types/company.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4beta1.types import common - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", manifest={ diff --git a/google/cloud/talent_v4beta1/types/company_service.py b/google/cloud/talent_v4beta1/types/company_service.py index 712e954d..c6e674c6 100644 --- a/google/cloud/talent_v4beta1/types/company_service.py +++ b/google/cloud/talent_v4beta1/types/company_service.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4beta1.types import common from google.cloud.talent_v4beta1.types import company as gct_company -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/completion_service.py b/google/cloud/talent_v4beta1/types/completion_service.py index 3c9db65e..f91d6a59 100644 --- a/google/cloud/talent_v4beta1/types/completion_service.py +++ b/google/cloud/talent_v4beta1/types/completion_service.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4beta1.types import common - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", manifest={ diff --git a/google/cloud/talent_v4beta1/types/event.py b/google/cloud/talent_v4beta1/types/event.py index 2809cdd4..49609f7e 100644 --- a/google/cloud/talent_v4beta1/types/event.py +++ b/google/cloud/talent_v4beta1/types/event.py @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/event_service.py b/google/cloud/talent_v4beta1/types/event_service.py index 5f3b9fb2..9e36cd68 100644 --- a/google/cloud/talent_v4beta1/types/event_service.py +++ b/google/cloud/talent_v4beta1/types/event_service.py @@ -17,7 +17,6 @@ from google.cloud.talent_v4beta1.types import event - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", manifest={ diff --git a/google/cloud/talent_v4beta1/types/filters.py b/google/cloud/talent_v4beta1/types/filters.py index edaac781..26605ed9 100644 --- a/google/cloud/talent_v4beta1/types/filters.py +++ b/google/cloud/talent_v4beta1/types/filters.py @@ -13,16 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4beta1.types import common from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import timeofday_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4beta1.types import common __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/histogram.py b/google/cloud/talent_v4beta1/types/histogram.py index 0d0c53fe..22921cf3 100644 --- a/google/cloud/talent_v4beta1/types/histogram.py +++ b/google/cloud/talent_v4beta1/types/histogram.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", manifest={ @@ -54,7 +53,7 @@ class HistogramQueryResult(proto.Message): Attributes: histogram_query (str): Requested histogram expression. - histogram (Sequence[google.cloud.talent_v4beta1.types.HistogramQueryResult.HistogramEntry]): + histogram (Mapping[str, int]): A map from the values of the facet associated with distinct values to the number of matching entries with corresponding value. diff --git a/google/cloud/talent_v4beta1/types/job.py b/google/cloud/talent_v4beta1/types/job.py index b071baca..1eb1f5f0 100644 --- a/google/cloud/talent_v4beta1/types/job.py +++ b/google/cloud/talent_v4beta1/types/job.py @@ -13,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4beta1.types import common -from google.protobuf import timestamp_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", @@ -127,7 +126,7 @@ class Job(proto.Message): Job compensation information (a.k.a. "pay rate") i.e., the compensation that will paid to the employee. - custom_attributes (Sequence[google.cloud.talent_v4beta1.types.Job.CustomAttributesEntry]): + custom_attributes (Mapping[str, google.cloud.talent_v4beta1.types.CustomAttribute]): A map of fields to hold both filterable and non-filterable custom job attributes that are not covered by the provided structured fields. diff --git a/google/cloud/talent_v4beta1/types/job_service.py b/google/cloud/talent_v4beta1/types/job_service.py index 2f2b32dc..38389157 100644 --- a/google/cloud/talent_v4beta1/types/job_service.py +++ b/google/cloud/talent_v4beta1/types/job_service.py @@ -13,16 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import filters -from google.cloud.talent_v4beta1.types import histogram -from google.cloud.talent_v4beta1.types import job as gct_job from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4beta1.types import common, filters, histogram +from google.cloud.talent_v4beta1.types import job as gct_job __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/profile.py b/google/cloud/talent_v4beta1/types/profile.py index fde9f272..7b4029b3 100644 --- a/google/cloud/talent_v4beta1/types/profile.py +++ b/google/cloud/talent_v4beta1/types/profile.py @@ -13,14 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.talent_v4beta1.types import common from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore +import proto # type: ignore +from google.cloud.talent_v4beta1.types import common __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", @@ -255,7 +254,7 @@ class Profile(proto.Message): assignments (Sequence[str]): Output only. The resource names of the candidate's assignments. - custom_attributes (Sequence[google.cloud.talent_v4beta1.types.Profile.CustomAttributesEntry]): + custom_attributes (Mapping[str, google.cloud.talent_v4beta1.types.CustomAttribute]): A map of fields to hold both filterable and non-filterable custom profile attributes that aren't covered by the provided structured fields. See diff --git a/google/cloud/talent_v4beta1/types/profile_service.py b/google/cloud/talent_v4beta1/types/profile_service.py index 7f281986..6542459c 100644 --- a/google/cloud/talent_v4beta1/types/profile_service.py +++ b/google/cloud/talent_v4beta1/types/profile_service.py @@ -13,14 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import filters -from google.cloud.talent_v4beta1.types import histogram +from google.cloud.talent_v4beta1.types import common, filters, histogram from google.cloud.talent_v4beta1.types import profile as gct_profile -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/google/cloud/talent_v4beta1/types/tenant.py b/google/cloud/talent_v4beta1/types/tenant.py index 45a3ab50..91c9e438 100644 --- a/google/cloud/talent_v4beta1/types/tenant.py +++ b/google/cloud/talent_v4beta1/types/tenant.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", manifest={ diff --git a/google/cloud/talent_v4beta1/types/tenant_service.py b/google/cloud/talent_v4beta1/types/tenant_service.py index 78e30c89..0bc8551c 100644 --- a/google/cloud/talent_v4beta1/types/tenant_service.py +++ b/google/cloud/talent_v4beta1/types/tenant_service.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.talent_v4beta1.types import common from google.cloud.talent_v4beta1.types import tenant as gct_tenant -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", diff --git a/noxfile.py b/noxfile.py index 3addb4ed..7c1742d2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,19 +17,45 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil +import warnings import nox - BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -59,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -70,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) @@ -81,23 +127,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -121,6 +185,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -143,13 +236,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: diff --git a/samples/generated_samples/snippet_metadata_talent_v4.json b/samples/generated_samples/snippet_metadata_talent_v4.json index cb0ca990..b705b9f3 100644 --- a/samples/generated_samples/snippet_metadata_talent_v4.json +++ b/samples/generated_samples/snippet_metadata_talent_v4.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.talent.v4", + "version": "v4" + } + ], + "language": "PYTHON", + "name": "google-cloud-talent" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient.create_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.CreateCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "CreateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateCompanyRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "company", + "type": "google.cloud.talent_v4.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "create_company" }, + "description": "Sample for CreateCompany", "file": "jobs_v4_generated_company_service_create_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_CreateCompany_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_create_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceClient.create_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.CreateCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "CreateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateCompanyRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "company", + "type": "google.cloud.talent_v4.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "create_company" }, + "description": "Sample for CreateCompany", "file": "jobs_v4_generated_company_service_create_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_CreateCompany_sync", "segments": [ { @@ -87,19 +176,54 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_create_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient.delete_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.DeleteCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "DeleteCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_company" }, + "description": "Sample for DeleteCompany", "file": "jobs_v4_generated_company_service_delete_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_DeleteCompany_async", "segments": [ { @@ -130,18 +254,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_delete_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceClient.delete_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.DeleteCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "DeleteCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_company" }, + "description": "Sample for DeleteCompany", "file": "jobs_v4_generated_company_service_delete_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_DeleteCompany_sync", "segments": [ { @@ -172,19 +331,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_delete_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient.get_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.GetCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "GetCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "get_company" }, + "description": "Sample for GetCompany", "file": "jobs_v4_generated_company_service_get_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_GetCompany_async", "segments": [ { @@ -217,18 +412,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_get_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceClient.get_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.GetCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "GetCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "get_company" }, + "description": "Sample for GetCompany", "file": "jobs_v4_generated_company_service_get_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_GetCompany_sync", "segments": [ { @@ -261,19 +492,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_get_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient.list_companies", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.ListCompanies", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "ListCompanies" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListCompaniesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.company_service.pagers.ListCompaniesAsyncPager", + "shortName": "list_companies" }, + "description": "Sample for ListCompanies", "file": "jobs_v4_generated_company_service_list_companies_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_ListCompanies_async", "segments": [ { @@ -306,18 +573,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_list_companies_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceClient.list_companies", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.ListCompanies", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "ListCompanies" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListCompaniesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.company_service.pagers.ListCompaniesPager", + "shortName": "list_companies" }, + "description": "Sample for ListCompanies", "file": "jobs_v4_generated_company_service_list_companies_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_ListCompanies_sync", "segments": [ { @@ -350,19 +653,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_list_companies_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceAsyncClient.update_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.UpdateCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "UpdateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateCompanyRequest" + }, + { + "name": "company", + "type": "google.cloud.talent_v4.types.Company" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "update_company" }, + "description": "Sample for UpdateCompany", "file": "jobs_v4_generated_company_service_update_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_UpdateCompany_async", "segments": [ { @@ -395,18 +738,58 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_update_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4.CompanyServiceClient.update_company", "method": { + "fullName": "google.cloud.talent.v4.CompanyService.UpdateCompany", "service": { + "fullName": "google.cloud.talent.v4.CompanyService", "shortName": "CompanyService" }, "shortName": "UpdateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateCompanyRequest" + }, + { + "name": "company", + "type": "google.cloud.talent_v4.types.Company" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Company", + "shortName": "update_company" }, + "description": "Sample for UpdateCompany", "file": "jobs_v4_generated_company_service_update_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_CompanyService_UpdateCompany_sync", "segments": [ { @@ -439,19 +822,51 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_company_service_update_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.CompletionAsyncClient", + "shortName": "CompletionAsyncClient" + }, + "fullName": "google.cloud.talent_v4.CompletionAsyncClient.complete_query", "method": { + "fullName": "google.cloud.talent.v4.Completion.CompleteQuery", "service": { + "fullName": "google.cloud.talent.v4.Completion", "shortName": "Completion" }, "shortName": "CompleteQuery" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CompleteQueryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.CompleteQueryResponse", + "shortName": "complete_query" }, + "description": "Sample for CompleteQuery", "file": "jobs_v4_generated_completion_complete_query_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_Completion_CompleteQuery_async", "segments": [ { @@ -484,18 +899,50 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_completion_complete_query_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.CompletionClient", + "shortName": "CompletionClient" + }, + "fullName": "google.cloud.talent_v4.CompletionClient.complete_query", "method": { + "fullName": "google.cloud.talent.v4.Completion.CompleteQuery", "service": { + "fullName": "google.cloud.talent.v4.Completion", "shortName": "Completion" }, "shortName": "CompleteQuery" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CompleteQueryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.CompleteQueryResponse", + "shortName": "complete_query" }, + "description": "Sample for CompleteQuery", "file": "jobs_v4_generated_completion_complete_query_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_Completion_CompleteQuery_sync", "segments": [ { @@ -528,19 +975,59 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_completion_complete_query_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.EventServiceAsyncClient", + "shortName": "EventServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.EventServiceAsyncClient.create_client_event", "method": { + "fullName": "google.cloud.talent.v4.EventService.CreateClientEvent", "service": { + "fullName": "google.cloud.talent.v4.EventService", "shortName": "EventService" }, "shortName": "CreateClientEvent" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateClientEventRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "client_event", + "type": "google.cloud.talent_v4.types.ClientEvent" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.ClientEvent", + "shortName": "create_client_event" }, + "description": "Sample for CreateClientEvent", "file": "jobs_v4_generated_event_service_create_client_event_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_EventService_CreateClientEvent_async", "segments": [ { @@ -573,18 +1060,58 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_event_service_create_client_event_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.EventServiceClient", + "shortName": "EventServiceClient" + }, + "fullName": "google.cloud.talent_v4.EventServiceClient.create_client_event", "method": { + "fullName": "google.cloud.talent.v4.EventService.CreateClientEvent", "service": { + "fullName": "google.cloud.talent.v4.EventService", "shortName": "EventService" }, "shortName": "CreateClientEvent" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateClientEventRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "client_event", + "type": "google.cloud.talent_v4.types.ClientEvent" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.ClientEvent", + "shortName": "create_client_event" }, + "description": "Sample for CreateClientEvent", "file": "jobs_v4_generated_event_service_create_client_event_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_EventService_CreateClientEvent_sync", "segments": [ { @@ -617,19 +1144,59 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_event_service_create_client_event_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.batch_create_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchCreateJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchCreateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchCreateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_create_jobs" }, + "description": "Sample for BatchCreateJobs", "file": "jobs_v4_generated_job_service_batch_create_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchCreateJobs_async", "segments": [ { @@ -662,18 +1229,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_create_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.batch_create_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchCreateJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchCreateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchCreateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_create_jobs" }, + "description": "Sample for BatchCreateJobs", "file": "jobs_v4_generated_job_service_batch_create_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchCreateJobs_sync", "segments": [ { @@ -706,19 +1313,59 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_create_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.batch_delete_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchDeleteJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchDeleteJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchDeleteJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "names", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_delete_jobs" }, + "description": "Sample for BatchDeleteJobs", "file": "jobs_v4_generated_job_service_batch_delete_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchDeleteJobs_async", "segments": [ { @@ -751,18 +1398,58 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_delete_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.batch_delete_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchDeleteJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchDeleteJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchDeleteJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "names", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_delete_jobs" }, + "description": "Sample for BatchDeleteJobs", "file": "jobs_v4_generated_job_service_batch_delete_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchDeleteJobs_sync", "segments": [ { @@ -795,19 +1482,59 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_delete_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.batch_update_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchUpdateJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchUpdateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchUpdateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_update_jobs" }, + "description": "Sample for BatchUpdateJobs", "file": "jobs_v4_generated_job_service_batch_update_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchUpdateJobs_async", "segments": [ { @@ -840,18 +1567,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_update_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.batch_update_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.BatchUpdateJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "BatchUpdateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.BatchUpdateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_update_jobs" }, + "description": "Sample for BatchUpdateJobs", "file": "jobs_v4_generated_job_service_batch_update_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_BatchUpdateJobs_sync", "segments": [ { @@ -884,19 +1651,59 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_batch_update_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.create_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.CreateJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "CreateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.talent_v4.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "create_job" }, + "description": "Sample for CreateJob", "file": "jobs_v4_generated_job_service_create_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_CreateJob_async", "segments": [ { @@ -929,18 +1736,58 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_create_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.create_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.CreateJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "CreateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.talent_v4.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "create_job" }, + "description": "Sample for CreateJob", "file": "jobs_v4_generated_job_service_create_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_CreateJob_sync", "segments": [ { @@ -973,19 +1820,54 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_create_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.delete_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.DeleteJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "DeleteJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_job" }, + "description": "Sample for DeleteJob", "file": "jobs_v4_generated_job_service_delete_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_DeleteJob_async", "segments": [ { @@ -1016,18 +1898,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_delete_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.delete_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.DeleteJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "DeleteJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_job" }, + "description": "Sample for DeleteJob", "file": "jobs_v4_generated_job_service_delete_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_DeleteJob_sync", "segments": [ { @@ -1058,19 +1975,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_delete_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.get_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.GetJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "GetJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "get_job" }, + "description": "Sample for GetJob", "file": "jobs_v4_generated_job_service_get_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_GetJob_async", "segments": [ { @@ -1103,18 +2056,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_get_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.get_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.GetJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "GetJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "get_job" }, + "description": "Sample for GetJob", "file": "jobs_v4_generated_job_service_get_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_GetJob_sync", "segments": [ { @@ -1147,19 +2136,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_get_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.list_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.ListJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "ListJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.job_service.pagers.ListJobsAsyncPager", + "shortName": "list_jobs" }, + "description": "Sample for ListJobs", "file": "jobs_v4_generated_job_service_list_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_ListJobs_async", "segments": [ { @@ -1192,18 +2221,58 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_list_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.list_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.ListJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "ListJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.job_service.pagers.ListJobsPager", + "shortName": "list_jobs" }, + "description": "Sample for ListJobs", "file": "jobs_v4_generated_job_service_list_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_ListJobs_sync", "segments": [ { @@ -1236,19 +2305,51 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_list_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.search_jobs_for_alert", "method": { + "fullName": "google.cloud.talent.v4.JobService.SearchJobsForAlert", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "SearchJobsForAlert" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.SearchJobsResponse", + "shortName": "search_jobs_for_alert" }, + "description": "Sample for SearchJobsForAlert", "file": "jobs_v4_generated_job_service_search_jobs_for_alert_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_SearchJobsForAlert_async", "segments": [ { @@ -1281,18 +2382,50 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_search_jobs_for_alert_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.search_jobs_for_alert", "method": { + "fullName": "google.cloud.talent.v4.JobService.SearchJobsForAlert", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "SearchJobsForAlert" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.SearchJobsResponse", + "shortName": "search_jobs_for_alert" }, + "description": "Sample for SearchJobsForAlert", "file": "jobs_v4_generated_job_service_search_jobs_for_alert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_SearchJobsForAlert_sync", "segments": [ { @@ -1325,19 +2458,51 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_search_jobs_for_alert_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.search_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.SearchJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "SearchJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.SearchJobsResponse", + "shortName": "search_jobs" }, + "description": "Sample for SearchJobs", "file": "jobs_v4_generated_job_service_search_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_SearchJobs_async", "segments": [ { @@ -1370,18 +2535,50 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_search_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.search_jobs", "method": { + "fullName": "google.cloud.talent.v4.JobService.SearchJobs", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "SearchJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.SearchJobsResponse", + "shortName": "search_jobs" }, + "description": "Sample for SearchJobs", "file": "jobs_v4_generated_job_service_search_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_SearchJobs_sync", "segments": [ { @@ -1414,19 +2611,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_search_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceAsyncClient.update_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.UpdateJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "UpdateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateJobRequest" + }, + { + "name": "job", + "type": "google.cloud.talent_v4.types.Job" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "update_job" }, + "description": "Sample for UpdateJob", "file": "jobs_v4_generated_job_service_update_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_UpdateJob_async", "segments": [ { @@ -1459,18 +2696,58 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_update_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4.JobServiceClient.update_job", "method": { + "fullName": "google.cloud.talent.v4.JobService.UpdateJob", "service": { + "fullName": "google.cloud.talent.v4.JobService", "shortName": "JobService" }, "shortName": "UpdateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateJobRequest" + }, + { + "name": "job", + "type": "google.cloud.talent_v4.types.Job" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Job", + "shortName": "update_job" }, + "description": "Sample for UpdateJob", "file": "jobs_v4_generated_job_service_update_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_JobService_UpdateJob_sync", "segments": [ { @@ -1503,19 +2780,59 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_job_service_update_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient.create_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.CreateTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "CreateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateTenantRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "create_tenant" }, + "description": "Sample for CreateTenant", "file": "jobs_v4_generated_tenant_service_create_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_CreateTenant_async", "segments": [ { @@ -1548,18 +2865,58 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_create_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceClient.create_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.CreateTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "CreateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.CreateTenantRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "create_tenant" }, + "description": "Sample for CreateTenant", "file": "jobs_v4_generated_tenant_service_create_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_CreateTenant_sync", "segments": [ { @@ -1592,19 +2949,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_create_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient.delete_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.DeleteTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "DeleteTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_tenant" }, + "description": "Sample for DeleteTenant", "file": "jobs_v4_generated_tenant_service_delete_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_DeleteTenant_async", "segments": [ { @@ -1635,18 +3027,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_delete_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceClient.delete_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.DeleteTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "DeleteTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.DeleteTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_tenant" }, + "description": "Sample for DeleteTenant", "file": "jobs_v4_generated_tenant_service_delete_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_DeleteTenant_sync", "segments": [ { @@ -1677,19 +3104,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_delete_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient.get_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.GetTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "GetTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "get_tenant" }, + "description": "Sample for GetTenant", "file": "jobs_v4_generated_tenant_service_get_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_GetTenant_async", "segments": [ { @@ -1722,18 +3185,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_get_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceClient.get_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.GetTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "GetTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.GetTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "get_tenant" }, + "description": "Sample for GetTenant", "file": "jobs_v4_generated_tenant_service_get_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_GetTenant_sync", "segments": [ { @@ -1766,19 +3265,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_get_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient.list_tenants", "method": { + "fullName": "google.cloud.talent.v4.TenantService.ListTenants", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "ListTenants" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListTenantsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.tenant_service.pagers.ListTenantsAsyncPager", + "shortName": "list_tenants" }, + "description": "Sample for ListTenants", "file": "jobs_v4_generated_tenant_service_list_tenants_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_ListTenants_async", "segments": [ { @@ -1811,18 +3346,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_list_tenants_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceClient.list_tenants", "method": { + "fullName": "google.cloud.talent.v4.TenantService.ListTenants", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "ListTenants" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.ListTenantsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.services.tenant_service.pagers.ListTenantsPager", + "shortName": "list_tenants" }, + "description": "Sample for ListTenants", "file": "jobs_v4_generated_tenant_service_list_tenants_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_ListTenants_sync", "segments": [ { @@ -1855,19 +3426,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_list_tenants_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceAsyncClient.update_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.UpdateTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "UpdateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateTenantRequest" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4.types.Tenant" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "update_tenant" }, + "description": "Sample for UpdateTenant", "file": "jobs_v4_generated_tenant_service_update_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_UpdateTenant_async", "segments": [ { @@ -1900,18 +3511,58 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_update_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4.TenantServiceClient.update_tenant", "method": { + "fullName": "google.cloud.talent.v4.TenantService.UpdateTenant", "service": { + "fullName": "google.cloud.talent.v4.TenantService", "shortName": "TenantService" }, "shortName": "UpdateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4.types.UpdateTenantRequest" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4.types.Tenant" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4.types.Tenant", + "shortName": "update_tenant" }, + "description": "Sample for UpdateTenant", "file": "jobs_v4_generated_tenant_service_update_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4_generated_TenantService_UpdateTenant_sync", "segments": [ { @@ -1944,7 +3595,8 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4_generated_tenant_service_update_tenant_sync.py" } ] } diff --git a/samples/generated_samples/snippet_metadata_talent_v4beta1.json b/samples/generated_samples/snippet_metadata_talent_v4beta1.json index fc4c9567..abf494cd 100644 --- a/samples/generated_samples/snippet_metadata_talent_v4beta1.json +++ b/samples/generated_samples/snippet_metadata_talent_v4beta1.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.talent.v4beta1", + "version": "v4beta1" + } + ], + "language": "PYTHON", + "name": "google-cloud-talent" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient", + "shortName": "ApplicationServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient.create_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.CreateApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "CreateApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateApplicationRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "application", + "type": "google.cloud.talent_v4beta1.types.Application" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "create_application" }, + "description": "Sample for CreateApplication", "file": "jobs_v4beta1_generated_application_service_create_application_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_CreateApplication_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_create_application_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient", + "shortName": "ApplicationServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient.create_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.CreateApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "CreateApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateApplicationRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "application", + "type": "google.cloud.talent_v4beta1.types.Application" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "create_application" }, + "description": "Sample for CreateApplication", "file": "jobs_v4beta1_generated_application_service_create_application_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_CreateApplication_sync", "segments": [ { @@ -87,19 +176,54 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_create_application_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient", + "shortName": "ApplicationServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient.delete_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.DeleteApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "DeleteApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteApplicationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_application" }, + "description": "Sample for DeleteApplication", "file": "jobs_v4beta1_generated_application_service_delete_application_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_DeleteApplication_async", "segments": [ { @@ -130,18 +254,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_delete_application_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient", + "shortName": "ApplicationServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient.delete_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.DeleteApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "DeleteApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteApplicationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_application" }, + "description": "Sample for DeleteApplication", "file": "jobs_v4beta1_generated_application_service_delete_application_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_DeleteApplication_sync", "segments": [ { @@ -172,19 +331,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_delete_application_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient", + "shortName": "ApplicationServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient.get_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.GetApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "GetApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetApplicationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "get_application" }, + "description": "Sample for GetApplication", "file": "jobs_v4beta1_generated_application_service_get_application_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_GetApplication_async", "segments": [ { @@ -217,18 +412,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_get_application_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient", + "shortName": "ApplicationServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient.get_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.GetApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "GetApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetApplicationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "get_application" }, + "description": "Sample for GetApplication", "file": "jobs_v4beta1_generated_application_service_get_application_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_GetApplication_sync", "segments": [ { @@ -261,19 +492,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_get_application_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient", + "shortName": "ApplicationServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient.list_applications", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.ListApplications", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "ListApplications" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListApplicationsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.application_service.pagers.ListApplicationsAsyncPager", + "shortName": "list_applications" }, + "description": "Sample for ListApplications", "file": "jobs_v4beta1_generated_application_service_list_applications_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_ListApplications_async", "segments": [ { @@ -306,18 +573,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_list_applications_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient", + "shortName": "ApplicationServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient.list_applications", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.ListApplications", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "ListApplications" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListApplicationsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.application_service.pagers.ListApplicationsPager", + "shortName": "list_applications" }, + "description": "Sample for ListApplications", "file": "jobs_v4beta1_generated_application_service_list_applications_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_ListApplications_sync", "segments": [ { @@ -350,19 +653,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_list_applications_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient", + "shortName": "ApplicationServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceAsyncClient.update_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.UpdateApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "UpdateApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateApplicationRequest" + }, + { + "name": "application", + "type": "google.cloud.talent_v4beta1.types.Application" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "update_application" }, + "description": "Sample for UpdateApplication", "file": "jobs_v4beta1_generated_application_service_update_application_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_UpdateApplication_async", "segments": [ { @@ -395,18 +734,54 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_update_application_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient", + "shortName": "ApplicationServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ApplicationServiceClient.update_application", "method": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService.UpdateApplication", "service": { + "fullName": "google.cloud.talent.v4beta1.ApplicationService", "shortName": "ApplicationService" }, "shortName": "UpdateApplication" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateApplicationRequest" + }, + { + "name": "application", + "type": "google.cloud.talent_v4beta1.types.Application" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Application", + "shortName": "update_application" }, + "description": "Sample for UpdateApplication", "file": "jobs_v4beta1_generated_application_service_update_application_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ApplicationService_UpdateApplication_sync", "segments": [ { @@ -439,19 +814,59 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_application_service_update_application_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient.create_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "CreateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateCompanyRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "company", + "type": "google.cloud.talent_v4beta1.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "create_company" }, + "description": "Sample for CreateCompany", "file": "jobs_v4beta1_generated_company_service_create_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_CreateCompany_async", "segments": [ { @@ -484,18 +899,58 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_create_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient.create_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "CreateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateCompanyRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "company", + "type": "google.cloud.talent_v4beta1.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "create_company" }, + "description": "Sample for CreateCompany", "file": "jobs_v4beta1_generated_company_service_create_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_CreateCompany_sync", "segments": [ { @@ -528,19 +983,54 @@ "start": 47, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_create_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient.delete_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "DeleteCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_company" }, + "description": "Sample for DeleteCompany", "file": "jobs_v4beta1_generated_company_service_delete_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_DeleteCompany_async", "segments": [ { @@ -571,18 +1061,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_delete_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient.delete_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "DeleteCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_company" }, + "description": "Sample for DeleteCompany", "file": "jobs_v4beta1_generated_company_service_delete_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_DeleteCompany_sync", "segments": [ { @@ -613,19 +1138,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_delete_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient.get_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.GetCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "GetCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "get_company" }, + "description": "Sample for GetCompany", "file": "jobs_v4beta1_generated_company_service_get_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_GetCompany_async", "segments": [ { @@ -658,18 +1219,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_get_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient.get_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.GetCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "GetCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetCompanyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "get_company" }, + "description": "Sample for GetCompany", "file": "jobs_v4beta1_generated_company_service_get_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_GetCompany_sync", "segments": [ { @@ -702,19 +1299,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_get_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient.list_companies", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "ListCompanies" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListCompaniesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.company_service.pagers.ListCompaniesAsyncPager", + "shortName": "list_companies" }, + "description": "Sample for ListCompanies", "file": "jobs_v4beta1_generated_company_service_list_companies_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_ListCompanies_async", "segments": [ { @@ -747,18 +1380,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_list_companies_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient.list_companies", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "ListCompanies" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListCompaniesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.company_service.pagers.ListCompaniesPager", + "shortName": "list_companies" }, + "description": "Sample for ListCompanies", "file": "jobs_v4beta1_generated_company_service_list_companies_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_ListCompanies_sync", "segments": [ { @@ -791,19 +1460,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_list_companies_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient", + "shortName": "CompanyServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceAsyncClient.update_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "UpdateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateCompanyRequest" + }, + { + "name": "company", + "type": "google.cloud.talent_v4beta1.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "update_company" }, + "description": "Sample for UpdateCompany", "file": "jobs_v4beta1_generated_company_service_update_company_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_UpdateCompany_async", "segments": [ { @@ -836,18 +1541,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_update_company_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient", + "shortName": "CompanyServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompanyServiceClient.update_company", "method": { + "fullName": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", "service": { + "fullName": "google.cloud.talent.v4beta1.CompanyService", "shortName": "CompanyService" }, "shortName": "UpdateCompany" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateCompanyRequest" + }, + { + "name": "company", + "type": "google.cloud.talent_v4beta1.types.Company" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Company", + "shortName": "update_company" }, + "description": "Sample for UpdateCompany", "file": "jobs_v4beta1_generated_company_service_update_company_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_CompanyService_UpdateCompany_sync", "segments": [ { @@ -880,19 +1621,51 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_company_service_update_company_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.CompletionAsyncClient", + "shortName": "CompletionAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompletionAsyncClient.complete_query", "method": { + "fullName": "google.cloud.talent.v4beta1.Completion.CompleteQuery", "service": { + "fullName": "google.cloud.talent.v4beta1.Completion", "shortName": "Completion" }, "shortName": "CompleteQuery" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CompleteQueryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.CompleteQueryResponse", + "shortName": "complete_query" }, + "description": "Sample for CompleteQuery", "file": "jobs_v4beta1_generated_completion_complete_query_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_Completion_CompleteQuery_async", "segments": [ { @@ -925,18 +1698,50 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_completion_complete_query_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.CompletionClient", + "shortName": "CompletionClient" + }, + "fullName": "google.cloud.talent_v4beta1.CompletionClient.complete_query", "method": { + "fullName": "google.cloud.talent.v4beta1.Completion.CompleteQuery", "service": { + "fullName": "google.cloud.talent.v4beta1.Completion", "shortName": "Completion" }, "shortName": "CompleteQuery" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CompleteQueryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.CompleteQueryResponse", + "shortName": "complete_query" }, + "description": "Sample for CompleteQuery", "file": "jobs_v4beta1_generated_completion_complete_query_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_Completion_CompleteQuery_sync", "segments": [ { @@ -969,19 +1774,59 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_completion_complete_query_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.EventServiceAsyncClient", + "shortName": "EventServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.EventServiceAsyncClient.create_client_event", "method": { + "fullName": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", "service": { + "fullName": "google.cloud.talent.v4beta1.EventService", "shortName": "EventService" }, "shortName": "CreateClientEvent" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateClientEventRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "client_event", + "type": "google.cloud.talent_v4beta1.types.ClientEvent" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.ClientEvent", + "shortName": "create_client_event" }, + "description": "Sample for CreateClientEvent", "file": "jobs_v4beta1_generated_event_service_create_client_event_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_EventService_CreateClientEvent_async", "segments": [ { @@ -1014,18 +1859,58 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_event_service_create_client_event_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.EventServiceClient", + "shortName": "EventServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.EventServiceClient.create_client_event", "method": { + "fullName": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", "service": { + "fullName": "google.cloud.talent.v4beta1.EventService", "shortName": "EventService" }, "shortName": "CreateClientEvent" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateClientEventRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "client_event", + "type": "google.cloud.talent_v4beta1.types.ClientEvent" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.ClientEvent", + "shortName": "create_client_event" }, + "description": "Sample for CreateClientEvent", "file": "jobs_v4beta1_generated_event_service_create_client_event_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_EventService_CreateClientEvent_sync", "segments": [ { @@ -1058,19 +1943,59 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_event_service_create_client_event_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.batch_create_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchCreateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchCreateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4beta1.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_create_jobs" }, + "description": "Sample for BatchCreateJobs", "file": "jobs_v4beta1_generated_job_service_batch_create_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchCreateJobs_async", "segments": [ { @@ -1103,18 +2028,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_create_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.batch_create_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchCreateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchCreateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4beta1.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_create_jobs" }, + "description": "Sample for BatchCreateJobs", "file": "jobs_v4beta1_generated_job_service_batch_create_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchCreateJobs_sync", "segments": [ { @@ -1147,19 +2112,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_create_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.batch_delete_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchDeleteJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchDeleteJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "batch_delete_jobs" }, + "description": "Sample for BatchDeleteJobs", "file": "jobs_v4beta1_generated_job_service_batch_delete_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchDeleteJobs_async", "segments": [ { @@ -1190,18 +2194,57 @@ "end": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_delete_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.batch_delete_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchDeleteJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchDeleteJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "batch_delete_jobs" }, + "description": "Sample for BatchDeleteJobs", "file": "jobs_v4beta1_generated_job_service_batch_delete_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync", "segments": [ { @@ -1232,19 +2275,59 @@ "end": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_delete_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.batch_update_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchUpdateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchUpdateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4beta1.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_update_jobs" }, + "description": "Sample for BatchUpdateJobs", "file": "jobs_v4beta1_generated_job_service_batch_update_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchUpdateJobs_async", "segments": [ { @@ -1277,18 +2360,58 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_update_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.batch_update_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "BatchUpdateJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.BatchUpdateJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "jobs", + "type": "Sequence[google.cloud.talent_v4beta1.types.Job]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_update_jobs" }, + "description": "Sample for BatchUpdateJobs", "file": "jobs_v4beta1_generated_job_service_batch_update_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync", "segments": [ { @@ -1321,19 +2444,59 @@ "start": 53, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_batch_update_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.create_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.CreateJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "CreateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.talent_v4beta1.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "create_job" }, + "description": "Sample for CreateJob", "file": "jobs_v4beta1_generated_job_service_create_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_CreateJob_async", "segments": [ { @@ -1366,18 +2529,58 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_create_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.create_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.CreateJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "CreateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.talent_v4beta1.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "create_job" }, + "description": "Sample for CreateJob", "file": "jobs_v4beta1_generated_job_service_create_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_CreateJob_sync", "segments": [ { @@ -1410,19 +2613,54 @@ "start": 49, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_create_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.delete_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.DeleteJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "DeleteJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_job" }, + "description": "Sample for DeleteJob", "file": "jobs_v4beta1_generated_job_service_delete_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_DeleteJob_async", "segments": [ { @@ -1453,18 +2691,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_delete_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.delete_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.DeleteJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "DeleteJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_job" }, + "description": "Sample for DeleteJob", "file": "jobs_v4beta1_generated_job_service_delete_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_DeleteJob_sync", "segments": [ { @@ -1495,19 +2768,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_delete_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.get_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.GetJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "GetJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "get_job" }, + "description": "Sample for GetJob", "file": "jobs_v4beta1_generated_job_service_get_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_GetJob_async", "segments": [ { @@ -1540,18 +2849,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_get_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.get_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.GetJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "GetJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "get_job" }, + "description": "Sample for GetJob", "file": "jobs_v4beta1_generated_job_service_get_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_GetJob_sync", "segments": [ { @@ -1584,19 +2929,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_get_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.list_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.ListJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "ListJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.ListJobsAsyncPager", + "shortName": "list_jobs" }, + "description": "Sample for ListJobs", "file": "jobs_v4beta1_generated_job_service_list_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_ListJobs_async", "segments": [ { @@ -1629,18 +3014,58 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_list_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.list_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.ListJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "ListJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "filter", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.ListJobsPager", + "shortName": "list_jobs" }, + "description": "Sample for ListJobs", "file": "jobs_v4beta1_generated_job_service_list_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_ListJobs_sync", "segments": [ { @@ -1673,19 +3098,51 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_list_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.search_jobs_for_alert", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "SearchJobsForAlert" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.SearchJobsForAlertAsyncPager", + "shortName": "search_jobs_for_alert" }, + "description": "Sample for SearchJobsForAlert", "file": "jobs_v4beta1_generated_job_service_search_jobs_for_alert_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_SearchJobsForAlert_async", "segments": [ { @@ -1718,18 +3175,50 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_search_jobs_for_alert_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.search_jobs_for_alert", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "SearchJobsForAlert" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.SearchJobsForAlertPager", + "shortName": "search_jobs_for_alert" }, + "description": "Sample for SearchJobsForAlert", "file": "jobs_v4beta1_generated_job_service_search_jobs_for_alert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync", "segments": [ { @@ -1762,19 +3251,51 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_search_jobs_for_alert_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.search_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "SearchJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.SearchJobsAsyncPager", + "shortName": "search_jobs" }, + "description": "Sample for SearchJobs", "file": "jobs_v4beta1_generated_job_service_search_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_SearchJobs_async", "segments": [ { @@ -1807,18 +3328,50 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_search_jobs_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.search_jobs", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobs", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "SearchJobs" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchJobsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.job_service.pagers.SearchJobsPager", + "shortName": "search_jobs" }, + "description": "Sample for SearchJobs", "file": "jobs_v4beta1_generated_job_service_search_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_SearchJobs_sync", "segments": [ { @@ -1851,19 +3404,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_search_jobs_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient", + "shortName": "JobServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceAsyncClient.update_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.UpdateJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "UpdateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateJobRequest" + }, + { + "name": "job", + "type": "google.cloud.talent_v4beta1.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "update_job" }, + "description": "Sample for UpdateJob", "file": "jobs_v4beta1_generated_job_service_update_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_UpdateJob_async", "segments": [ { @@ -1896,18 +3485,54 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_update_job_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.JobServiceClient", + "shortName": "JobServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.JobServiceClient.update_job", "method": { + "fullName": "google.cloud.talent.v4beta1.JobService.UpdateJob", "service": { + "fullName": "google.cloud.talent.v4beta1.JobService", "shortName": "JobService" }, "shortName": "UpdateJob" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateJobRequest" + }, + { + "name": "job", + "type": "google.cloud.talent_v4beta1.types.Job" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Job", + "shortName": "update_job" }, + "description": "Sample for UpdateJob", "file": "jobs_v4beta1_generated_job_service_update_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_JobService_UpdateJob_sync", "segments": [ { @@ -1940,19 +3565,59 @@ "start": 48, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_job_service_update_job_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.create_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.CreateProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "CreateProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "profile", + "type": "google.cloud.talent_v4beta1.types.Profile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "create_profile" }, + "description": "Sample for CreateProfile", "file": "jobs_v4beta1_generated_profile_service_create_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_CreateProfile_async", "segments": [ { @@ -1985,18 +3650,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_create_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.create_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.CreateProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "CreateProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "profile", + "type": "google.cloud.talent_v4beta1.types.Profile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "create_profile" }, + "description": "Sample for CreateProfile", "file": "jobs_v4beta1_generated_profile_service_create_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_CreateProfile_sync", "segments": [ { @@ -2029,19 +3734,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_create_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.delete_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.DeleteProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "DeleteProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_profile" }, + "description": "Sample for DeleteProfile", "file": "jobs_v4beta1_generated_profile_service_delete_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_DeleteProfile_async", "segments": [ { @@ -2072,18 +3812,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_delete_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.delete_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.DeleteProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "DeleteProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_profile" }, + "description": "Sample for DeleteProfile", "file": "jobs_v4beta1_generated_profile_service_delete_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_DeleteProfile_sync", "segments": [ { @@ -2114,19 +3889,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_delete_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.get_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.GetProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "GetProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "get_profile" }, + "description": "Sample for GetProfile", "file": "jobs_v4beta1_generated_profile_service_get_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_GetProfile_async", "segments": [ { @@ -2159,18 +3970,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_get_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.get_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.GetProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "GetProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "get_profile" }, + "description": "Sample for GetProfile", "file": "jobs_v4beta1_generated_profile_service_get_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_GetProfile_sync", "segments": [ { @@ -2203,19 +4050,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_get_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.list_profiles", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.ListProfiles", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "ListProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.profile_service.pagers.ListProfilesAsyncPager", + "shortName": "list_profiles" }, + "description": "Sample for ListProfiles", "file": "jobs_v4beta1_generated_profile_service_list_profiles_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_ListProfiles_async", "segments": [ { @@ -2248,18 +4131,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_list_profiles_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.list_profiles", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.ListProfiles", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "ListProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.profile_service.pagers.ListProfilesPager", + "shortName": "list_profiles" }, + "description": "Sample for ListProfiles", "file": "jobs_v4beta1_generated_profile_service_list_profiles_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_ListProfiles_sync", "segments": [ { @@ -2292,19 +4211,51 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_list_profiles_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.search_profiles", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.SearchProfiles", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "SearchProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchProfilesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.profile_service.pagers.SearchProfilesAsyncPager", + "shortName": "search_profiles" }, + "description": "Sample for SearchProfiles", "file": "jobs_v4beta1_generated_profile_service_search_profiles_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_SearchProfiles_async", "segments": [ { @@ -2337,18 +4288,50 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_search_profiles_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.search_profiles", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.SearchProfiles", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "SearchProfiles" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.SearchProfilesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.profile_service.pagers.SearchProfilesPager", + "shortName": "search_profiles" }, + "description": "Sample for SearchProfiles", "file": "jobs_v4beta1_generated_profile_service_search_profiles_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_SearchProfiles_sync", "segments": [ { @@ -2381,19 +4364,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_search_profiles_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient", + "shortName": "ProfileServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceAsyncClient.update_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.UpdateProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "UpdateProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateProfileRequest" + }, + { + "name": "profile", + "type": "google.cloud.talent_v4beta1.types.Profile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "update_profile" }, + "description": "Sample for UpdateProfile", "file": "jobs_v4beta1_generated_profile_service_update_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_UpdateProfile_async", "segments": [ { @@ -2426,18 +4445,54 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_update_profile_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient", + "shortName": "ProfileServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.ProfileServiceClient.update_profile", "method": { + "fullName": "google.cloud.talent.v4beta1.ProfileService.UpdateProfile", "service": { + "fullName": "google.cloud.talent.v4beta1.ProfileService", "shortName": "ProfileService" }, "shortName": "UpdateProfile" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateProfileRequest" + }, + { + "name": "profile", + "type": "google.cloud.talent_v4beta1.types.Profile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Profile", + "shortName": "update_profile" }, + "description": "Sample for UpdateProfile", "file": "jobs_v4beta1_generated_profile_service_update_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_ProfileService_UpdateProfile_sync", "segments": [ { @@ -2470,19 +4525,59 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_profile_service_update_profile_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient.create_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.CreateTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "CreateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateTenantRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4beta1.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "create_tenant" }, + "description": "Sample for CreateTenant", "file": "jobs_v4beta1_generated_tenant_service_create_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_CreateTenant_async", "segments": [ { @@ -2515,18 +4610,58 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_create_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient.create_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.CreateTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "CreateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.CreateTenantRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4beta1.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "create_tenant" }, + "description": "Sample for CreateTenant", "file": "jobs_v4beta1_generated_tenant_service_create_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_CreateTenant_sync", "segments": [ { @@ -2559,19 +4694,54 @@ "start": 46, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_create_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient.delete_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "DeleteTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_tenant" }, + "description": "Sample for DeleteTenant", "file": "jobs_v4beta1_generated_tenant_service_delete_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_DeleteTenant_async", "segments": [ { @@ -2602,18 +4772,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_delete_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient.delete_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "DeleteTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.DeleteTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_tenant" }, + "description": "Sample for DeleteTenant", "file": "jobs_v4beta1_generated_tenant_service_delete_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_DeleteTenant_sync", "segments": [ { @@ -2644,19 +4849,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_delete_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient.get_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.GetTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "GetTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "get_tenant" }, + "description": "Sample for GetTenant", "file": "jobs_v4beta1_generated_tenant_service_get_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_GetTenant_async", "segments": [ { @@ -2689,18 +4930,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_get_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient.get_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.GetTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "GetTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.GetTenantRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "get_tenant" }, + "description": "Sample for GetTenant", "file": "jobs_v4beta1_generated_tenant_service_get_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_GetTenant_sync", "segments": [ { @@ -2733,19 +5010,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_get_tenant_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient.list_tenants", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.ListTenants", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "ListTenants" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListTenantsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.tenant_service.pagers.ListTenantsAsyncPager", + "shortName": "list_tenants" }, + "description": "Sample for ListTenants", "file": "jobs_v4beta1_generated_tenant_service_list_tenants_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_ListTenants_async", "segments": [ { @@ -2778,18 +5091,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_list_tenants_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient.list_tenants", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.ListTenants", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "ListTenants" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.ListTenantsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.services.tenant_service.pagers.ListTenantsPager", + "shortName": "list_tenants" }, + "description": "Sample for ListTenants", "file": "jobs_v4beta1_generated_tenant_service_list_tenants_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_ListTenants_sync", "segments": [ { @@ -2822,19 +5171,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_list_tenants_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient", + "shortName": "TenantServiceAsyncClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceAsyncClient.update_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "UpdateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateTenantRequest" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4beta1.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "update_tenant" }, + "description": "Sample for UpdateTenant", "file": "jobs_v4beta1_generated_tenant_service_update_tenant_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_UpdateTenant_async", "segments": [ { @@ -2867,18 +5252,54 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_update_tenant_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient", + "shortName": "TenantServiceClient" + }, + "fullName": "google.cloud.talent_v4beta1.TenantServiceClient.update_tenant", "method": { + "fullName": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", "service": { + "fullName": "google.cloud.talent.v4beta1.TenantService", "shortName": "TenantService" }, "shortName": "UpdateTenant" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.talent_v4beta1.types.UpdateTenantRequest" + }, + { + "name": "tenant", + "type": "google.cloud.talent_v4beta1.types.Tenant" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.talent_v4beta1.types.Tenant", + "shortName": "update_tenant" }, + "description": "Sample for UpdateTenant", "file": "jobs_v4beta1_generated_tenant_service_update_tenant_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "jobs_v4beta1_generated_TenantService_UpdateTenant_sync", "segments": [ { @@ -2911,7 +5332,8 @@ "start": 45, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "jobs_v4beta1_generated_tenant_service_update_tenant_sync.py" } ] } diff --git a/samples/snippets/conftest.py b/samples/snippets/conftest.py index 169a401b..3b75da54 100644 --- a/samples/snippets/conftest.py +++ b/samples/snippets/conftest.py @@ -16,7 +16,6 @@ import uuid from google.api_core.exceptions import NotFound - import pytest import job_search_create_company diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 25f87a21..3b3ffa5d 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -22,7 +22,6 @@ import nox - # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING # DO NOT EDIT THIS FILE EVER! @@ -30,6 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING BLACK_VERSION = "black==22.3.0" +ISORT_VERSION = "isort==5.10.1" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -168,12 +168,33 @@ def lint(session: nox.sessions.Session) -> None: @nox.session def blacken(session: nox.sessions.Session) -> None: + """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) python_files = [path for path in os.listdir(".") if path.endswith(".py")] session.run("black", *python_files) +# +# format = isort + black +# + + +@nox.session +def format(session: nox.sessions.Session) -> None: + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run("isort", "--fss", *python_files) + session.run("black", *python_files) + + # # Sample Tests # diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 4f6bf643..d00689e0 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 +pytest==7.1.2 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 8504b256..4023f775 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google.cloud.talent==2.5.1 \ No newline at end of file +google-cloud-talent==2.5.2 diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e9..91b59676 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') diff --git a/setup.py b/setup.py index 5cfbdf22..c5da7ea1 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,11 @@ import setuptools - # Package metadata. name = "google-cloud-talent" description = "Google Cloud Talent Solution API client library" -version = "2.5.2" +version = "2.6.0" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' @@ -33,7 +32,8 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0", + "proto-plus >= 1.15.0, <2.0.0dev", + "protobuf >= 3.19.0, <4.0.0dev", ] extras = {"libcst": "libcst >= 0.2.5"} diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index b666ca6c..ec8ca201 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -7,3 +7,4 @@ # Then this file should have foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 +protobuf==3.19.0 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29b..ec8ca201 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +google-api-core==1.31.5 +proto-plus==1.15.0 +protobuf==3.19.0 diff --git a/tests/unit/gapic/talent_v4/test_company_service.py b/tests/unit/gapic/talent_v4/test_company_service.py index 1a46ce10..93a066be 100644 --- a/tests/unit/gapic/talent_v4/test_company_service.py +++ b/tests/unit/gapic/talent_v4/test_company_service.py @@ -14,36 +14,41 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4.services.company_service import CompanyServiceAsyncClient -from google.cloud.talent_v4.services.company_service import CompanyServiceClient -from google.cloud.talent_v4.services.company_service import pagers -from google.cloud.talent_v4.services.company_service import transports -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import company -from google.cloud.talent_v4.types import company as gct_company -from google.cloud.talent_v4.types import company_service from google.oauth2 import service_account from google.protobuf import field_mask_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4.services.company_service import ( + CompanyServiceAsyncClient, + CompanyServiceClient, + pagers, + transports, +) +from google.cloud.talent_v4.types import common +from google.cloud.talent_v4.types import company +from google.cloud.talent_v4.types import company as gct_company +from google.cloud.talent_v4.types import company_service def client_cert_source_callback(): @@ -91,24 +96,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompanyServiceClient, - CompanyServiceAsyncClient, + (CompanyServiceClient, "grpc"), + (CompanyServiceAsyncClient, "grpc_asyncio"), ], ) -def test_company_service_client_from_service_account_info(client_class): +def test_company_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -137,27 +142,31 @@ def test_company_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompanyServiceClient, - CompanyServiceAsyncClient, + (CompanyServiceClient, "grpc"), + (CompanyServiceAsyncClient, "grpc_asyncio"), ], ) -def test_company_service_client_from_service_account_file(client_class): +def test_company_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_company_service_client_get_transport_class(): @@ -800,7 +809,7 @@ def test_create_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.CreateCompanyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -816,7 +825,7 @@ def test_create_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -830,7 +839,7 @@ async def test_create_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.CreateCompanyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -846,7 +855,7 @@ async def test_create_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1090,7 +1099,7 @@ def test_get_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.GetCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1106,7 +1115,7 @@ def test_get_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1120,7 +1129,7 @@ async def test_get_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.GetCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1136,7 +1145,7 @@ async def test_get_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1370,7 +1379,7 @@ def test_update_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.UpdateCompanyRequest() - request.company.name = "company.name/value" + request.company.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1386,7 +1395,7 @@ def test_update_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "company.name=company.name/value", + "company.name=name_value", ) in kw["metadata"] @@ -1400,7 +1409,7 @@ async def test_update_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.UpdateCompanyRequest() - request.company.name = "company.name/value" + request.company.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1416,7 +1425,7 @@ async def test_update_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "company.name=company.name/value", + "company.name=name_value", ) in kw["metadata"] @@ -1600,7 +1609,7 @@ def test_delete_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.DeleteCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1616,7 +1625,7 @@ def test_delete_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1630,7 +1639,7 @@ async def test_delete_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.DeleteCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1646,7 +1655,7 @@ async def test_delete_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1828,7 +1837,7 @@ def test_list_companies_field_headers(): # a field header. Set these to a non-empty value. request = company_service.ListCompaniesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1844,7 +1853,7 @@ def test_list_companies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1858,7 +1867,7 @@ async def test_list_companies_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.ListCompaniesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1876,7 +1885,7 @@ async def test_list_companies_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2007,7 +2016,7 @@ def test_list_companies_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, company.Company) for i in results) @@ -2096,7 +2105,7 @@ async def test_list_companies_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2142,7 +2151,9 @@ async def test_list_companies_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_companies(request={})).pages: + async for page_ in ( + await client.list_companies(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2239,6 +2250,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CompanyServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CompanyServiceClient( @@ -2285,6 +2309,14 @@ def test_company_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_company_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2442,22 +2474,38 @@ def test_company_service_grpc_transport_client_cert_source_for_mtls(transport_cl ) -def test_company_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_company_service_host_no_port(transport_name): client = CompanyServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_company_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_company_service_host_with_port(transport_name): client = CompanyServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_company_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4/test_completion.py b/tests/unit/gapic/talent_v4/test_completion.py index 06c4f770..0c859577 100644 --- a/tests/unit/gapic/talent_v4/test_completion.py +++ b/tests/unit/gapic/talent_v4/test_completion.py @@ -14,30 +14,34 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4.services.completion import CompletionAsyncClient -from google.cloud.talent_v4.services.completion import CompletionClient -from google.cloud.talent_v4.services.completion import transports -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import completion_service from google.oauth2 import service_account -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4.services.completion import ( + CompletionAsyncClient, + CompletionClient, + transports, +) +from google.cloud.talent_v4.types import common, completion_service def client_cert_source_callback(): @@ -82,24 +86,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompletionClient, - CompletionAsyncClient, + (CompletionClient, "grpc"), + (CompletionAsyncClient, "grpc_asyncio"), ], ) -def test_completion_client_from_service_account_info(client_class): +def test_completion_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -128,27 +132,31 @@ def test_completion_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompletionClient, - CompletionAsyncClient, + (CompletionClient, "grpc"), + (CompletionAsyncClient, "grpc_asyncio"), ], ) -def test_completion_client_from_service_account_file(client_class): +def test_completion_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_completion_client_get_transport_class(): @@ -714,7 +722,7 @@ def test_complete_query_field_headers(): # a field header. Set these to a non-empty value. request = completion_service.CompleteQueryRequest() - request.tenant = "tenant/value" + request.tenant = "tenant_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_query), "__call__") as call: @@ -730,7 +738,7 @@ def test_complete_query_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant=tenant/value", + "tenant=tenant_value", ) in kw["metadata"] @@ -744,7 +752,7 @@ async def test_complete_query_field_headers_async(): # a field header. Set these to a non-empty value. request = completion_service.CompleteQueryRequest() - request.tenant = "tenant/value" + request.tenant = "tenant_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_query), "__call__") as call: @@ -762,7 +770,7 @@ async def test_complete_query_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant=tenant/value", + "tenant=tenant_value", ) in kw["metadata"] @@ -857,6 +865,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CompletionClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CompletionClient( @@ -897,6 +918,14 @@ def test_completion_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_completion_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -1051,22 +1080,38 @@ def test_completion_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_completion_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_completion_host_no_port(transport_name): client = CompletionClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_completion_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_completion_host_with_port(transport_name): client = CompletionClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_completion_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4/test_event_service.py b/tests/unit/gapic/talent_v4/test_event_service.py index 80820cc6..554dc0e0 100644 --- a/tests/unit/gapic/talent_v4/test_event_service.py +++ b/tests/unit/gapic/talent_v4/test_event_service.py @@ -14,31 +14,35 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4.services.event_service import EventServiceAsyncClient -from google.cloud.talent_v4.services.event_service import EventServiceClient -from google.cloud.talent_v4.services.event_service import transports -from google.cloud.talent_v4.types import event -from google.cloud.talent_v4.types import event_service from google.oauth2 import service_account from google.protobuf import timestamp_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4.services.event_service import ( + EventServiceAsyncClient, + EventServiceClient, + transports, +) +from google.cloud.talent_v4.types import event, event_service def client_cert_source_callback(): @@ -83,24 +87,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - EventServiceClient, - EventServiceAsyncClient, + (EventServiceClient, "grpc"), + (EventServiceAsyncClient, "grpc_asyncio"), ], ) -def test_event_service_client_from_service_account_info(client_class): +def test_event_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -129,27 +133,31 @@ def test_event_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - EventServiceClient, - EventServiceAsyncClient, + (EventServiceClient, "grpc"), + (EventServiceAsyncClient, "grpc_asyncio"), ], ) -def test_event_service_client_from_service_account_file(client_class): +def test_event_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_event_service_client_get_transport_class(): @@ -745,7 +753,7 @@ def test_create_client_event_field_headers(): # a field header. Set these to a non-empty value. request = event_service.CreateClientEventRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -763,7 +771,7 @@ def test_create_client_event_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -777,7 +785,7 @@ async def test_create_client_event_field_headers_async(): # a field header. Set these to a non-empty value. request = event_service.CreateClientEventRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -795,7 +803,7 @@ async def test_create_client_event_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -984,6 +992,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = EventServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = EventServiceClient( @@ -1024,6 +1045,14 @@ def test_event_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_event_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -1178,22 +1207,38 @@ def test_event_service_grpc_transport_client_cert_source_for_mtls(transport_clas ) -def test_event_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_event_service_host_no_port(transport_name): client = EventServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_event_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_event_service_host_with_port(transport_name): client = EventServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_event_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4/test_job_service.py b/tests/unit/gapic/talent_v4/test_job_service.py index 308f7df0..2d6f046f 100644 --- a/tests/unit/gapic/talent_v4/test_job_service.py +++ b/tests/unit/gapic/talent_v4/test_job_service.py @@ -14,37 +14,31 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4.services.job_service import JobServiceAsyncClient -from google.cloud.talent_v4.services.job_service import JobServiceClient -from google.cloud.talent_v4.services.job_service import pagers -from google.cloud.talent_v4.services.job_service import transports -from google.cloud.talent_v4.types import common -from google.cloud.talent_v4.types import filters -from google.cloud.talent_v4.types import histogram -from google.cloud.talent_v4.types import job -from google.cloud.talent_v4.types import job as gct_job -from google.cloud.talent_v4.types import job_service from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore @@ -55,7 +49,21 @@ from google.type import money_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore from google.type import timeofday_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4.services.job_service import ( + JobServiceAsyncClient, + JobServiceClient, + pagers, + transports, +) +from google.cloud.talent_v4.types import common, filters, histogram +from google.cloud.talent_v4.types import job +from google.cloud.talent_v4.types import job as gct_job +from google.cloud.talent_v4.types import job_service def client_cert_source_callback(): @@ -100,24 +108,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - JobServiceClient, - JobServiceAsyncClient, + (JobServiceClient, "grpc"), + (JobServiceAsyncClient, "grpc_asyncio"), ], ) -def test_job_service_client_from_service_account_info(client_class): +def test_job_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -146,27 +154,31 @@ def test_job_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - JobServiceClient, - JobServiceAsyncClient, + (JobServiceClient, "grpc"), + (JobServiceAsyncClient, "grpc_asyncio"), ], ) -def test_job_service_client_from_service_account_file(client_class): +def test_job_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_job_service_client_get_transport_class(): @@ -809,7 +821,7 @@ def test_create_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -825,7 +837,7 @@ def test_create_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -839,7 +851,7 @@ async def test_create_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -855,7 +867,7 @@ async def test_create_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1047,7 +1059,7 @@ def test_batch_create_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchCreateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1065,7 +1077,7 @@ def test_batch_create_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1079,7 +1091,7 @@ async def test_batch_create_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchCreateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1099,7 +1111,7 @@ async def test_batch_create_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1369,7 +1381,7 @@ def test_get_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1385,7 +1397,7 @@ def test_get_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1399,7 +1411,7 @@ async def test_get_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1415,7 +1427,7 @@ async def test_get_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1669,7 +1681,7 @@ def test_update_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.UpdateJobRequest() - request.job.name = "job.name/value" + request.job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1685,7 +1697,7 @@ def test_update_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "job.name=job.name/value", + "job.name=name_value", ) in kw["metadata"] @@ -1699,7 +1711,7 @@ async def test_update_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.UpdateJobRequest() - request.job.name = "job.name/value" + request.job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1715,7 +1727,7 @@ async def test_update_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "job.name=job.name/value", + "job.name=name_value", ) in kw["metadata"] @@ -1907,7 +1919,7 @@ def test_batch_update_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchUpdateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1925,7 +1937,7 @@ def test_batch_update_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1939,7 +1951,7 @@ async def test_batch_update_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchUpdateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1959,7 +1971,7 @@ async def test_batch_update_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2149,7 +2161,7 @@ def test_delete_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2165,7 +2177,7 @@ def test_delete_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2179,7 +2191,7 @@ async def test_delete_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2195,7 +2207,7 @@ async def test_delete_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2377,7 +2389,7 @@ def test_batch_delete_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchDeleteJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2395,7 +2407,7 @@ def test_batch_delete_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2409,7 +2421,7 @@ async def test_batch_delete_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchDeleteJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2429,7 +2441,7 @@ async def test_batch_delete_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2627,7 +2639,7 @@ def test_list_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2643,7 +2655,7 @@ def test_list_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2657,7 +2669,7 @@ async def test_list_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2675,7 +2687,7 @@ async def test_list_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2816,7 +2828,7 @@ def test_list_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, job.Job) for i in results) @@ -2905,7 +2917,7 @@ async def test_list_jobs_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2951,7 +2963,9 @@ async def test_list_jobs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_jobs(request={})).pages: + async for page_ in ( + await client.list_jobs(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3064,7 +3078,7 @@ def test_search_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_jobs), "__call__") as call: @@ -3080,7 +3094,7 @@ def test_search_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3094,7 +3108,7 @@ async def test_search_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_jobs), "__call__") as call: @@ -3112,7 +3126,7 @@ async def test_search_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3229,7 +3243,7 @@ def test_search_jobs_for_alert_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3247,7 +3261,7 @@ def test_search_jobs_for_alert_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3261,7 +3275,7 @@ async def test_search_jobs_for_alert_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3281,7 +3295,7 @@ async def test_search_jobs_for_alert_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3376,6 +3390,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = JobServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = JobServiceClient( @@ -3432,6 +3459,14 @@ def test_job_service_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_job_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -3586,22 +3621,38 @@ def test_job_service_grpc_transport_client_cert_source_for_mtls(transport_class) ) -def test_job_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_job_service_host_no_port(transport_name): client = JobServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_job_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_job_service_host_with_port(transport_name): client = JobServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_job_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4/test_tenant_service.py b/tests/unit/gapic/talent_v4/test_tenant_service.py index a35c64d3..83106f72 100644 --- a/tests/unit/gapic/talent_v4/test_tenant_service.py +++ b/tests/unit/gapic/talent_v4/test_tenant_service.py @@ -14,33 +14,38 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4.services.tenant_service import TenantServiceAsyncClient -from google.cloud.talent_v4.services.tenant_service import TenantServiceClient -from google.cloud.talent_v4.services.tenant_service import pagers -from google.cloud.talent_v4.services.tenant_service import transports +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4.services.tenant_service import ( + TenantServiceAsyncClient, + TenantServiceClient, + pagers, + transports, +) from google.cloud.talent_v4.types import tenant from google.cloud.talent_v4.types import tenant as gct_tenant from google.cloud.talent_v4.types import tenant_service -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -import google.auth def client_cert_source_callback(): @@ -88,24 +93,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - TenantServiceClient, - TenantServiceAsyncClient, + (TenantServiceClient, "grpc"), + (TenantServiceAsyncClient, "grpc_asyncio"), ], ) -def test_tenant_service_client_from_service_account_info(client_class): +def test_tenant_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -134,27 +139,31 @@ def test_tenant_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - TenantServiceClient, - TenantServiceAsyncClient, + (TenantServiceClient, "grpc"), + (TenantServiceAsyncClient, "grpc_asyncio"), ], ) -def test_tenant_service_client_from_service_account_file(client_class): +def test_tenant_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_tenant_service_client_get_transport_class(): @@ -749,7 +758,7 @@ def test_create_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.CreateTenantRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -765,7 +774,7 @@ def test_create_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -779,7 +788,7 @@ async def test_create_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.CreateTenantRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -795,7 +804,7 @@ async def test_create_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -991,7 +1000,7 @@ def test_get_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.GetTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -1007,7 +1016,7 @@ def test_get_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1021,7 +1030,7 @@ async def test_get_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.GetTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -1037,7 +1046,7 @@ async def test_get_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1223,7 +1232,7 @@ def test_update_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.UpdateTenantRequest() - request.tenant.name = "tenant.name/value" + request.tenant.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1239,7 +1248,7 @@ def test_update_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant.name=tenant.name/value", + "tenant.name=name_value", ) in kw["metadata"] @@ -1253,7 +1262,7 @@ async def test_update_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.UpdateTenantRequest() - request.tenant.name = "tenant.name/value" + request.tenant.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1269,7 +1278,7 @@ async def test_update_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant.name=tenant.name/value", + "tenant.name=name_value", ) in kw["metadata"] @@ -1453,7 +1462,7 @@ def test_delete_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.DeleteTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1469,7 +1478,7 @@ def test_delete_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1483,7 +1492,7 @@ async def test_delete_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.DeleteTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1499,7 +1508,7 @@ async def test_delete_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1681,7 +1690,7 @@ def test_list_tenants_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.ListTenantsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1697,7 +1706,7 @@ def test_list_tenants_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1711,7 +1720,7 @@ async def test_list_tenants_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.ListTenantsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1729,7 +1738,7 @@ async def test_list_tenants_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1860,7 +1869,7 @@ def test_list_tenants_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tenant.Tenant) for i in results) @@ -1949,7 +1958,7 @@ async def test_list_tenants_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1995,7 +2004,9 @@ async def test_list_tenants_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_tenants(request={})).pages: + async for page_ in ( + await client.list_tenants(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2092,6 +2103,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = TenantServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = TenantServiceClient( @@ -2138,6 +2162,14 @@ def test_tenant_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_tenant_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2295,22 +2327,38 @@ def test_tenant_service_grpc_transport_client_cert_source_for_mtls(transport_cla ) -def test_tenant_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_tenant_service_host_no_port(transport_name): client = TenantServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_tenant_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_tenant_service_host_with_port(transport_name): client = TenantServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_tenant_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_application_service.py b/tests/unit/gapic/talent_v4beta1/test_application_service.py index dd233ebc..c840e6af 100644 --- a/tests/unit/gapic/talent_v4beta1/test_application_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_application_service.py @@ -14,41 +14,41 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.protobuf import wrappers_pb2 # type: ignore +from google.type import date_pb2 # type: ignore +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + from google.cloud.talent_v4beta1.services.application_service import ( ApplicationServiceAsyncClient, -) -from google.cloud.talent_v4beta1.services.application_service import ( ApplicationServiceClient, + pagers, + transports, ) -from google.cloud.talent_v4beta1.services.application_service import pagers -from google.cloud.talent_v4beta1.services.application_service import transports from google.cloud.talent_v4beta1.types import application from google.cloud.talent_v4beta1.types import application as gct_application -from google.cloud.talent_v4beta1.types import application_service -from google.cloud.talent_v4beta1.types import common -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore -from google.type import date_pb2 # type: ignore -import google.auth +from google.cloud.talent_v4beta1.types import application_service, common def client_cert_source_callback(): @@ -97,24 +97,26 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ApplicationServiceClient, - ApplicationServiceAsyncClient, + (ApplicationServiceClient, "grpc"), + (ApplicationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_application_service_client_from_service_account_info(client_class): +def test_application_service_client_from_service_account_info( + client_class, transport_name +): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -143,27 +145,33 @@ def test_application_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ApplicationServiceClient, - ApplicationServiceAsyncClient, + (ApplicationServiceClient, "grpc"), + (ApplicationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_application_service_client_from_service_account_file(client_class): +def test_application_service_client_from_service_account_file( + client_class, transport_name +): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_application_service_client_get_transport_class(): @@ -807,7 +815,7 @@ def test_create_application_field_headers(): # a field header. Set these to a non-empty value. request = application_service.CreateApplicationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -825,7 +833,7 @@ def test_create_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -839,7 +847,7 @@ async def test_create_application_field_headers_async(): # a field header. Set these to a non-empty value. request = application_service.CreateApplicationRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -859,7 +867,7 @@ async def test_create_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1094,7 +1102,7 @@ def test_get_application_field_headers(): # a field header. Set these to a non-empty value. request = application_service.GetApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_application), "__call__") as call: @@ -1110,7 +1118,7 @@ def test_get_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1124,7 +1132,7 @@ async def test_get_application_field_headers_async(): # a field header. Set these to a non-empty value. request = application_service.GetApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_application), "__call__") as call: @@ -1142,7 +1150,7 @@ async def test_get_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1369,7 +1377,7 @@ def test_update_application_field_headers(): # a field header. Set these to a non-empty value. request = application_service.UpdateApplicationRequest() - request.application.name = "application.name/value" + request.application.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1387,7 +1395,7 @@ def test_update_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "application.name=application.name/value", + "application.name=name_value", ) in kw["metadata"] @@ -1401,7 +1409,7 @@ async def test_update_application_field_headers_async(): # a field header. Set these to a non-empty value. request = application_service.UpdateApplicationRequest() - request.application.name = "application.name/value" + request.application.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1421,7 +1429,7 @@ async def test_update_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "application.name=application.name/value", + "application.name=name_value", ) in kw["metadata"] @@ -1608,7 +1616,7 @@ def test_delete_application_field_headers(): # a field header. Set these to a non-empty value. request = application_service.DeleteApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1626,7 +1634,7 @@ def test_delete_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1640,7 +1648,7 @@ async def test_delete_application_field_headers_async(): # a field header. Set these to a non-empty value. request = application_service.DeleteApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1658,7 +1666,7 @@ async def test_delete_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1851,7 +1859,7 @@ def test_list_applications_field_headers(): # a field header. Set these to a non-empty value. request = application_service.ListApplicationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1869,7 +1877,7 @@ def test_list_applications_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1883,7 +1891,7 @@ async def test_list_applications_field_headers_async(): # a field header. Set these to a non-empty value. request = application_service.ListApplicationsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1903,7 +1911,7 @@ async def test_list_applications_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2040,7 +2048,7 @@ def test_list_applications_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, application.Application) for i in results) @@ -2133,7 +2141,7 @@ async def test_list_applications_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2181,7 +2189,9 @@ async def test_list_applications_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_applications(request={})).pages: + async for page_ in ( + await client.list_applications(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2278,6 +2288,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = ApplicationServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ApplicationServiceClient( @@ -2324,6 +2347,14 @@ def test_application_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_application_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2483,22 +2514,38 @@ def test_application_service_grpc_transport_client_cert_source_for_mtls( ) -def test_application_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_application_service_host_no_port(transport_name): client = ApplicationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_application_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_application_service_host_with_port(transport_name): client = ApplicationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_application_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_company_service.py b/tests/unit/gapic/talent_v4beta1/test_company_service.py index b723e65e..cdb5e3b0 100644 --- a/tests/unit/gapic/talent_v4beta1/test_company_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_company_service.py @@ -14,38 +14,41 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +from google.type import latlng_pb2 # type: ignore +from google.type import postal_address_pb2 # type: ignore +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + from google.cloud.talent_v4beta1.services.company_service import ( CompanyServiceAsyncClient, + CompanyServiceClient, + pagers, + transports, ) -from google.cloud.talent_v4beta1.services.company_service import CompanyServiceClient -from google.cloud.talent_v4beta1.services.company_service import pagers -from google.cloud.talent_v4beta1.services.company_service import transports from google.cloud.talent_v4beta1.types import common from google.cloud.talent_v4beta1.types import company from google.cloud.talent_v4beta1.types import company as gct_company from google.cloud.talent_v4beta1.types import company_service -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -from google.type import latlng_pb2 # type: ignore -from google.type import postal_address_pb2 # type: ignore -import google.auth def client_cert_source_callback(): @@ -93,24 +96,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompanyServiceClient, - CompanyServiceAsyncClient, + (CompanyServiceClient, "grpc"), + (CompanyServiceAsyncClient, "grpc_asyncio"), ], ) -def test_company_service_client_from_service_account_info(client_class): +def test_company_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -139,27 +142,31 @@ def test_company_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompanyServiceClient, - CompanyServiceAsyncClient, + (CompanyServiceClient, "grpc"), + (CompanyServiceAsyncClient, "grpc_asyncio"), ], ) -def test_company_service_client_from_service_account_file(client_class): +def test_company_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_company_service_client_get_transport_class(): @@ -802,7 +809,7 @@ def test_create_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.CreateCompanyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -818,7 +825,7 @@ def test_create_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -832,7 +839,7 @@ async def test_create_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.CreateCompanyRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -848,7 +855,7 @@ async def test_create_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1092,7 +1099,7 @@ def test_get_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.GetCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1108,7 +1115,7 @@ def test_get_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1122,7 +1129,7 @@ async def test_get_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.GetCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1138,7 +1145,7 @@ async def test_get_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1372,7 +1379,7 @@ def test_update_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.UpdateCompanyRequest() - request.company.name = "company.name/value" + request.company.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1388,7 +1395,7 @@ def test_update_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "company.name=company.name/value", + "company.name=name_value", ) in kw["metadata"] @@ -1402,7 +1409,7 @@ async def test_update_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.UpdateCompanyRequest() - request.company.name = "company.name/value" + request.company.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1418,7 +1425,7 @@ async def test_update_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "company.name=company.name/value", + "company.name=name_value", ) in kw["metadata"] @@ -1592,7 +1599,7 @@ def test_delete_company_field_headers(): # a field header. Set these to a non-empty value. request = company_service.DeleteCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1608,7 +1615,7 @@ def test_delete_company_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1622,7 +1629,7 @@ async def test_delete_company_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.DeleteCompanyRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1638,7 +1645,7 @@ async def test_delete_company_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1820,7 +1827,7 @@ def test_list_companies_field_headers(): # a field header. Set these to a non-empty value. request = company_service.ListCompaniesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1836,7 +1843,7 @@ def test_list_companies_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1850,7 +1857,7 @@ async def test_list_companies_field_headers_async(): # a field header. Set these to a non-empty value. request = company_service.ListCompaniesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1868,7 +1875,7 @@ async def test_list_companies_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1999,7 +2006,7 @@ def test_list_companies_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, company.Company) for i in results) @@ -2088,7 +2095,7 @@ async def test_list_companies_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2134,7 +2141,9 @@ async def test_list_companies_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_companies(request={})).pages: + async for page_ in ( + await client.list_companies(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2231,6 +2240,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CompanyServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CompanyServiceClient( @@ -2277,6 +2299,14 @@ def test_company_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_company_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2434,22 +2464,38 @@ def test_company_service_grpc_transport_client_cert_source_for_mtls(transport_cl ) -def test_company_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_company_service_host_no_port(transport_name): client = CompanyServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_company_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_company_service_host_with_port(transport_name): client = CompanyServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_company_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_completion.py b/tests/unit/gapic/talent_v4beta1/test_completion.py index 176b1e00..0f182181 100644 --- a/tests/unit/gapic/talent_v4beta1/test_completion.py +++ b/tests/unit/gapic/talent_v4beta1/test_completion.py @@ -14,30 +14,34 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4beta1.services.completion import CompletionAsyncClient -from google.cloud.talent_v4beta1.services.completion import CompletionClient -from google.cloud.talent_v4beta1.services.completion import transports -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import completion_service from google.oauth2 import service_account -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4beta1.services.completion import ( + CompletionAsyncClient, + CompletionClient, + transports, +) +from google.cloud.talent_v4beta1.types import common, completion_service def client_cert_source_callback(): @@ -82,24 +86,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompletionClient, - CompletionAsyncClient, + (CompletionClient, "grpc"), + (CompletionAsyncClient, "grpc_asyncio"), ], ) -def test_completion_client_from_service_account_info(client_class): +def test_completion_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -128,27 +132,31 @@ def test_completion_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CompletionClient, - CompletionAsyncClient, + (CompletionClient, "grpc"), + (CompletionAsyncClient, "grpc_asyncio"), ], ) -def test_completion_client_from_service_account_file(client_class): +def test_completion_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_completion_client_get_transport_class(): @@ -714,7 +722,7 @@ def test_complete_query_field_headers(): # a field header. Set these to a non-empty value. request = completion_service.CompleteQueryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_query), "__call__") as call: @@ -730,7 +738,7 @@ def test_complete_query_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -744,7 +752,7 @@ async def test_complete_query_field_headers_async(): # a field header. Set these to a non-empty value. request = completion_service.CompleteQueryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.complete_query), "__call__") as call: @@ -762,7 +770,7 @@ async def test_complete_query_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -857,6 +865,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CompletionClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CompletionClient( @@ -897,6 +918,14 @@ def test_completion_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_completion_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -1051,22 +1080,38 @@ def test_completion_grpc_transport_client_cert_source_for_mtls(transport_class): ) -def test_completion_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_completion_host_no_port(transport_name): client = CompletionClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_completion_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_completion_host_with_port(transport_name): client = CompletionClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_completion_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_event_service.py b/tests/unit/gapic/talent_v4beta1/test_event_service.py index 205d97fb..e00cd53f 100644 --- a/tests/unit/gapic/talent_v4beta1/test_event_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_event_service.py @@ -14,31 +14,35 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4beta1.services.event_service import EventServiceAsyncClient -from google.cloud.talent_v4beta1.services.event_service import EventServiceClient -from google.cloud.talent_v4beta1.services.event_service import transports -from google.cloud.talent_v4beta1.types import event -from google.cloud.talent_v4beta1.types import event_service from google.oauth2 import service_account from google.protobuf import timestamp_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4beta1.services.event_service import ( + EventServiceAsyncClient, + EventServiceClient, + transports, +) +from google.cloud.talent_v4beta1.types import event, event_service def client_cert_source_callback(): @@ -83,24 +87,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - EventServiceClient, - EventServiceAsyncClient, + (EventServiceClient, "grpc"), + (EventServiceAsyncClient, "grpc_asyncio"), ], ) -def test_event_service_client_from_service_account_info(client_class): +def test_event_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -129,27 +133,31 @@ def test_event_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - EventServiceClient, - EventServiceAsyncClient, + (EventServiceClient, "grpc"), + (EventServiceAsyncClient, "grpc_asyncio"), ], ) -def test_event_service_client_from_service_account_file(client_class): +def test_event_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_event_service_client_get_transport_class(): @@ -745,7 +753,7 @@ def test_create_client_event_field_headers(): # a field header. Set these to a non-empty value. request = event_service.CreateClientEventRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -763,7 +771,7 @@ def test_create_client_event_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -777,7 +785,7 @@ async def test_create_client_event_field_headers_async(): # a field header. Set these to a non-empty value. request = event_service.CreateClientEventRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -795,7 +803,7 @@ async def test_create_client_event_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -984,6 +992,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = EventServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = EventServiceClient( @@ -1024,6 +1045,14 @@ def test_event_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_event_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -1178,22 +1207,38 @@ def test_event_service_grpc_transport_client_cert_source_for_mtls(transport_clas ) -def test_event_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_event_service_host_no_port(transport_name): client = EventServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_event_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_event_service_host_with_port(transport_name): client = EventServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_event_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_job_service.py b/tests/unit/gapic/talent_v4beta1/test_job_service.py index 7fb524b3..c150387e 100644 --- a/tests/unit/gapic/talent_v4beta1/test_job_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_job_service.py @@ -14,37 +14,31 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4beta1.services.job_service import JobServiceAsyncClient -from google.cloud.talent_v4beta1.services.job_service import JobServiceClient -from google.cloud.talent_v4beta1.services.job_service import pagers -from google.cloud.talent_v4beta1.services.job_service import transports -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import filters -from google.cloud.talent_v4beta1.types import histogram -from google.cloud.talent_v4beta1.types import job -from google.cloud.talent_v4beta1.types import job as gct_job -from google.cloud.talent_v4beta1.types import job_service from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore @@ -55,7 +49,21 @@ from google.type import money_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore from google.type import timeofday_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4beta1.services.job_service import ( + JobServiceAsyncClient, + JobServiceClient, + pagers, + transports, +) +from google.cloud.talent_v4beta1.types import common, filters, histogram +from google.cloud.talent_v4beta1.types import job +from google.cloud.talent_v4beta1.types import job as gct_job +from google.cloud.talent_v4beta1.types import job_service def client_cert_source_callback(): @@ -100,24 +108,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - JobServiceClient, - JobServiceAsyncClient, + (JobServiceClient, "grpc"), + (JobServiceAsyncClient, "grpc_asyncio"), ], ) -def test_job_service_client_from_service_account_info(client_class): +def test_job_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -146,27 +154,31 @@ def test_job_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - JobServiceClient, - JobServiceAsyncClient, + (JobServiceClient, "grpc"), + (JobServiceAsyncClient, "grpc_asyncio"), ], ) -def test_job_service_client_from_service_account_file(client_class): +def test_job_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_job_service_client_get_transport_class(): @@ -809,7 +821,7 @@ def test_create_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.CreateJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -825,7 +837,7 @@ def test_create_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -839,7 +851,7 @@ async def test_create_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.CreateJobRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -855,7 +867,7 @@ async def test_create_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1047,7 +1059,7 @@ def test_batch_create_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchCreateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1065,7 +1077,7 @@ def test_batch_create_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1079,7 +1091,7 @@ async def test_batch_create_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchCreateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1099,7 +1111,7 @@ async def test_batch_create_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1369,7 +1381,7 @@ def test_get_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1385,7 +1397,7 @@ def test_get_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1399,7 +1411,7 @@ async def test_get_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.GetJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1415,7 +1427,7 @@ async def test_get_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1669,7 +1681,7 @@ def test_update_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.UpdateJobRequest() - request.job.name = "job.name/value" + request.job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1685,7 +1697,7 @@ def test_update_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "job.name=job.name/value", + "job.name=name_value", ) in kw["metadata"] @@ -1699,7 +1711,7 @@ async def test_update_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.UpdateJobRequest() - request.job.name = "job.name/value" + request.job.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1715,7 +1727,7 @@ async def test_update_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "job.name=job.name/value", + "job.name=name_value", ) in kw["metadata"] @@ -1897,7 +1909,7 @@ def test_batch_update_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchUpdateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1915,7 +1927,7 @@ def test_batch_update_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1929,7 +1941,7 @@ async def test_batch_update_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchUpdateJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1949,7 +1961,7 @@ async def test_batch_update_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2139,7 +2151,7 @@ def test_delete_job_field_headers(): # a field header. Set these to a non-empty value. request = job_service.DeleteJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2155,7 +2167,7 @@ def test_delete_job_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2169,7 +2181,7 @@ async def test_delete_job_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.DeleteJobRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2185,7 +2197,7 @@ async def test_delete_job_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2365,7 +2377,7 @@ def test_batch_delete_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.BatchDeleteJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2383,7 +2395,7 @@ def test_batch_delete_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2397,7 +2409,7 @@ async def test_batch_delete_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.BatchDeleteJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2415,7 +2427,7 @@ async def test_batch_delete_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2611,7 +2623,7 @@ def test_list_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2627,7 +2639,7 @@ def test_list_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2641,7 +2653,7 @@ async def test_list_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.ListJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2659,7 +2671,7 @@ async def test_list_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2800,7 +2812,7 @@ def test_list_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, job.Job) for i in results) @@ -2889,7 +2901,7 @@ async def test_list_jobs_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2935,7 +2947,9 @@ async def test_list_jobs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_jobs(request={})).pages: + async for page_ in ( + await client.list_jobs(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3051,7 +3065,7 @@ def test_search_jobs_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_jobs), "__call__") as call: @@ -3067,7 +3081,7 @@ def test_search_jobs_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3081,7 +3095,7 @@ async def test_search_jobs_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_jobs), "__call__") as call: @@ -3099,7 +3113,7 @@ async def test_search_jobs_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3148,7 +3162,7 @@ def test_search_jobs_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, job_service.SearchJobsResponse.MatchingJob) for i in results @@ -3239,7 +3253,7 @@ async def test_search_jobs_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3287,7 +3301,9 @@ async def test_search_jobs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_jobs(request={})).pages: + async for page_ in ( + await client.search_jobs(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3409,7 +3425,7 @@ def test_search_jobs_for_alert_field_headers(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3427,7 +3443,7 @@ def test_search_jobs_for_alert_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3441,7 +3457,7 @@ async def test_search_jobs_for_alert_field_headers_async(): # a field header. Set these to a non-empty value. request = job_service.SearchJobsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3461,7 +3477,7 @@ async def test_search_jobs_for_alert_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3512,7 +3528,7 @@ def test_search_jobs_for_alert_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, job_service.SearchJobsResponse.MatchingJob) for i in results @@ -3607,7 +3623,7 @@ async def test_search_jobs_for_alert_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3657,7 +3673,9 @@ async def test_search_jobs_for_alert_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_jobs_for_alert(request={})).pages: + async for page_ in ( + await client.search_jobs_for_alert(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3754,6 +3772,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = JobServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = JobServiceClient( @@ -3810,6 +3841,14 @@ def test_job_service_base_transport(): with pytest.raises(NotImplementedError): transport.operations_client + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_job_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -3964,22 +4003,38 @@ def test_job_service_grpc_transport_client_cert_source_for_mtls(transport_class) ) -def test_job_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_job_service_host_no_port(transport_name): client = JobServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_job_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_job_service_host_with_port(transport_name): client = JobServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_job_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_profile_service.py b/tests/unit/gapic/talent_v4beta1/test_profile_service.py index 44b394b0..53df5a3e 100644 --- a/tests/unit/gapic/talent_v4beta1/test_profile_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_profile_service.py @@ -14,35 +14,22 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4beta1.services.profile_service import ( - ProfileServiceAsyncClient, -) -from google.cloud.talent_v4beta1.services.profile_service import ProfileServiceClient -from google.cloud.talent_v4beta1.services.profile_service import pagers -from google.cloud.talent_v4beta1.services.profile_service import transports -from google.cloud.talent_v4beta1.types import common -from google.cloud.talent_v4beta1.types import filters -from google.cloud.talent_v4beta1.types import histogram -from google.cloud.talent_v4beta1.types import profile -from google.cloud.talent_v4beta1.types import profile as gct_profile -from google.cloud.talent_v4beta1.types import profile_service from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -51,7 +38,21 @@ from google.type import date_pb2 # type: ignore from google.type import latlng_pb2 # type: ignore from google.type import postal_address_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4beta1.services.profile_service import ( + ProfileServiceAsyncClient, + ProfileServiceClient, + pagers, + transports, +) +from google.cloud.talent_v4beta1.types import common, filters, histogram +from google.cloud.talent_v4beta1.types import profile +from google.cloud.talent_v4beta1.types import profile as gct_profile +from google.cloud.talent_v4beta1.types import profile_service def client_cert_source_callback(): @@ -99,24 +100,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ProfileServiceClient, - ProfileServiceAsyncClient, + (ProfileServiceClient, "grpc"), + (ProfileServiceAsyncClient, "grpc_asyncio"), ], ) -def test_profile_service_client_from_service_account_info(client_class): +def test_profile_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -145,27 +146,31 @@ def test_profile_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - ProfileServiceClient, - ProfileServiceAsyncClient, + (ProfileServiceClient, "grpc"), + (ProfileServiceAsyncClient, "grpc_asyncio"), ], ) -def test_profile_service_client_from_service_account_file(client_class): +def test_profile_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_profile_service_client_get_transport_class(): @@ -756,7 +761,7 @@ def test_list_profiles_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.ListProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_profiles), "__call__") as call: @@ -772,7 +777,7 @@ def test_list_profiles_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -786,7 +791,7 @@ async def test_list_profiles_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.ListProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_profiles), "__call__") as call: @@ -804,7 +809,7 @@ async def test_list_profiles_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -935,7 +940,7 @@ def test_list_profiles_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, profile.Profile) for i in results) @@ -1024,7 +1029,7 @@ async def test_list_profiles_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1070,7 +1075,9 @@ async def test_list_profiles_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_profiles(request={})).pages: + async for page_ in ( + await client.list_profiles(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1206,7 +1213,7 @@ def test_create_profile_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.CreateProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_profile), "__call__") as call: @@ -1222,7 +1229,7 @@ def test_create_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1236,7 +1243,7 @@ async def test_create_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.CreateProfileRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_profile), "__call__") as call: @@ -1252,7 +1259,7 @@ async def test_create_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1476,7 +1483,7 @@ def test_get_profile_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.GetProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_profile), "__call__") as call: @@ -1492,7 +1499,7 @@ def test_get_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1506,7 +1513,7 @@ async def test_get_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.GetProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_profile), "__call__") as call: @@ -1522,7 +1529,7 @@ async def test_get_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1736,7 +1743,7 @@ def test_update_profile_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.UpdateProfileRequest() - request.profile.name = "profile.name/value" + request.profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_profile), "__call__") as call: @@ -1752,7 +1759,7 @@ def test_update_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "profile.name=profile.name/value", + "profile.name=name_value", ) in kw["metadata"] @@ -1766,7 +1773,7 @@ async def test_update_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.UpdateProfileRequest() - request.profile.name = "profile.name/value" + request.profile.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_profile), "__call__") as call: @@ -1782,7 +1789,7 @@ async def test_update_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "profile.name=profile.name/value", + "profile.name=name_value", ) in kw["metadata"] @@ -1956,7 +1963,7 @@ def test_delete_profile_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.DeleteProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_profile), "__call__") as call: @@ -1972,7 +1979,7 @@ def test_delete_profile_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1986,7 +1993,7 @@ async def test_delete_profile_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.DeleteProfileRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_profile), "__call__") as call: @@ -2002,7 +2009,7 @@ async def test_delete_profile_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2192,7 +2199,7 @@ def test_search_profiles_field_headers(): # a field header. Set these to a non-empty value. request = profile_service.SearchProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_profiles), "__call__") as call: @@ -2208,7 +2215,7 @@ def test_search_profiles_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2222,7 +2229,7 @@ async def test_search_profiles_field_headers_async(): # a field header. Set these to a non-empty value. request = profile_service.SearchProfilesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.search_profiles), "__call__") as call: @@ -2240,7 +2247,7 @@ async def test_search_profiles_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2289,7 +2296,7 @@ def test_search_profiles_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, histogram.HistogramQueryResult) for i in results) @@ -2378,7 +2385,7 @@ async def test_search_profiles_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2424,7 +2431,9 @@ async def test_search_profiles_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_profiles(request={})).pages: + async for page_ in ( + await client.search_profiles(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2521,6 +2530,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = ProfileServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ProfileServiceClient( @@ -2568,6 +2590,14 @@ def test_profile_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_profile_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2725,22 +2755,38 @@ def test_profile_service_grpc_transport_client_cert_source_for_mtls(transport_cl ) -def test_profile_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_profile_service_host_no_port(transport_name): client = ProfileServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_profile_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_profile_service_host_with_port(transport_name): client = ProfileServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_profile_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/talent_v4beta1/test_tenant_service.py b/tests/unit/gapic/talent_v4beta1/test_tenant_service.py index 10445522..5fc4db14 100644 --- a/tests/unit/gapic/talent_v4beta1/test_tenant_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_tenant_service.py @@ -14,33 +14,38 @@ # limitations under the License. # import os -import mock -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock +import math +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.talent_v4beta1.services.tenant_service import TenantServiceAsyncClient -from google.cloud.talent_v4beta1.services.tenant_service import TenantServiceClient -from google.cloud.talent_v4beta1.services.tenant_service import pagers -from google.cloud.talent_v4beta1.services.tenant_service import transports +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +import grpc +from grpc.experimental import aio +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.talent_v4beta1.services.tenant_service import ( + TenantServiceAsyncClient, + TenantServiceClient, + pagers, + transports, +) from google.cloud.talent_v4beta1.types import tenant from google.cloud.talent_v4beta1.types import tenant as gct_tenant from google.cloud.talent_v4beta1.types import tenant_service -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -import google.auth def client_cert_source_callback(): @@ -88,24 +93,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - TenantServiceClient, - TenantServiceAsyncClient, + (TenantServiceClient, "grpc"), + (TenantServiceAsyncClient, "grpc_asyncio"), ], ) -def test_tenant_service_client_from_service_account_info(client_class): +def test_tenant_service_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") @pytest.mark.parametrize( @@ -134,27 +139,31 @@ def test_tenant_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - TenantServiceClient, - TenantServiceAsyncClient, + (TenantServiceClient, "grpc"), + (TenantServiceAsyncClient, "grpc_asyncio"), ], ) -def test_tenant_service_client_from_service_account_file(client_class): +def test_tenant_service_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") def test_tenant_service_client_get_transport_class(): @@ -765,7 +774,7 @@ def test_create_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.CreateTenantRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -781,7 +790,7 @@ def test_create_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -795,7 +804,7 @@ async def test_create_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.CreateTenantRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -811,7 +820,7 @@ async def test_create_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1023,7 +1032,7 @@ def test_get_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.GetTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -1039,7 +1048,7 @@ def test_get_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1053,7 +1062,7 @@ async def test_get_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.GetTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -1069,7 +1078,7 @@ async def test_get_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1271,7 +1280,7 @@ def test_update_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.UpdateTenantRequest() - request.tenant.name = "tenant.name/value" + request.tenant.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1287,7 +1296,7 @@ def test_update_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant.name=tenant.name/value", + "tenant.name=name_value", ) in kw["metadata"] @@ -1301,7 +1310,7 @@ async def test_update_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.UpdateTenantRequest() - request.tenant.name = "tenant.name/value" + request.tenant.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1317,7 +1326,7 @@ async def test_update_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "tenant.name=tenant.name/value", + "tenant.name=name_value", ) in kw["metadata"] @@ -1491,7 +1500,7 @@ def test_delete_tenant_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.DeleteTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1507,7 +1516,7 @@ def test_delete_tenant_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1521,7 +1530,7 @@ async def test_delete_tenant_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.DeleteTenantRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1537,7 +1546,7 @@ async def test_delete_tenant_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1719,7 +1728,7 @@ def test_list_tenants_field_headers(): # a field header. Set these to a non-empty value. request = tenant_service.ListTenantsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1735,7 +1744,7 @@ def test_list_tenants_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1749,7 +1758,7 @@ async def test_list_tenants_field_headers_async(): # a field header. Set these to a non-empty value. request = tenant_service.ListTenantsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1767,7 +1776,7 @@ async def test_list_tenants_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1898,7 +1907,7 @@ def test_list_tenants_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tenant.Tenant) for i in results) @@ -1987,7 +1996,7 @@ async def test_list_tenants_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2033,7 +2042,9 @@ async def test_list_tenants_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_tenants(request={})).pages: + async for page_ in ( + await client.list_tenants(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2130,6 +2141,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = TenantServiceClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = TenantServiceClient( @@ -2176,6 +2200,14 @@ def test_tenant_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_tenant_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2333,22 +2365,38 @@ def test_tenant_service_grpc_transport_client_cert_source_for_mtls(transport_cla ) -def test_tenant_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_tenant_service_host_no_port(transport_name): client = TenantServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="jobs.googleapis.com"), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:443" + assert client.transport._host == ("jobs.googleapis.com:443") -def test_tenant_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_tenant_service_host_with_port(transport_name): client = TenantServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="jobs.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "jobs.googleapis.com:8000" + assert client.transport._host == ("jobs.googleapis.com:8000") def test_tenant_service_grpc_transport_channel():