From 70c3196c2f3ab79e1bbdaebae0c1abce16a8b922 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 02:43:17 +0100 Subject: [PATCH 1/7] chore(deps): update dependency google.cloud.talent to v2.5.1 (#217) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 053efd01..8504b256 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google.cloud.talent==2.5.0 \ No newline at end of file +google.cloud.talent==2.5.1 \ No newline at end of file From 00ba59f93704dc480cbd578668a7053a469c4d1e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 13 Mar 2022 21:03:00 +0100 Subject: [PATCH 2/7] chore(deps): update dependency pytest to v7.1.0 (#220) --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index c2845bff..824a8a7a 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 +pytest==7.1.0 From 985508ce1cdd1050f5d6a7c7b6919408946e4c1d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Mar 2022 09:19:15 -0600 Subject: [PATCH 3/7] docs: Added functionality in the companyDisplayNames filter to support fuzzy matching (#221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Added functionality in the companyDisplayNames filter to support fuzzy matching PiperOrigin-RevId: 435467010 Source-Link: https://github.com/googleapis/googleapis/commit/cb382857a71e5fbfbddd2f276fd4395754318a40 Source-Link: https://github.com/googleapis/googleapis-gen/commit/799e10e82d04aa27aafbc6c537f5be1eaf891cad Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzk5ZTEwZTgyZDA0YWEyN2FhZmJjNmM1MzdmNWJlMWVhZjg5MWNhZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- google/cloud/talent_v4/types/filters.py | 21 ++++++++++++++++++--- google/cloud/talent_v4/types/job_service.py | 2 ++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/google/cloud/talent_v4/types/filters.py b/google/cloud/talent_v4/types/filters.py index 734d549e..74752a16 100644 --- a/google/cloud/talent_v4/types/filters.py +++ b/google/cloud/talent_v4/types/filters.py @@ -103,9 +103,17 @@ class JobQuery(proto.Message): Currently we don't support sorting by commute time. company_display_names (Sequence[str]): - This filter specifies the exact company + This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] - of the jobs to search against. + of the jobs to search against. The company name must match + the value exactly (case sensitive). + + 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 + function may increase latency. + + Sample Values: ``["Google LLC", "SUBSTRING_MATCH(google)"]`` If a value isn't specified, jobs within the search results are associated with any company. @@ -259,7 +267,14 @@ class LocationFilter(proto.Message): [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are ignored. If not set or set to [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], - telecommute job are not searched. + the telecommute status of the jobs is ignored. Jobs that + have + [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] + and have additional + [Job.addresses][google.cloud.talent.v4.Job.addresses] may + still be matched based on other location filters using + [address][google.cloud.talent.v4.LocationFilter.address] or + [latlng][]. This filter can be used by itself to search exclusively for telecommuting jobs, or it can be combined with another diff --git a/google/cloud/talent_v4/types/job_service.py b/google/cloud/talent_v4/types/job_service.py index 2ff26422..8e16e4c8 100644 --- a/google/cloud/talent_v4/types/job_service.py +++ b/google/cloud/talent_v4/types/job_service.py @@ -265,6 +265,8 @@ class SearchJobsRequest(proto.Message): - ``count(numeric_histogram_facet, list of buckets)``: Count the number of matching entities within each bucket. + A maximum of 200 histogram buckets are supported. + Data types: - Histogram facet: facet names with format From 758f8bbbfdf84d228e35536c7025bd50548e8421 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 23 Mar 2022 09:57:50 +0100 Subject: [PATCH 4/7] chore(deps): update dependency pytest to v7.1.1 (#222) Co-authored-by: Anthonios Partheniou --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 824a8a7a..4f6bf643 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 +pytest==7.1.1 From bef1285b25e5dca7b47e0050e4d44121098d036e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:34:58 -0600 Subject: [PATCH 5/7] chore(python): configure release-please on previous major versions (#226) Source-Link: https://github.com/googleapis/synthtool/commit/c1dd87e9287f8de99930d3046dd555c4d03384c6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7c..88076277 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e5..29601ad4 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,11 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v1 + handleGHRelease: true + releaseType: python +- branch: v0 + handleGHRelease: true + releaseType: python From 9cedf70fd1c97fe4bc79d5dcdd504b9f487eabd7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:04:26 +0000 Subject: [PATCH 6/7] chore(python): use black==22.3.0 (#229) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 13 +- .../services/company_service/async_client.py | 42 +- .../services/company_service/client.py | 101 +- .../company_service/transports/base.py | 18 +- .../company_service/transports/grpc.py | 3 +- .../services/completion/async_client.py | 11 +- .../talent_v4/services/completion/client.py | 70 +- .../services/completion/transports/base.py | 10 +- .../services/completion/transports/grpc.py | 3 +- .../services/event_service/async_client.py | 11 +- .../services/event_service/client.py | 60 +- .../services/event_service/transports/base.py | 14 +- .../services/event_service/transports/grpc.py | 3 +- .../services/job_service/async_client.py | 77 +- .../talent_v4/services/job_service/client.py | 146 ++- .../services/job_service/transports/base.py | 34 +- .../services/job_service/transports/grpc.py | 3 +- .../services/tenant_service/async_client.py | 42 +- .../services/tenant_service/client.py | 91 +- .../tenant_service/transports/base.py | 18 +- .../tenant_service/transports/grpc.py | 3 +- google/cloud/talent_v4/types/common.py | 193 +++- google/cloud/talent_v4/types/company.py | 76 +- .../cloud/talent_v4/types/company_service.py | 66 +- .../talent_v4/types/completion_service.py | 66 +- google/cloud/talent_v4/types/event.py | 45 +- google/cloud/talent_v4/types/event_service.py | 16 +- google/cloud/talent_v4/types/filters.py | 143 ++- google/cloud/talent_v4/types/histogram.py | 21 +- google/cloud/talent_v4/types/job.py | 187 +++- google/cloud/talent_v4/types/job_service.py | 294 ++++-- google/cloud/talent_v4/types/tenant.py | 17 +- .../cloud/talent_v4/types/tenant_service.py | 63 +- .../application_service/async_client.py | 42 +- .../services/application_service/client.py | 121 ++- .../application_service/transports/base.py | 18 +- .../application_service/transports/grpc.py | 3 +- .../services/company_service/async_client.py | 42 +- .../services/company_service/client.py | 93 +- .../company_service/transports/base.py | 18 +- .../company_service/transports/grpc.py | 3 +- .../services/completion/async_client.py | 11 +- .../services/completion/client.py | 62 +- .../services/completion/transports/base.py | 10 +- .../services/completion/transports/grpc.py | 3 +- .../services/event_service/async_client.py | 11 +- .../services/event_service/client.py | 62 +- .../services/event_service/transports/base.py | 14 +- .../services/event_service/transports/grpc.py | 3 +- .../services/job_service/async_client.py | 85 +- .../services/job_service/client.py | 146 ++- .../services/job_service/transports/base.py | 34 +- .../services/job_service/transports/grpc.py | 3 +- .../services/profile_service/async_client.py | 54 +- .../services/profile_service/client.py | 113 ++- .../profile_service/transports/base.py | 22 +- .../profile_service/transports/grpc.py | 3 +- .../services/tenant_service/async_client.py | 42 +- .../services/tenant_service/client.py | 91 +- .../tenant_service/transports/base.py | 18 +- .../tenant_service/transports/grpc.py | 3 +- .../cloud/talent_v4beta1/types/application.py | 88 +- .../types/application_service.py | 57 +- google/cloud/talent_v4beta1/types/batch.py | 5 +- google/cloud/talent_v4beta1/types/common.py | 274 ++++-- google/cloud/talent_v4beta1/types/company.py | 74 +- .../talent_v4beta1/types/company_service.py | 66 +- .../types/completion_service.py | 66 +- google/cloud/talent_v4beta1/types/event.py | 71 +- .../talent_v4beta1/types/event_service.py | 16 +- google/cloud/talent_v4beta1/types/filters.py | 358 +++++-- .../cloud/talent_v4beta1/types/histogram.py | 21 +- google/cloud/talent_v4beta1/types/job.py | 187 +++- .../cloud/talent_v4beta1/types/job_service.py | 286 ++++-- google/cloud/talent_v4beta1/types/profile.py | 592 +++++++++--- .../talent_v4beta1/types/profile_service.py | 170 +++- google/cloud/talent_v4beta1/types/tenant.py | 24 +- .../talent_v4beta1/types/tenant_service.py | 63 +- noxfile.py | 9 +- samples/snippets/job_search_commute_search.py | 4 +- samples/snippets/job_search_create_job.py | 6 +- samples/snippets/noxfile.py | 4 +- .../gapic/talent_v4/test_company_service.py | 425 +++++++-- tests/unit/gapic/talent_v4/test_completion.py | 123 ++- .../gapic/talent_v4/test_event_service.py | 125 ++- .../unit/gapic/talent_v4/test_job_service.py | 782 +++++++++++---- .../gapic/talent_v4/test_tenant_service.py | 445 ++++++--- .../test_application_service.py | 315 ++++-- .../talent_v4beta1/test_company_service.py | 426 +++++++-- .../gapic/talent_v4beta1/test_completion.py | 120 ++- .../talent_v4beta1/test_event_service.py | 126 ++- .../gapic/talent_v4beta1/test_job_service.py | 901 ++++++++++++++---- .../talent_v4beta1/test_profile_service.py | 506 +++++++--- .../talent_v4beta1/test_tenant_service.py | 425 +++++++-- 95 files changed, 7981 insertions(+), 2271 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 88076277..87dd0061 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index daebbb43..7d020712 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -314,7 +314,13 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (root_doc, "google-cloud-talent", "google-cloud-talent Documentation", [author], 1,) + ( + root_doc, + "google-cloud-talent", + "google-cloud-talent Documentation", + [author], + 1, + ) ] # If true, show URL addresses after external links. @@ -355,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), 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 65beef2c..8c150161 100644 --- a/google/cloud/talent_v4/services/company_service/async_client.py +++ b/google/cloud/talent_v4/services/company_service/async_client.py @@ -316,7 +316,12 @@ def sample_create_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -425,7 +430,12 @@ def sample_get_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -545,7 +555,12 @@ def sample_update_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -643,7 +658,10 @@ def sample_delete_company(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_companies( @@ -748,12 +766,20 @@ def sample_list_companies(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListCompaniesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -768,7 +794,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/company_service/client.py b/google/cloud/talent_v4/services/company_service/client.py index 29e8298c..b253b267 100644 --- a/google/cloud/talent_v4/services/company_service/client.py +++ b/google/cloud/talent_v4/services/company_service/client.py @@ -59,7 +59,10 @@ class CompanyServiceClientMeta(type): _transport_registry["grpc"] = CompanyServiceGrpcTransport _transport_registry["grpc_asyncio"] = CompanyServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CompanyServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CompanyServiceTransport]: """Returns an appropriate transport class. Args: @@ -166,10 +169,16 @@ def transport(self) -> CompanyServiceTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -182,10 +191,14 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -195,7 +208,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -208,9 +223,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -219,9 +238,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -230,9 +253,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -241,10 +268,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -524,7 +555,12 @@ def sample_create_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -623,7 +659,12 @@ def sample_get_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -743,7 +784,12 @@ def sample_update_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -831,7 +877,10 @@ def sample_delete_company(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_companies( @@ -926,12 +975,20 @@ def sample_list_companies(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListCompaniesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -953,7 +1010,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 8bede0a1..73f6828b 100644 --- a/google/cloud/talent_v4/services/company_service/transports/base.py +++ b/google/cloud/talent_v4/services/company_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -125,7 +127,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_company: gapic_v1.method.wrap_method( - self.create_company, default_timeout=30.0, client_info=client_info, + self.create_company, + default_timeout=30.0, + client_info=client_info, ), self.get_company: gapic_v1.method.wrap_method( self.get_company, @@ -143,7 +147,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_company: gapic_v1.method.wrap_method( - self.update_company, default_timeout=30.0, client_info=client_info, + self.update_company, + default_timeout=30.0, + client_info=client_info, ), self.delete_company: gapic_v1.method.wrap_method( self.delete_company, @@ -180,9 +186,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 bc3722d3..b54271f1 100644 --- a/google/cloud/talent_v4/services/company_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/company_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/talent_v4/services/completion/async_client.py b/google/cloud/talent_v4/services/completion/async_client.py index 271a7ddc..43358219 100644 --- a/google/cloud/talent_v4/services/completion/async_client.py +++ b/google/cloud/talent_v4/services/completion/async_client.py @@ -273,7 +273,12 @@ def sample_complete_query(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -287,7 +292,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/completion/client.py b/google/cloud/talent_v4/services/completion/client.py index 03faca6c..44c94dd7 100644 --- a/google/cloud/talent_v4/services/completion/client.py +++ b/google/cloud/talent_v4/services/completion/client.py @@ -53,7 +53,10 @@ class CompletionClientMeta(type): _transport_registry["grpc"] = CompletionGrpcTransport _transport_registry["grpc_asyncio"] = CompletionGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CompletionTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CompletionTransport]: """Returns an appropriate transport class. Args: @@ -158,10 +161,16 @@ def transport(self) -> CompletionTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -174,10 +183,14 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -187,7 +200,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -200,9 +215,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -211,9 +230,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -222,9 +245,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -233,10 +260,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -476,7 +507,12 @@ def sample_complete_query(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -497,7 +533,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/completion/transports/base.py b/google/cloud/talent_v4/services/completion/transports/base.py index 995bfa05..aefdac63 100644 --- a/google/cloud/talent_v4/services/completion/transports/base.py +++ b/google/cloud/talent_v4/services/completion/transports/base.py @@ -29,7 +29,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -141,9 +143,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/cloud/talent_v4/services/completion/transports/grpc.py b/google/cloud/talent_v4/services/completion/transports/grpc.py index 4d73d7b3..804bc357 100644 --- a/google/cloud/talent_v4/services/completion/transports/grpc.py +++ b/google/cloud/talent_v4/services/completion/transports/grpc.py @@ -224,8 +224,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 5817bfdb..55d111c0 100644 --- a/google/cloud/talent_v4/services/event_service/async_client.py +++ b/google/cloud/talent_v4/services/event_service/async_client.py @@ -319,7 +319,12 @@ def sample_create_client_event(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -333,7 +338,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/event_service/client.py b/google/cloud/talent_v4/services/event_service/client.py index ec84bca0..2aa3962f 100644 --- a/google/cloud/talent_v4/services/event_service/client.py +++ b/google/cloud/talent_v4/services/event_service/client.py @@ -54,7 +54,10 @@ class EventServiceClientMeta(type): _transport_registry["grpc"] = EventServiceGrpcTransport _transport_registry["grpc_asyncio"] = EventServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[EventServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[EventServiceTransport]: """Returns an appropriate transport class. Args: @@ -159,10 +162,14 @@ def transport(self) -> EventServiceTransport: return self._transport @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -172,7 +179,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -185,9 +194,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -196,9 +209,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -207,9 +224,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -218,10 +239,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -515,7 +540,12 @@ def sample_create_client_event(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -536,7 +566,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 3198fafb..f4989503 100644 --- a/google/cloud/talent_v4/services/event_service/transports/base.py +++ b/google/cloud/talent_v4/services/event_service/transports/base.py @@ -30,7 +30,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -123,16 +125,18 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_client_event: gapic_v1.method.wrap_method( - self.create_client_event, default_timeout=30.0, client_info=client_info, + self.create_client_event, + default_timeout=30.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 f6d91db4..a1e570c9 100644 --- a/google/cloud/talent_v4/services/event_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/event_service/transports/grpc.py @@ -225,8 +225,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 a7da9a66..01d1f768 100644 --- a/google/cloud/talent_v4/services/job_service/async_client.py +++ b/google/cloud/talent_v4/services/job_service/async_client.py @@ -318,7 +318,12 @@ def sample_create_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -437,7 +442,12 @@ def sample_batch_create_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -551,7 +561,12 @@ def sample_get_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -669,7 +684,12 @@ def sample_update_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -788,7 +808,12 @@ def sample_batch_update_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -893,7 +918,10 @@ def sample_delete_job(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def batch_delete_jobs( @@ -1010,7 +1038,12 @@ def sample_batch_delete_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -1160,12 +1193,20 @@ def sample_list_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListJobsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1239,7 +1280,12 @@ def sample_search_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1318,7 +1364,12 @@ def sample_search_jobs_for_alert(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1332,7 +1383,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/job_service/client.py b/google/cloud/talent_v4/services/job_service/client.py index 8a6df43b..cc8bca50 100644 --- a/google/cloud/talent_v4/services/job_service/client.py +++ b/google/cloud/talent_v4/services/job_service/client.py @@ -61,7 +61,10 @@ class JobServiceClientMeta(type): _transport_registry["grpc"] = JobServiceGrpcTransport _transport_registry["grpc_asyncio"] = JobServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[JobServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[JobServiceTransport]: """Returns an appropriate transport class. Args: @@ -168,10 +171,16 @@ def transport(self) -> JobServiceTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -184,10 +193,16 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def job_path(project: str, tenant: str, job: str,) -> str: + def job_path( + project: str, + tenant: str, + job: str, + ) -> str: """Returns a fully-qualified job string.""" return "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) @staticmethod @@ -200,10 +215,14 @@ def parse_job_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -213,7 +232,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -226,9 +247,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -237,9 +262,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -248,9 +277,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -259,10 +292,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -544,7 +581,12 @@ def sample_create_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -663,7 +705,12 @@ def sample_batch_create_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -767,7 +814,12 @@ def sample_get_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -885,7 +937,12 @@ def sample_update_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1004,7 +1061,12 @@ def sample_batch_update_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1099,7 +1161,10 @@ def sample_delete_job(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def batch_delete_jobs( @@ -1216,7 +1281,12 @@ def sample_batch_delete_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1356,12 +1426,20 @@ def sample_list_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListJobsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1436,7 +1514,12 @@ def sample_search_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1516,7 +1599,12 @@ def sample_search_jobs_for_alert(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1537,7 +1625,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 b15f6d57..f8032b20 100644 --- a/google/cloud/talent_v4/services/job_service/transports/base.py +++ b/google/cloud/talent_v4/services/job_service/transports/base.py @@ -34,7 +34,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -127,10 +129,14 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_job: gapic_v1.method.wrap_method( - self.create_job, default_timeout=30.0, client_info=client_info, + self.create_job, + default_timeout=30.0, + client_info=client_info, ), self.batch_create_jobs: gapic_v1.method.wrap_method( - self.batch_create_jobs, default_timeout=30.0, client_info=client_info, + self.batch_create_jobs, + default_timeout=30.0, + client_info=client_info, ), self.get_job: gapic_v1.method.wrap_method( self.get_job, @@ -148,10 +154,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_job: gapic_v1.method.wrap_method( - self.update_job, default_timeout=30.0, client_info=client_info, + self.update_job, + default_timeout=30.0, + client_info=client_info, ), self.batch_update_jobs: gapic_v1.method.wrap_method( - self.batch_update_jobs, default_timeout=30.0, client_info=client_info, + self.batch_update_jobs, + default_timeout=30.0, + client_info=client_info, ), self.delete_job: gapic_v1.method.wrap_method( self.delete_job, @@ -169,7 +179,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.batch_delete_jobs: gapic_v1.method.wrap_method( - self.batch_delete_jobs, default_timeout=30.0, client_info=client_info, + self.batch_delete_jobs, + default_timeout=30.0, + client_info=client_info, ), self.list_jobs: gapic_v1.method.wrap_method( self.list_jobs, @@ -187,7 +199,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.search_jobs: gapic_v1.method.wrap_method( - self.search_jobs, default_timeout=30.0, client_info=client_info, + self.search_jobs, + default_timeout=30.0, + client_info=client_info, ), self.search_jobs_for_alert: gapic_v1.method.wrap_method( self.search_jobs_for_alert, @@ -199,9 +213,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 d8976e08..5054d204 100644 --- a/google/cloud/talent_v4/services/job_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/job_service/transports/grpc.py @@ -231,8 +231,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 e18c358e..8bde14b7 100644 --- a/google/cloud/talent_v4/services/tenant_service/async_client.py +++ b/google/cloud/talent_v4/services/tenant_service/async_client.py @@ -312,7 +312,12 @@ def sample_create_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -421,7 +426,12 @@ def sample_get_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -541,7 +551,12 @@ def sample_update_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -635,7 +650,10 @@ def sample_delete_tenant(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_tenants( @@ -739,12 +757,20 @@ def sample_list_tenants(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTenantsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -759,7 +785,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4/services/tenant_service/client.py b/google/cloud/talent_v4/services/tenant_service/client.py index 538f7465..45525be8 100644 --- a/google/cloud/talent_v4/services/tenant_service/client.py +++ b/google/cloud/talent_v4/services/tenant_service/client.py @@ -56,7 +56,10 @@ class TenantServiceClientMeta(type): _transport_registry["grpc"] = TenantServiceGrpcTransport _transport_registry["grpc_asyncio"] = TenantServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[TenantServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[TenantServiceTransport]: """Returns an appropriate transport class. Args: @@ -163,10 +166,14 @@ def transport(self) -> TenantServiceTransport: return self._transport @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -176,7 +183,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -189,9 +198,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -200,9 +213,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -211,9 +228,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -222,10 +243,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -504,7 +529,12 @@ def sample_create_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -603,7 +633,12 @@ def sample_get_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -723,7 +758,12 @@ def sample_update_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -807,7 +847,10 @@ def sample_delete_tenant(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_tenants( @@ -901,12 +944,20 @@ def sample_list_tenants(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTenantsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -928,7 +979,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 1d4f670c..5a27b67e 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/base.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -125,7 +127,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_tenant: gapic_v1.method.wrap_method( - self.create_tenant, default_timeout=30.0, client_info=client_info, + self.create_tenant, + default_timeout=30.0, + client_info=client_info, ), self.get_tenant: gapic_v1.method.wrap_method( self.get_tenant, @@ -143,7 +147,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_tenant: gapic_v1.method.wrap_method( - self.update_tenant, default_timeout=30.0, client_info=client_info, + self.update_tenant, + default_timeout=30.0, + client_info=client_info, ), self.delete_tenant: gapic_v1.method.wrap_method( self.delete_tenant, @@ -180,9 +186,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 4e12f681..4b60c231 100644 --- a/google/cloud/talent_v4/services/tenant_service/transports/grpc.py +++ b/google/cloud/talent_v4/services/tenant_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/talent_v4/types/common.py b/google/cloud/talent_v4/types/common.py index f9c34f88..1f0946df 100644 --- a/google/cloud/talent_v4/types/common.py +++ b/google/cloud/talent_v4/types/common.py @@ -215,8 +215,16 @@ class TimestampRange(proto.Message): End of the period (exclusive). """ - start_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) + start_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) class Location(proto.Message): @@ -264,12 +272,25 @@ class LocationType(proto.Enum): NEIGHBORHOOD = 9 STREET_ADDRESS = 10 - location_type = proto.Field(proto.ENUM, number=1, enum=LocationType,) + location_type = proto.Field( + proto.ENUM, + number=1, + enum=LocationType, + ) postal_address = proto.Field( - proto.MESSAGE, number=2, message=postal_address_pb2.PostalAddress, + proto.MESSAGE, + number=2, + message=postal_address_pb2.PostalAddress, + ) + lat_lng = proto.Field( + proto.MESSAGE, + number=3, + message=latlng_pb2.LatLng, + ) + radius_miles = proto.Field( + proto.DOUBLE, + number=4, ) - lat_lng = proto.Field(proto.MESSAGE, number=3, message=latlng_pb2.LatLng,) - radius_miles = proto.Field(proto.DOUBLE, number=4,) class RequestMetadata(proto.Message): @@ -346,11 +367,27 @@ class RequestMetadata(proto.Message): the time of the call to the service. """ - domain = proto.Field(proto.STRING, number=1,) - session_id = proto.Field(proto.STRING, number=2,) - user_id = proto.Field(proto.STRING, number=3,) - allow_missing_ids = proto.Field(proto.BOOL, number=4,) - device_info = proto.Field(proto.MESSAGE, number=5, message="DeviceInfo",) + domain = proto.Field( + proto.STRING, + number=1, + ) + session_id = proto.Field( + proto.STRING, + number=2, + ) + user_id = proto.Field( + proto.STRING, + number=3, + ) + allow_missing_ids = proto.Field( + proto.BOOL, + number=4, + ) + device_info = proto.Field( + proto.MESSAGE, + number=5, + message="DeviceInfo", + ) class ResponseMetadata(proto.Message): @@ -363,7 +400,10 @@ class ResponseMetadata(proto.Message): This id is logged for tracking purposes. """ - request_id = proto.Field(proto.STRING, number=1,) + request_id = proto.Field( + proto.STRING, + number=1, + ) class DeviceInfo(proto.Message): @@ -393,8 +433,15 @@ class DeviceType(proto.Enum): BOT = 5 OTHER = 6 - device_type = proto.Field(proto.ENUM, number=1, enum=DeviceType,) - id = proto.Field(proto.STRING, number=2,) + device_type = proto.Field( + proto.ENUM, + number=1, + enum=DeviceType, + ) + id = proto.Field( + proto.STRING, + number=2, + ) class CustomAttribute(proto.Message): @@ -448,10 +495,22 @@ class CustomAttribute(proto.Message): Default is false. """ - string_values = proto.RepeatedField(proto.STRING, number=1,) - long_values = proto.RepeatedField(proto.INT64, number=2,) - filterable = proto.Field(proto.BOOL, number=3,) - keyword_searchable = proto.Field(proto.BOOL, number=4,) + string_values = proto.RepeatedField( + proto.STRING, + number=1, + ) + long_values = proto.RepeatedField( + proto.INT64, + number=2, + ) + filterable = proto.Field( + proto.BOOL, + number=3, + ) + keyword_searchable = proto.Field( + proto.BOOL, + number=4, + ) class SpellingCorrection(proto.Message): @@ -475,9 +534,18 @@ class SpellingCorrection(proto.Message): "software engineer". """ - corrected = proto.Field(proto.BOOL, number=1,) - corrected_text = proto.Field(proto.STRING, number=2,) - corrected_html = proto.Field(proto.STRING, number=3,) + corrected = proto.Field( + proto.BOOL, + number=1, + ) + corrected_text = proto.Field( + proto.STRING, + number=2, + ) + corrected_html = proto.Field( + proto.STRING, + number=3, + ) class CompensationInfo(proto.Message): @@ -628,10 +696,14 @@ class CompensationEntry(proto.Message): """ type_ = proto.Field( - proto.ENUM, number=1, enum="CompensationInfo.CompensationType", + proto.ENUM, + number=1, + enum="CompensationInfo.CompensationType", ) unit = proto.Field( - proto.ENUM, number=2, enum="CompensationInfo.CompensationUnit", + proto.ENUM, + number=2, + enum="CompensationInfo.CompensationUnit", ) amount = proto.Field( proto.MESSAGE, @@ -645,9 +717,14 @@ class CompensationEntry(proto.Message): oneof="compensation_amount", message="CompensationInfo.CompensationRange", ) - description = proto.Field(proto.STRING, number=5,) + description = proto.Field( + proto.STRING, + number=5, + ) expected_units_per_year = proto.Field( - proto.MESSAGE, number=6, message=wrappers_pb2.DoubleValue, + proto.MESSAGE, + number=6, + message=wrappers_pb2.DoubleValue, ) class CompensationRange(proto.Message): @@ -667,18 +744,30 @@ class CompensationRange(proto.Message): """ max_compensation = proto.Field( - proto.MESSAGE, number=2, message=money_pb2.Money, + proto.MESSAGE, + number=2, + message=money_pb2.Money, ) min_compensation = proto.Field( - proto.MESSAGE, number=1, message=money_pb2.Money, + proto.MESSAGE, + number=1, + message=money_pb2.Money, ) - entries = proto.RepeatedField(proto.MESSAGE, number=1, message=CompensationEntry,) + entries = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=CompensationEntry, + ) annualized_base_compensation_range = proto.Field( - proto.MESSAGE, number=2, message=CompensationRange, + proto.MESSAGE, + number=2, + message=CompensationRange, ) annualized_total_compensation_range = proto.Field( - proto.MESSAGE, number=3, message=CompensationRange, + proto.MESSAGE, + number=3, + message=CompensationRange, ) @@ -723,14 +812,42 @@ class State(proto.Enum): CANCELLING = 5 CANCELLED = 6 - state = proto.Field(proto.ENUM, number=1, enum=State,) - state_description = proto.Field(proto.STRING, number=2,) - success_count = proto.Field(proto.INT32, number=3,) - failure_count = proto.Field(proto.INT32, number=4,) - total_count = proto.Field(proto.INT32, number=5,) - create_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) + state = proto.Field( + proto.ENUM, + number=1, + enum=State, + ) + state_description = proto.Field( + proto.STRING, + number=2, + ) + success_count = proto.Field( + proto.INT32, + number=3, + ) + failure_count = proto.Field( + proto.INT32, + number=4, + ) + total_count = proto.Field( + proto.INT32, + number=5, + ) + create_time = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/company.py b/google/cloud/talent_v4/types/company.py index 5f568b3f..0b9497bc 100644 --- a/google/cloud/talent_v4/types/company.py +++ b/google/cloud/talent_v4/types/company.py @@ -18,7 +18,12 @@ from google.cloud.talent_v4.types import common -__protobuf__ = proto.module(package="google.cloud.talent.v4", manifest={"Company",},) +__protobuf__ = proto.module( + package="google.cloud.talent.v4", + manifest={ + "Company", + }, +) class Company(proto.Message): @@ -106,24 +111,65 @@ class DerivedInfo(proto.Message): """ headquarters_location = proto.Field( - proto.MESSAGE, number=1, message=common.Location, + proto.MESSAGE, + number=1, + message=common.Location, ) - name = proto.Field(proto.STRING, number=1,) - display_name = proto.Field(proto.STRING, number=2,) - external_id = proto.Field(proto.STRING, number=3,) - size = proto.Field(proto.ENUM, number=4, enum=common.CompanySize,) - headquarters_address = proto.Field(proto.STRING, number=5,) - hiring_agency = proto.Field(proto.BOOL, number=6,) - eeo_text = proto.Field(proto.STRING, number=7,) - website_uri = proto.Field(proto.STRING, number=8,) - career_site_uri = proto.Field(proto.STRING, number=9,) - image_uri = proto.Field(proto.STRING, number=10,) + name = proto.Field( + proto.STRING, + number=1, + ) + display_name = proto.Field( + proto.STRING, + number=2, + ) + external_id = proto.Field( + proto.STRING, + number=3, + ) + size = proto.Field( + proto.ENUM, + number=4, + enum=common.CompanySize, + ) + headquarters_address = proto.Field( + proto.STRING, + number=5, + ) + hiring_agency = proto.Field( + proto.BOOL, + number=6, + ) + eeo_text = proto.Field( + proto.STRING, + number=7, + ) + website_uri = proto.Field( + proto.STRING, + number=8, + ) + career_site_uri = proto.Field( + proto.STRING, + number=9, + ) + image_uri = proto.Field( + proto.STRING, + number=10, + ) keyword_searchable_job_custom_attributes = proto.RepeatedField( - proto.STRING, number=11, + proto.STRING, + number=11, + ) + derived_info = proto.Field( + proto.MESSAGE, + number=12, + message=DerivedInfo, + ) + suspended = proto.Field( + proto.BOOL, + number=13, ) - derived_info = proto.Field(proto.MESSAGE, number=12, message=DerivedInfo,) - suspended = proto.Field(proto.BOOL, number=13,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/company_service.py b/google/cloud/talent_v4/types/company_service.py index 9a16a976..3f4d7338 100644 --- a/google/cloud/talent_v4/types/company_service.py +++ b/google/cloud/talent_v4/types/company_service.py @@ -47,8 +47,15 @@ class CreateCompanyRequest(proto.Message): Required. The company to be created. """ - parent = proto.Field(proto.STRING, number=1,) - company = proto.Field(proto.MESSAGE, number=2, message=gct_company.Company,) + parent = proto.Field( + proto.STRING, + number=1, + ) + company = proto.Field( + proto.MESSAGE, + number=2, + message=gct_company.Company, + ) class GetCompanyRequest(proto.Message): @@ -64,7 +71,10 @@ class GetCompanyRequest(proto.Message): "projects/api-test-project/tenants/foo/companies/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateCompanyRequest(proto.Message): @@ -88,9 +98,15 @@ class UpdateCompanyRequest(proto.Message): [Company][google.cloud.talent.v4.Company] are supported. """ - company = proto.Field(proto.MESSAGE, number=1, message=gct_company.Company,) + company = proto.Field( + proto.MESSAGE, + number=1, + message=gct_company.Company, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -106,7 +122,10 @@ class DeleteCompanyRequest(proto.Message): for example, "projects/foo/tenants/bar/companies/baz". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListCompaniesRequest(proto.Message): @@ -137,10 +156,22 @@ class ListCompaniesRequest(proto.Message): jobs are returned. """ - parent = proto.Field(proto.STRING, number=1,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - require_open_jobs = proto.Field(proto.BOOL, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + require_open_jobs = proto.Field( + proto.BOOL, + number=4, + ) class ListCompaniesResponse(proto.Message): @@ -161,10 +192,19 @@ def raw_page(self): return self companies = proto.RepeatedField( - proto.MESSAGE, number=1, message=gct_company.Company, + proto.MESSAGE, + number=1, + message=gct_company.Company, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, ) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/completion_service.py b/google/cloud/talent_v4/types/completion_service.py index fed0abd0..5f7f0a4f 100644 --- a/google/cloud/talent_v4/types/completion_service.py +++ b/google/cloud/talent_v4/types/completion_service.py @@ -20,7 +20,10 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4", - manifest={"CompleteQueryRequest", "CompleteQueryResponse",}, + manifest={ + "CompleteQueryRequest", + "CompleteQueryResponse", + }, ) @@ -75,13 +78,36 @@ class CompletionType(proto.Enum): COMPANY_NAME = 2 COMBINED = 3 - tenant = proto.Field(proto.STRING, number=1,) - query = proto.Field(proto.STRING, number=2,) - language_codes = proto.RepeatedField(proto.STRING, number=3,) - page_size = proto.Field(proto.INT32, number=4,) - company = proto.Field(proto.STRING, number=5,) - scope = proto.Field(proto.ENUM, number=6, enum=CompletionScope,) - type_ = proto.Field(proto.ENUM, number=7, enum=CompletionType,) + tenant = proto.Field( + proto.STRING, + number=1, + ) + query = proto.Field( + proto.STRING, + number=2, + ) + language_codes = proto.RepeatedField( + proto.STRING, + number=3, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + company = proto.Field( + proto.STRING, + number=5, + ) + scope = proto.Field( + proto.ENUM, + number=6, + enum=CompletionScope, + ) + type_ = proto.Field( + proto.ENUM, + number=7, + enum=CompletionType, + ) class CompleteQueryResponse(proto.Message): @@ -109,16 +135,30 @@ class CompletionResult(proto.Message): [COMPANY_NAME][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMPANY_NAME]. """ - suggestion = proto.Field(proto.STRING, number=1,) + suggestion = proto.Field( + proto.STRING, + number=1, + ) type_ = proto.Field( - proto.ENUM, number=2, enum="CompleteQueryRequest.CompletionType", + proto.ENUM, + number=2, + enum="CompleteQueryRequest.CompletionType", + ) + image_uri = proto.Field( + proto.STRING, + number=3, ) - image_uri = proto.Field(proto.STRING, number=3,) completion_results = proto.RepeatedField( - proto.MESSAGE, number=1, message=CompletionResult, + proto.MESSAGE, + number=1, + message=CompletionResult, + ) + metadata = proto.Field( + proto.MESSAGE, + number=2, + message=common.ResponseMetadata, ) - metadata = proto.Field(proto.MESSAGE, number=2, message=common.ResponseMetadata,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/event.py b/google/cloud/talent_v4/types/event.py index 4a9b7c4d..f7f2d1ee 100644 --- a/google/cloud/talent_v4/types/event.py +++ b/google/cloud/talent_v4/types/event.py @@ -19,7 +19,11 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4", manifest={"ClientEvent", "JobEvent",}, + package="google.cloud.talent.v4", + manifest={ + "ClientEvent", + "JobEvent", + }, ) @@ -58,11 +62,29 @@ class ClientEvent(proto.Message): job was bookmarked. """ - request_id = proto.Field(proto.STRING, number=1,) - event_id = proto.Field(proto.STRING, number=2,) - create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) - job_event = proto.Field(proto.MESSAGE, number=5, oneof="event", message="JobEvent",) - event_notes = proto.Field(proto.STRING, number=9,) + request_id = proto.Field( + proto.STRING, + number=1, + ) + event_id = proto.Field( + proto.STRING, + number=2, + ) + create_time = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + job_event = proto.Field( + proto.MESSAGE, + number=5, + oneof="event", + message="JobEvent", + ) + event_notes = proto.Field( + proto.STRING, + number=9, + ) class JobEvent(proto.Message): @@ -108,8 +130,15 @@ class JobEventType(proto.Enum): SENT_CV = 14 INTERVIEW_GRANTED = 15 - type_ = proto.Field(proto.ENUM, number=1, enum=JobEventType,) - jobs = proto.RepeatedField(proto.STRING, number=2,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=JobEventType, + ) + jobs = proto.RepeatedField( + proto.STRING, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/event_service.py b/google/cloud/talent_v4/types/event_service.py index 4c617f37..dcd8ec08 100644 --- a/google/cloud/talent_v4/types/event_service.py +++ b/google/cloud/talent_v4/types/event_service.py @@ -19,7 +19,10 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4", manifest={"CreateClientEventRequest",}, + package="google.cloud.talent.v4", + manifest={ + "CreateClientEventRequest", + }, ) @@ -39,8 +42,15 @@ class CreateClientEventRequest(proto.Message): Cloud Talent Solution. """ - parent = proto.Field(proto.STRING, number=1,) - client_event = proto.Field(proto.MESSAGE, number=2, message=event.ClientEvent,) + parent = proto.Field( + proto.STRING, + number=1, + ) + client_event = proto.Field( + proto.MESSAGE, + number=2, + message=event.ClientEvent, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/filters.py b/google/cloud/talent_v4/types/filters.py index 74752a16..4f6a368b 100644 --- a/google/cloud/talent_v4/types/filters.py +++ b/google/cloud/talent_v4/types/filters.py @@ -23,7 +23,12 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4", - manifest={"JobQuery", "LocationFilter", "CompensationFilter", "CommuteFilter",}, + manifest={ + "JobQuery", + "LocationFilter", + "CompensationFilter", + "CommuteFilter", + }, ) @@ -194,28 +199,68 @@ class JobQuery(proto.Message): At most 400 excluded job names are allowed. """ - query = proto.Field(proto.STRING, number=1,) - query_language_code = proto.Field(proto.STRING, number=14,) - companies = proto.RepeatedField(proto.STRING, number=2,) + query = proto.Field( + proto.STRING, + number=1, + ) + query_language_code = proto.Field( + proto.STRING, + number=14, + ) + companies = proto.RepeatedField( + proto.STRING, + number=2, + ) location_filters = proto.RepeatedField( - proto.MESSAGE, number=3, message="LocationFilter", + proto.MESSAGE, + number=3, + message="LocationFilter", + ) + job_categories = proto.RepeatedField( + proto.ENUM, + number=4, + enum=common.JobCategory, + ) + commute_filter = proto.Field( + proto.MESSAGE, + number=5, + message="CommuteFilter", + ) + company_display_names = proto.RepeatedField( + proto.STRING, + number=6, ) - job_categories = proto.RepeatedField(proto.ENUM, number=4, enum=common.JobCategory,) - commute_filter = proto.Field(proto.MESSAGE, number=5, message="CommuteFilter",) - company_display_names = proto.RepeatedField(proto.STRING, number=6,) compensation_filter = proto.Field( - proto.MESSAGE, number=7, message="CompensationFilter", + proto.MESSAGE, + number=7, + message="CompensationFilter", + ) + custom_attribute_filter = proto.Field( + proto.STRING, + number=8, + ) + disable_spell_check = proto.Field( + proto.BOOL, + number=9, ) - custom_attribute_filter = proto.Field(proto.STRING, number=8,) - disable_spell_check = proto.Field(proto.BOOL, number=9,) employment_types = proto.RepeatedField( - proto.ENUM, number=10, enum=common.EmploymentType, + proto.ENUM, + number=10, + enum=common.EmploymentType, + ) + language_codes = proto.RepeatedField( + proto.STRING, + number=11, ) - language_codes = proto.RepeatedField(proto.STRING, number=11,) publish_time_range = proto.Field( - proto.MESSAGE, number=12, message=common.TimestampRange, + proto.MESSAGE, + number=12, + message=common.TimestampRange, + ) + excluded_jobs = proto.RepeatedField( + proto.STRING, + number=13, ) - excluded_jobs = proto.RepeatedField(proto.STRING, number=13,) class LocationFilter(proto.Message): @@ -293,12 +338,27 @@ class TelecommutePreference(proto.Enum): TELECOMMUTE_EXCLUDED = 1 TELECOMMUTE_ALLOWED = 2 - address = proto.Field(proto.STRING, number=1,) - region_code = proto.Field(proto.STRING, number=2,) - lat_lng = proto.Field(proto.MESSAGE, number=3, message=latlng_pb2.LatLng,) - distance_in_miles = proto.Field(proto.DOUBLE, number=4,) + address = proto.Field( + proto.STRING, + number=1, + ) + region_code = proto.Field( + proto.STRING, + number=2, + ) + lat_lng = proto.Field( + proto.MESSAGE, + number=3, + message=latlng_pb2.LatLng, + ) + distance_in_miles = proto.Field( + proto.DOUBLE, + number=4, + ) telecommute_preference = proto.Field( - proto.ENUM, number=5, enum=TelecommutePreference, + proto.ENUM, + number=5, + enum=TelecommutePreference, ) @@ -326,15 +386,24 @@ class FilterType(proto.Enum): ANNUALIZED_BASE_AMOUNT = 3 ANNUALIZED_TOTAL_AMOUNT = 4 - type_ = proto.Field(proto.ENUM, number=1, enum=FilterType,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=FilterType, + ) units = proto.RepeatedField( - proto.ENUM, number=2, enum=common.CompensationInfo.CompensationUnit, + proto.ENUM, + number=2, + enum=common.CompensationInfo.CompensationUnit, ) range_ = proto.Field( - proto.MESSAGE, number=3, message=common.CompensationInfo.CompensationRange, + proto.MESSAGE, + number=3, + message=common.CompensationInfo.CompensationRange, ) include_jobs_with_unspecified_compensation_range = proto.Field( - proto.BOOL, number=4, + proto.BOOL, + number=4, ) @@ -388,14 +457,30 @@ class RoadTraffic(proto.Enum): TRAFFIC_FREE = 1 BUSY_HOUR = 2 - commute_method = proto.Field(proto.ENUM, number=1, enum=common.CommuteMethod,) - start_coordinates = proto.Field(proto.MESSAGE, number=2, message=latlng_pb2.LatLng,) + commute_method = proto.Field( + proto.ENUM, + number=1, + enum=common.CommuteMethod, + ) + start_coordinates = proto.Field( + proto.MESSAGE, + number=2, + message=latlng_pb2.LatLng, + ) travel_duration = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + allow_imprecise_addresses = proto.Field( + proto.BOOL, + number=4, ) - allow_imprecise_addresses = proto.Field(proto.BOOL, number=4,) road_traffic = proto.Field( - proto.ENUM, number=5, oneof="traffic_option", enum=RoadTraffic, + proto.ENUM, + number=5, + oneof="traffic_option", + enum=RoadTraffic, ) departure_time = proto.Field( proto.MESSAGE, diff --git a/google/cloud/talent_v4/types/histogram.py b/google/cloud/talent_v4/types/histogram.py index e08d1f6c..3e0650e9 100644 --- a/google/cloud/talent_v4/types/histogram.py +++ b/google/cloud/talent_v4/types/histogram.py @@ -18,7 +18,10 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4", - manifest={"HistogramQuery", "HistogramQueryResult",}, + manifest={ + "HistogramQuery", + "HistogramQueryResult", + }, ) @@ -35,7 +38,10 @@ class HistogramQuery(proto.Message): for details about syntax. """ - histogram_query = proto.Field(proto.STRING, number=1,) + histogram_query = proto.Field( + proto.STRING, + number=1, + ) class HistogramQueryResult(proto.Message): @@ -62,8 +68,15 @@ class HistogramQueryResult(proto.Message): ``0-MAX``. """ - histogram_query = proto.Field(proto.STRING, number=1,) - histogram = proto.MapField(proto.STRING, proto.INT64, number=2,) + histogram_query = proto.Field( + proto.STRING, + number=1, + ) + histogram = proto.MapField( + proto.STRING, + proto.INT64, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/job.py b/google/cloud/talent_v4/types/job.py index 8a2bf3bc..c983bcbd 100644 --- a/google/cloud/talent_v4/types/job.py +++ b/google/cloud/talent_v4/types/job.py @@ -19,7 +19,12 @@ from google.protobuf import timestamp_pb2 # type: ignore -__protobuf__ = proto.module(package="google.cloud.talent.v4", manifest={"Job",},) +__protobuf__ = proto.module( + package="google.cloud.talent.v4", + manifest={ + "Job", + }, +) class Job(proto.Message): @@ -345,9 +350,18 @@ class ApplicationInfo(proto.Message): each entry is 2,000. """ - emails = proto.RepeatedField(proto.STRING, number=1,) - instruction = proto.Field(proto.STRING, number=2,) - uris = proto.RepeatedField(proto.STRING, number=3,) + emails = proto.RepeatedField( + proto.STRING, + number=1, + ) + instruction = proto.Field( + proto.STRING, + number=2, + ) + uris = proto.RepeatedField( + proto.STRING, + number=3, + ) class DerivedInfo(proto.Message): r"""Derived details about the job posting. @@ -368,10 +382,14 @@ class DerivedInfo(proto.Message): """ locations = proto.RepeatedField( - proto.MESSAGE, number=1, message=common.Location, + proto.MESSAGE, + number=1, + message=common.Location, ) job_categories = proto.RepeatedField( - proto.ENUM, number=3, enum=common.JobCategory, + proto.ENUM, + number=3, + enum=common.JobCategory, ) class ProcessingOptions(proto.Message): @@ -398,60 +416,153 @@ class ProcessingOptions(proto.Message): [HtmlSanitization.SIMPLE_FORMATTING_ONLY][google.cloud.talent.v4.HtmlSanitization.SIMPLE_FORMATTING_ONLY]. """ - disable_street_address_resolution = proto.Field(proto.BOOL, number=1,) + disable_street_address_resolution = proto.Field( + proto.BOOL, + number=1, + ) html_sanitization = proto.Field( - proto.ENUM, number=2, enum=common.HtmlSanitization, + proto.ENUM, + number=2, + enum=common.HtmlSanitization, ) - name = proto.Field(proto.STRING, number=1,) - company = proto.Field(proto.STRING, number=2,) - requisition_id = proto.Field(proto.STRING, number=3,) - title = proto.Field(proto.STRING, number=4,) - description = proto.Field(proto.STRING, number=5,) - addresses = proto.RepeatedField(proto.STRING, number=6,) - application_info = proto.Field(proto.MESSAGE, number=7, message=ApplicationInfo,) - job_benefits = proto.RepeatedField(proto.ENUM, number=8, enum=common.JobBenefit,) + name = proto.Field( + proto.STRING, + number=1, + ) + company = proto.Field( + proto.STRING, + number=2, + ) + requisition_id = proto.Field( + proto.STRING, + number=3, + ) + title = proto.Field( + proto.STRING, + number=4, + ) + description = proto.Field( + proto.STRING, + number=5, + ) + addresses = proto.RepeatedField( + proto.STRING, + number=6, + ) + application_info = proto.Field( + proto.MESSAGE, + number=7, + message=ApplicationInfo, + ) + job_benefits = proto.RepeatedField( + proto.ENUM, + number=8, + enum=common.JobBenefit, + ) compensation_info = proto.Field( - proto.MESSAGE, number=9, message=common.CompensationInfo, + proto.MESSAGE, + number=9, + message=common.CompensationInfo, ) custom_attributes = proto.MapField( - proto.STRING, proto.MESSAGE, number=10, message=common.CustomAttribute, + proto.STRING, + proto.MESSAGE, + number=10, + message=common.CustomAttribute, + ) + degree_types = proto.RepeatedField( + proto.ENUM, + number=11, + enum=common.DegreeType, + ) + department = proto.Field( + proto.STRING, + number=12, ) - degree_types = proto.RepeatedField(proto.ENUM, number=11, enum=common.DegreeType,) - department = proto.Field(proto.STRING, number=12,) employment_types = proto.RepeatedField( - proto.ENUM, number=13, enum=common.EmploymentType, + proto.ENUM, + number=13, + enum=common.EmploymentType, + ) + incentives = proto.Field( + proto.STRING, + number=14, + ) + language_code = proto.Field( + proto.STRING, + number=15, + ) + job_level = proto.Field( + proto.ENUM, + number=16, + enum=common.JobLevel, + ) + promotion_value = proto.Field( + proto.INT32, + number=17, + ) + qualifications = proto.Field( + proto.STRING, + number=18, + ) + responsibilities = proto.Field( + proto.STRING, + number=19, + ) + posting_region = proto.Field( + proto.ENUM, + number=20, + enum=common.PostingRegion, + ) + visibility = proto.Field( + proto.ENUM, + number=21, + enum=common.Visibility, ) - incentives = proto.Field(proto.STRING, number=14,) - language_code = proto.Field(proto.STRING, number=15,) - job_level = proto.Field(proto.ENUM, number=16, enum=common.JobLevel,) - promotion_value = proto.Field(proto.INT32, number=17,) - qualifications = proto.Field(proto.STRING, number=18,) - responsibilities = proto.Field(proto.STRING, number=19,) - posting_region = proto.Field(proto.ENUM, number=20, enum=common.PostingRegion,) - visibility = proto.Field(proto.ENUM, number=21, enum=common.Visibility,) job_start_time = proto.Field( - proto.MESSAGE, number=22, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=22, + message=timestamp_pb2.Timestamp, ) job_end_time = proto.Field( - proto.MESSAGE, number=23, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=23, + message=timestamp_pb2.Timestamp, ) posting_publish_time = proto.Field( - proto.MESSAGE, number=24, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=24, + message=timestamp_pb2.Timestamp, ) posting_expire_time = proto.Field( - proto.MESSAGE, number=25, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=25, + message=timestamp_pb2.Timestamp, ) posting_create_time = proto.Field( - proto.MESSAGE, number=26, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=26, + message=timestamp_pb2.Timestamp, ) posting_update_time = proto.Field( - proto.MESSAGE, number=27, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=27, + message=timestamp_pb2.Timestamp, + ) + company_display_name = proto.Field( + proto.STRING, + number=28, + ) + derived_info = proto.Field( + proto.MESSAGE, + number=29, + message=DerivedInfo, ) - company_display_name = proto.Field(proto.STRING, number=28,) - derived_info = proto.Field(proto.MESSAGE, number=29, message=DerivedInfo,) processing_options = proto.Field( - proto.MESSAGE, number=30, message=ProcessingOptions, + proto.MESSAGE, + number=30, + message=ProcessingOptions, ) diff --git a/google/cloud/talent_v4/types/job_service.py b/google/cloud/talent_v4/types/job_service.py index 8e16e4c8..889403c9 100644 --- a/google/cloud/talent_v4/types/job_service.py +++ b/google/cloud/talent_v4/types/job_service.py @@ -75,8 +75,15 @@ class CreateJobRequest(proto.Message): Required. The Job to be created. """ - parent = proto.Field(proto.STRING, number=1,) - job = proto.Field(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + job = proto.Field( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) class GetJobRequest(proto.Message): @@ -91,7 +98,10 @@ class GetJobRequest(proto.Message): For example, "projects/foo/tenants/bar/jobs/baz". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateJobRequest(proto.Message): @@ -114,9 +124,15 @@ class UpdateJobRequest(proto.Message): supported. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -132,7 +148,10 @@ class DeleteJobRequest(proto.Message): For example, "projects/foo/tenants/bar/jobs/baz". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListJobsRequest(proto.Message): @@ -191,11 +210,27 @@ class ListJobsRequest(proto.Message): if no value is specified. """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - page_size = proto.Field(proto.INT32, number=4,) - job_view = proto.Field(proto.ENUM, number=5, enum="JobView",) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + job_view = proto.Field( + proto.ENUM, + number=5, + enum="JobView", + ) class ListJobsResponse(proto.Message): @@ -217,9 +252,20 @@ class ListJobsResponse(proto.Message): def raw_page(self): return self - jobs = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_job.Job,) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, + ) class SearchJobsRequest(proto.Message): @@ -632,31 +678,79 @@ class ImportanceLevel(proto.Enum): number=1, enum="SearchJobsRequest.CustomRankingInfo.ImportanceLevel", ) - ranking_expression = proto.Field(proto.STRING, number=2,) + ranking_expression = proto.Field( + proto.STRING, + number=2, + ) - parent = proto.Field(proto.STRING, number=1,) - search_mode = proto.Field(proto.ENUM, number=2, enum=SearchMode,) + parent = proto.Field( + proto.STRING, + number=1, + ) + search_mode = proto.Field( + proto.ENUM, + number=2, + enum=SearchMode, + ) request_metadata = proto.Field( - proto.MESSAGE, number=3, message=common.RequestMetadata, + proto.MESSAGE, + number=3, + message=common.RequestMetadata, + ) + job_query = proto.Field( + proto.MESSAGE, + number=4, + message=filters.JobQuery, + ) + enable_broadening = proto.Field( + proto.BOOL, + number=5, ) - job_query = proto.Field(proto.MESSAGE, number=4, message=filters.JobQuery,) - enable_broadening = proto.Field(proto.BOOL, number=5,) histogram_queries = proto.RepeatedField( - proto.MESSAGE, number=7, message=histogram.HistogramQuery, + proto.MESSAGE, + number=7, + message=histogram.HistogramQuery, + ) + job_view = proto.Field( + proto.ENUM, + number=8, + enum="JobView", + ) + offset = proto.Field( + proto.INT32, + number=9, + ) + max_page_size = proto.Field( + proto.INT32, + number=10, + ) + page_token = proto.Field( + proto.STRING, + number=11, + ) + order_by = proto.Field( + proto.STRING, + number=12, ) - job_view = proto.Field(proto.ENUM, number=8, enum="JobView",) - offset = proto.Field(proto.INT32, number=9,) - max_page_size = proto.Field(proto.INT32, number=10,) - page_token = proto.Field(proto.STRING, number=11,) - order_by = proto.Field(proto.STRING, number=12,) diversification_level = proto.Field( - proto.ENUM, number=13, enum=DiversificationLevel, + proto.ENUM, + number=13, + enum=DiversificationLevel, ) custom_ranking_info = proto.Field( - proto.MESSAGE, number=14, message=CustomRankingInfo, + proto.MESSAGE, + number=14, + message=CustomRankingInfo, + ) + disable_keyword_match = proto.Field( + proto.BOOL, + number=16, + ) + keyword_match_mode = proto.Field( + proto.ENUM, + number=18, + enum=KeywordMatchMode, ) - disable_keyword_match = proto.Field(proto.BOOL, number=16,) - keyword_match_mode = proto.Field(proto.ENUM, number=18, enum=KeywordMatchMode,) class SearchJobsResponse(proto.Message): @@ -732,12 +826,27 @@ class MatchingJob(proto.Message): [CommuteFilter][google.cloud.talent.v4.CommuteFilter]. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) - job_summary = proto.Field(proto.STRING, number=2,) - job_title_snippet = proto.Field(proto.STRING, number=3,) - search_text_snippet = proto.Field(proto.STRING, number=4,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + job_summary = proto.Field( + proto.STRING, + number=2, + ) + job_title_snippet = proto.Field( + proto.STRING, + number=3, + ) + search_text_snippet = proto.Field( + proto.STRING, + number=4, + ) commute_info = proto.Field( - proto.MESSAGE, number=5, message="SearchJobsResponse.CommuteInfo", + proto.MESSAGE, + number=5, + message="SearchJobsResponse.CommuteInfo", ) class CommuteInfo(proto.Message): @@ -755,28 +864,57 @@ class CommuteInfo(proto.Message): but was returned as part of an expanded query. """ - job_location = proto.Field(proto.MESSAGE, number=1, message=common.Location,) + job_location = proto.Field( + proto.MESSAGE, + number=1, + message=common.Location, + ) travel_duration = proto.Field( - proto.MESSAGE, number=2, message=duration_pb2.Duration, + proto.MESSAGE, + number=2, + message=duration_pb2.Duration, ) @property def raw_page(self): return self - matching_jobs = proto.RepeatedField(proto.MESSAGE, number=1, message=MatchingJob,) + matching_jobs = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=MatchingJob, + ) histogram_query_results = proto.RepeatedField( - proto.MESSAGE, number=2, message=histogram.HistogramQueryResult, + proto.MESSAGE, + number=2, + message=histogram.HistogramQueryResult, + ) + next_page_token = proto.Field( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=3,) location_filters = proto.RepeatedField( - proto.MESSAGE, number=4, message=common.Location, + proto.MESSAGE, + number=4, + message=common.Location, + ) + total_size = proto.Field( + proto.INT32, + number=6, + ) + metadata = proto.Field( + proto.MESSAGE, + number=7, + message=common.ResponseMetadata, + ) + broadened_query_jobs_count = proto.Field( + proto.INT32, + number=8, ) - total_size = proto.Field(proto.INT32, number=6,) - metadata = proto.Field(proto.MESSAGE, number=7, message=common.ResponseMetadata,) - broadened_query_jobs_count = proto.Field(proto.INT32, number=8,) spell_correction = proto.Field( - proto.MESSAGE, number=9, message=common.SpellingCorrection, + proto.MESSAGE, + number=9, + message=common.SpellingCorrection, ) @@ -795,8 +933,15 @@ class BatchCreateJobsRequest(proto.Message): A maximum of 200 jobs can be created in a batch. """ - parent = proto.Field(proto.STRING, number=1,) - jobs = proto.RepeatedField(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) class BatchUpdateJobsRequest(proto.Message): @@ -836,10 +981,19 @@ class BatchUpdateJobsRequest(proto.Message): which can yield a very large response. """ - parent = proto.Field(proto.STRING, number=1,) - jobs = proto.RepeatedField(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) update_mask = proto.Field( - proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=3, + message=field_mask_pb2.FieldMask, ) @@ -866,8 +1020,14 @@ class BatchDeleteJobsRequest(proto.Message): A maximum of 200 jobs can be deleted in a batch. """ - parent = proto.Field(proto.STRING, number=1,) - names = proto.RepeatedField(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + names = proto.RepeatedField( + proto.STRING, + number=2, + ) class JobResult(proto.Message): @@ -890,8 +1050,16 @@ class JobResult(proto.Message): [job][google.cloud.talent.v4.JobResult.job] fails. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) - status = proto.Field(proto.MESSAGE, number=2, message=status_pb2.Status,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + status = proto.Field( + proto.MESSAGE, + number=2, + message=status_pb2.Status, + ) class BatchCreateJobsResponse(proto.Message): @@ -908,7 +1076,11 @@ class BatchCreateJobsResponse(proto.Message): status is FINISHED, FAILED or CANCELLED. """ - job_results = proto.RepeatedField(proto.MESSAGE, number=1, message="JobResult",) + job_results = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="JobResult", + ) class BatchUpdateJobsResponse(proto.Message): @@ -925,7 +1097,11 @@ class BatchUpdateJobsResponse(proto.Message): status is FINISHED, FAILED or CANCELLED. """ - job_results = proto.RepeatedField(proto.MESSAGE, number=1, message="JobResult",) + job_results = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="JobResult", + ) class BatchDeleteJobsResponse(proto.Message): @@ -942,7 +1118,11 @@ class BatchDeleteJobsResponse(proto.Message): status is FINISHED, FAILED or CANCELLED. """ - job_results = proto.RepeatedField(proto.MESSAGE, number=1, message="JobResult",) + job_results = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="JobResult", + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/tenant.py b/google/cloud/talent_v4/types/tenant.py index fb5dbd57..aeab18c9 100644 --- a/google/cloud/talent_v4/types/tenant.py +++ b/google/cloud/talent_v4/types/tenant.py @@ -16,7 +16,12 @@ import proto # type: ignore -__protobuf__ = proto.module(package="google.cloud.talent.v4", manifest={"Tenant",},) +__protobuf__ = proto.module( + package="google.cloud.talent.v4", + manifest={ + "Tenant", + }, +) class Tenant(proto.Message): @@ -40,8 +45,14 @@ class Tenant(proto.Message): The maximum number of allowed characters is 255. """ - name = proto.Field(proto.STRING, number=1,) - external_id = proto.Field(proto.STRING, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + external_id = proto.Field( + proto.STRING, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4/types/tenant_service.py b/google/cloud/talent_v4/types/tenant_service.py index 5bceddfb..eed43ef8 100644 --- a/google/cloud/talent_v4/types/tenant_service.py +++ b/google/cloud/talent_v4/types/tenant_service.py @@ -47,8 +47,15 @@ class CreateTenantRequest(proto.Message): Required. The tenant to be created. """ - parent = proto.Field(proto.STRING, number=1,) - tenant = proto.Field(proto.MESSAGE, number=2, message=gct_tenant.Tenant,) + parent = proto.Field( + proto.STRING, + number=1, + ) + tenant = proto.Field( + proto.MESSAGE, + number=2, + message=gct_tenant.Tenant, + ) class GetTenantRequest(proto.Message): @@ -62,7 +69,10 @@ class GetTenantRequest(proto.Message): for example, "projects/foo/tenants/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateTenantRequest(proto.Message): @@ -86,9 +96,15 @@ class UpdateTenantRequest(proto.Message): [Tenant][google.cloud.talent.v4.Tenant] are supported. """ - tenant = proto.Field(proto.MESSAGE, number=1, message=gct_tenant.Tenant,) + tenant = proto.Field( + proto.MESSAGE, + number=1, + message=gct_tenant.Tenant, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -103,7 +119,10 @@ class DeleteTenantRequest(proto.Message): for example, "projects/foo/tenants/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListTenantsRequest(proto.Message): @@ -125,9 +144,18 @@ class ListTenantsRequest(proto.Message): number is provided. """ - parent = proto.Field(proto.STRING, number=1,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) class ListTenantsResponse(proto.Message): @@ -147,9 +175,20 @@ class ListTenantsResponse(proto.Message): def raw_page(self): return self - tenants = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_tenant.Tenant,) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) + tenants = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_tenant.Tenant, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, + ) __all__ = tuple(sorted(__protobuf__.manifest)) 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 0caff896..05dcb98e 100644 --- a/google/cloud/talent_v4beta1/services/application_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/application_service/async_client.py @@ -324,7 +324,12 @@ def sample_create_application(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -429,7 +434,12 @@ def sample_get_application(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -527,7 +537,12 @@ def sample_update_application(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -623,7 +638,10 @@ def sample_delete_application(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_applications( @@ -729,12 +747,20 @@ def sample_list_applications(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListApplicationsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -749,7 +775,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/application_service/client.py b/google/cloud/talent_v4beta1/services/application_service/client.py index b26fdd88..168610ff 100644 --- a/google/cloud/talent_v4beta1/services/application_service/client.py +++ b/google/cloud/talent_v4beta1/services/application_service/client.py @@ -62,7 +62,8 @@ class ApplicationServiceClientMeta(type): _transport_registry["grpc_asyncio"] = ApplicationServiceGrpcAsyncIOTransport def get_transport_class( - cls, label: str = None, + cls, + label: str = None, ) -> Type[ApplicationServiceTransport]: """Returns an appropriate transport class. @@ -171,11 +172,17 @@ def transport(self) -> ApplicationServiceTransport: @staticmethod def application_path( - project: str, tenant: str, profile: str, application: str, + project: str, + tenant: str, + profile: str, + application: str, ) -> str: """Returns a fully-qualified application string.""" return "projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}".format( - project=project, tenant=tenant, profile=profile, application=application, + project=project, + tenant=tenant, + profile=profile, + application=application, ) @staticmethod @@ -188,10 +195,16 @@ def parse_application_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -204,10 +217,16 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def job_path(project: str, tenant: str, job: str,) -> str: + def job_path( + project: str, + tenant: str, + job: str, + ) -> str: """Returns a fully-qualified job string.""" return "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) @staticmethod @@ -220,10 +239,16 @@ def parse_job_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def profile_path(project: str, tenant: str, profile: str,) -> str: + def profile_path( + project: str, + tenant: str, + profile: str, + ) -> str: """Returns a fully-qualified profile string.""" return "projects/{project}/tenants/{tenant}/profiles/{profile}".format( - project=project, tenant=tenant, profile=profile, + project=project, + tenant=tenant, + profile=profile, ) @staticmethod @@ -236,7 +261,9 @@ def parse_profile_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -249,9 +276,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -260,9 +291,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -271,9 +306,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -282,10 +321,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -564,7 +607,12 @@ def sample_create_application(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -659,7 +707,12 @@ def sample_get_application(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -757,7 +810,12 @@ def sample_update_application(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -843,7 +901,10 @@ def sample_delete_application(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_applications( @@ -939,12 +1000,20 @@ def sample_list_applications(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListApplicationsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -966,7 +1035,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 676dad13..9a9ab85c 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -125,7 +127,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_application: gapic_v1.method.wrap_method( - self.create_application, default_timeout=30.0, client_info=client_info, + self.create_application, + default_timeout=30.0, + client_info=client_info, ), self.get_application: gapic_v1.method.wrap_method( self.get_application, @@ -143,7 +147,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_application: gapic_v1.method.wrap_method( - self.update_application, default_timeout=30.0, client_info=client_info, + self.update_application, + default_timeout=30.0, + client_info=client_info, ), self.delete_application: gapic_v1.method.wrap_method( self.delete_application, @@ -180,9 +186,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 6f76dd55..196f3182 100644 --- a/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/application_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 d1aaa359..79f2954e 100644 --- a/google/cloud/talent_v4beta1/services/company_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/company_service/async_client.py @@ -315,7 +315,12 @@ def sample_create_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -427,7 +432,12 @@ def sample_get_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -528,7 +538,12 @@ def sample_update_company(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -629,7 +644,10 @@ def sample_delete_company(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_companies( @@ -737,12 +755,20 @@ def sample_list_companies(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListCompaniesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -757,7 +783,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/company_service/client.py b/google/cloud/talent_v4beta1/services/company_service/client.py index 2aa57d52..c3d6485a 100644 --- a/google/cloud/talent_v4beta1/services/company_service/client.py +++ b/google/cloud/talent_v4beta1/services/company_service/client.py @@ -58,7 +58,10 @@ class CompanyServiceClientMeta(type): _transport_registry["grpc"] = CompanyServiceGrpcTransport _transport_registry["grpc_asyncio"] = CompanyServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CompanyServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CompanyServiceTransport]: """Returns an appropriate transport class. Args: @@ -165,10 +168,16 @@ def transport(self) -> CompanyServiceTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -181,7 +190,9 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -194,9 +205,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -205,9 +220,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -216,9 +235,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -227,10 +250,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -512,7 +539,12 @@ def sample_create_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -614,7 +646,12 @@ def sample_get_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -715,7 +752,12 @@ def sample_update_company(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -806,7 +848,10 @@ def sample_delete_company(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_companies( @@ -904,12 +949,20 @@ def sample_list_companies(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListCompaniesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -931,7 +984,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 0b183dc8..2a483226 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -125,7 +127,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_company: gapic_v1.method.wrap_method( - self.create_company, default_timeout=30.0, client_info=client_info, + self.create_company, + default_timeout=30.0, + client_info=client_info, ), self.get_company: gapic_v1.method.wrap_method( self.get_company, @@ -143,7 +147,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_company: gapic_v1.method.wrap_method( - self.update_company, default_timeout=30.0, client_info=client_info, + self.update_company, + default_timeout=30.0, + client_info=client_info, ), self.delete_company: gapic_v1.method.wrap_method( self.delete_company, @@ -180,9 +186,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 927d6be2..7a4ba433 100644 --- a/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/company_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/talent_v4beta1/services/completion/async_client.py b/google/cloud/talent_v4beta1/services/completion/async_client.py index 33b22b2d..37d2a0a0 100644 --- a/google/cloud/talent_v4beta1/services/completion/async_client.py +++ b/google/cloud/talent_v4beta1/services/completion/async_client.py @@ -271,7 +271,12 @@ def sample_complete_query(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -285,7 +290,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/completion/client.py b/google/cloud/talent_v4beta1/services/completion/client.py index a2c4fa1e..9a5881ae 100644 --- a/google/cloud/talent_v4beta1/services/completion/client.py +++ b/google/cloud/talent_v4beta1/services/completion/client.py @@ -53,7 +53,10 @@ class CompletionClientMeta(type): _transport_registry["grpc"] = CompletionGrpcTransport _transport_registry["grpc_asyncio"] = CompletionGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CompletionTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CompletionTransport]: """Returns an appropriate transport class. Args: @@ -158,10 +161,16 @@ def transport(self) -> CompletionTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -174,7 +183,9 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -187,9 +198,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -198,9 +213,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -209,9 +228,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -220,10 +243,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -463,7 +490,12 @@ def sample_complete_query(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -484,7 +516,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/completion/transports/base.py b/google/cloud/talent_v4beta1/services/completion/transports/base.py index 46de43ce..665d72f4 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/base.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/base.py @@ -29,7 +29,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -141,9 +143,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/cloud/talent_v4beta1/services/completion/transports/grpc.py b/google/cloud/talent_v4beta1/services/completion/transports/grpc.py index f2950446..bb90484a 100644 --- a/google/cloud/talent_v4beta1/services/completion/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/completion/transports/grpc.py @@ -224,8 +224,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 5b4639d3..8b4d8276 100644 --- a/google/cloud/talent_v4beta1/services/event_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/event_service/async_client.py @@ -321,7 +321,12 @@ def sample_create_client_event(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -335,7 +340,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/event_service/client.py b/google/cloud/talent_v4beta1/services/event_service/client.py index fd6ab0d0..184aa5ff 100644 --- a/google/cloud/talent_v4beta1/services/event_service/client.py +++ b/google/cloud/talent_v4beta1/services/event_service/client.py @@ -54,7 +54,10 @@ class EventServiceClientMeta(type): _transport_registry["grpc"] = EventServiceGrpcTransport _transport_registry["grpc_asyncio"] = EventServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[EventServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[EventServiceTransport]: """Returns an appropriate transport class. Args: @@ -159,10 +162,16 @@ def transport(self) -> EventServiceTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -175,7 +184,9 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -188,9 +199,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -199,9 +214,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -210,9 +229,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -221,10 +244,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -520,7 +547,12 @@ def sample_create_client_event(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -541,7 +573,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 1c4f3771..ac91edfd 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/base.py @@ -30,7 +30,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -123,16 +125,18 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_client_event: gapic_v1.method.wrap_method( - self.create_client_event, default_timeout=30.0, client_info=client_info, + self.create_client_event, + default_timeout=30.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 448355ce..50579247 100644 --- a/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/event_service/transports/grpc.py @@ -225,8 +225,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 61f34fe8..6bdd959c 100644 --- a/google/cloud/talent_v4beta1/services/job_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/job_service/async_client.py @@ -316,7 +316,12 @@ def sample_create_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -435,7 +440,12 @@ def sample_batch_create_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -552,7 +562,12 @@ def sample_get_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -651,7 +666,12 @@ def sample_update_job(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -770,7 +790,12 @@ def sample_batch_update_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation_async.from_gapic( @@ -878,7 +903,10 @@ def sample_delete_job(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def batch_delete_jobs( @@ -986,7 +1014,10 @@ def sample_batch_delete_jobs(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_jobs( @@ -1123,12 +1154,20 @@ def sample_list_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListJobsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1207,12 +1246,20 @@ def sample_search_jobs(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchJobsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1297,12 +1344,20 @@ def sample_search_jobs_for_alert(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchJobsForAlertAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1317,7 +1372,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/job_service/client.py b/google/cloud/talent_v4beta1/services/job_service/client.py index 05d48dc1..6f55c031 100644 --- a/google/cloud/talent_v4beta1/services/job_service/client.py +++ b/google/cloud/talent_v4beta1/services/job_service/client.py @@ -59,7 +59,10 @@ class JobServiceClientMeta(type): _transport_registry["grpc"] = JobServiceGrpcTransport _transport_registry["grpc_asyncio"] = JobServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[JobServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[JobServiceTransport]: """Returns an appropriate transport class. Args: @@ -166,10 +169,16 @@ def transport(self) -> JobServiceTransport: return self._transport @staticmethod - def company_path(project: str, tenant: str, company: str,) -> str: + def company_path( + project: str, + tenant: str, + company: str, + ) -> str: """Returns a fully-qualified company string.""" return "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) @staticmethod @@ -182,10 +191,16 @@ def parse_company_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def job_path(project: str, tenant: str, job: str,) -> str: + def job_path( + project: str, + tenant: str, + job: str, + ) -> str: """Returns a fully-qualified job string.""" return "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) @staticmethod @@ -198,7 +213,9 @@ def parse_job_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -211,9 +228,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -222,9 +243,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -233,9 +258,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -244,10 +273,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -531,7 +564,12 @@ def sample_create_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -650,7 +688,12 @@ def sample_batch_create_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -757,7 +800,12 @@ def sample_get_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -856,7 +904,12 @@ def sample_update_job(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -975,7 +1028,12 @@ def sample_batch_update_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Wrap the response in an operation future. response = operation.from_gapic( @@ -1073,7 +1131,10 @@ def sample_delete_job(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def batch_delete_jobs( @@ -1181,7 +1242,10 @@ def sample_batch_delete_jobs(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_jobs( @@ -1308,12 +1372,20 @@ def sample_list_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListJobsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1393,12 +1465,20 @@ def sample_search_jobs(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchJobsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1484,12 +1564,20 @@ def sample_search_jobs_for_alert(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchJobsForAlertPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1511,7 +1599,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 a2139f08..267ed024 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/base.py @@ -34,7 +34,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -127,10 +129,14 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_job: gapic_v1.method.wrap_method( - self.create_job, default_timeout=30.0, client_info=client_info, + self.create_job, + default_timeout=30.0, + client_info=client_info, ), self.batch_create_jobs: gapic_v1.method.wrap_method( - self.batch_create_jobs, default_timeout=30.0, client_info=client_info, + self.batch_create_jobs, + default_timeout=30.0, + client_info=client_info, ), self.get_job: gapic_v1.method.wrap_method( self.get_job, @@ -148,10 +154,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_job: gapic_v1.method.wrap_method( - self.update_job, default_timeout=30.0, client_info=client_info, + self.update_job, + default_timeout=30.0, + client_info=client_info, ), self.batch_update_jobs: gapic_v1.method.wrap_method( - self.batch_update_jobs, default_timeout=30.0, client_info=client_info, + self.batch_update_jobs, + default_timeout=30.0, + client_info=client_info, ), self.delete_job: gapic_v1.method.wrap_method( self.delete_job, @@ -169,7 +179,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.batch_delete_jobs: gapic_v1.method.wrap_method( - self.batch_delete_jobs, default_timeout=30.0, client_info=client_info, + self.batch_delete_jobs, + default_timeout=30.0, + client_info=client_info, ), self.list_jobs: gapic_v1.method.wrap_method( self.list_jobs, @@ -187,7 +199,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.search_jobs: gapic_v1.method.wrap_method( - self.search_jobs, default_timeout=30.0, client_info=client_info, + self.search_jobs, + default_timeout=30.0, + client_info=client_info, ), self.search_jobs_for_alert: gapic_v1.method.wrap_method( self.search_jobs_for_alert, @@ -199,9 +213,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 e6a5a66b..1d0cd3dd 100644 --- a/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py @@ -231,8 +231,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 13d24a26..171dd0e4 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/profile_service/async_client.py @@ -313,12 +313,20 @@ def sample_list_profiles(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListProfilesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -422,7 +430,12 @@ def sample_create_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -526,7 +539,12 @@ def sample_get_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -618,7 +636,12 @@ def sample_update_profile(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -715,7 +738,10 @@ def sample_delete_profile(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def search_profiles( @@ -793,12 +819,20 @@ def sample_search_profiles(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.SearchProfilesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -813,7 +847,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/profile_service/client.py b/google/cloud/talent_v4beta1/services/profile_service/client.py index 0d60172f..b69f6cd3 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/client.py +++ b/google/cloud/talent_v4beta1/services/profile_service/client.py @@ -61,7 +61,10 @@ class ProfileServiceClientMeta(type): _transport_registry["grpc"] = ProfileServiceGrpcTransport _transport_registry["grpc_asyncio"] = ProfileServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[ProfileServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[ProfileServiceTransport]: """Returns an appropriate transport class. Args: @@ -168,10 +171,16 @@ def transport(self) -> ProfileServiceTransport: return self._transport @staticmethod - def profile_path(project: str, tenant: str, profile: str,) -> str: + def profile_path( + project: str, + tenant: str, + profile: str, + ) -> str: """Returns a fully-qualified profile string.""" return "projects/{project}/tenants/{tenant}/profiles/{profile}".format( - project=project, tenant=tenant, profile=profile, + project=project, + tenant=tenant, + profile=profile, ) @staticmethod @@ -184,10 +193,14 @@ def parse_profile_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -197,7 +210,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -210,9 +225,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -221,9 +240,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -232,9 +255,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -243,10 +270,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -511,12 +542,20 @@ def sample_list_profiles(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListProfilesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -620,7 +659,12 @@ def sample_create_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -714,7 +758,12 @@ def sample_get_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -806,7 +855,12 @@ def sample_update_profile(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -893,7 +947,10 @@ def sample_delete_profile(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def search_profiles( @@ -972,12 +1029,20 @@ def sample_search_profiles(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.SearchProfilesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -999,7 +1064,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 89340978..87ac0042 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -140,7 +142,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_profile: gapic_v1.method.wrap_method( - self.create_profile, default_timeout=30.0, client_info=client_info, + self.create_profile, + default_timeout=30.0, + client_info=client_info, ), self.get_profile: gapic_v1.method.wrap_method( self.get_profile, @@ -158,7 +162,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_profile: gapic_v1.method.wrap_method( - self.update_profile, default_timeout=30.0, client_info=client_info, + self.update_profile, + default_timeout=30.0, + client_info=client_info, ), self.delete_profile: gapic_v1.method.wrap_method( self.delete_profile, @@ -176,16 +182,18 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.search_profiles: gapic_v1.method.wrap_method( - self.search_profiles, default_timeout=30.0, client_info=client_info, + self.search_profiles, + default_timeout=30.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 cf0676a2..589439c0 100644 --- a/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/profile_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property 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 1c20bad0..5c98059d 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/async_client.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/async_client.py @@ -311,7 +311,12 @@ def sample_create_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -420,7 +425,12 @@ def sample_get_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -521,7 +531,12 @@ def sample_update_tenant(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -615,7 +630,10 @@ def sample_delete_tenant(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_tenants( @@ -719,12 +737,20 @@ def sample_list_tenants(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTenantsAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -739,7 +765,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/talent_v4beta1/services/tenant_service/client.py b/google/cloud/talent_v4beta1/services/tenant_service/client.py index 5fe9f198..35e6bc5b 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/client.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/client.py @@ -55,7 +55,10 @@ class TenantServiceClientMeta(type): _transport_registry["grpc"] = TenantServiceGrpcTransport _transport_registry["grpc_asyncio"] = TenantServiceGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[TenantServiceTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[TenantServiceTransport]: """Returns an appropriate transport class. Args: @@ -162,10 +165,14 @@ def transport(self) -> TenantServiceTransport: return self._transport @staticmethod - def tenant_path(project: str, tenant: str,) -> str: + def tenant_path( + project: str, + tenant: str, + ) -> str: """Returns a fully-qualified tenant string.""" return "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) @staticmethod @@ -175,7 +182,9 @@ def parse_tenant_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -188,9 +197,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -199,9 +212,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -210,9 +227,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -221,10 +242,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -503,7 +528,12 @@ def sample_create_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -602,7 +632,12 @@ def sample_get_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -703,7 +738,12 @@ def sample_update_tenant(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -787,7 +827,10 @@ def sample_delete_tenant(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_tenants( @@ -881,12 +924,20 @@ def sample_list_tenants(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTenantsPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -908,7 +959,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() 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 8d9a8b5f..3d9b7105 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/base.py @@ -32,7 +32,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-talent", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -125,7 +127,9 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.create_tenant: gapic_v1.method.wrap_method( - self.create_tenant, default_timeout=30.0, client_info=client_info, + self.create_tenant, + default_timeout=30.0, + client_info=client_info, ), self.get_tenant: gapic_v1.method.wrap_method( self.get_tenant, @@ -143,7 +147,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_tenant: gapic_v1.method.wrap_method( - self.update_tenant, default_timeout=30.0, client_info=client_info, + self.update_tenant, + default_timeout=30.0, + client_info=client_info, ), self.delete_tenant: gapic_v1.method.wrap_method( self.delete_tenant, @@ -180,9 +186,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 3d3912cb..af8b2bc7 100644 --- a/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py +++ b/google/cloud/talent_v4beta1/services/tenant_service/transports/grpc.py @@ -228,8 +228,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/talent_v4beta1/types/application.py b/google/cloud/talent_v4beta1/types/application.py index f160dce9..fcf38e19 100644 --- a/google/cloud/talent_v4beta1/types/application.py +++ b/google/cloud/talent_v4beta1/types/application.py @@ -22,7 +22,10 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4beta1", manifest={"Application",}, + package="google.cloud.talent.v4beta1", + manifest={ + "Application", + }, ) @@ -131,28 +134,79 @@ class ApplicationStage(proto.Enum): OFFER_ACCEPTED = 6 STARTED = 7 - name = proto.Field(proto.STRING, number=1,) - external_id = proto.Field(proto.STRING, number=31,) - profile = proto.Field(proto.STRING, number=2,) - job = proto.Field(proto.STRING, number=4,) - company = proto.Field(proto.STRING, number=5,) - application_date = proto.Field(proto.MESSAGE, number=7, message=date_pb2.Date,) - stage = proto.Field(proto.ENUM, number=11, enum=ApplicationStage,) - state = proto.Field(proto.ENUM, number=13, enum=ApplicationState,) + name = proto.Field( + proto.STRING, + number=1, + ) + external_id = proto.Field( + proto.STRING, + number=31, + ) + profile = proto.Field( + proto.STRING, + number=2, + ) + job = proto.Field( + proto.STRING, + number=4, + ) + company = proto.Field( + proto.STRING, + number=5, + ) + application_date = proto.Field( + proto.MESSAGE, + number=7, + message=date_pb2.Date, + ) + stage = proto.Field( + proto.ENUM, + number=11, + enum=ApplicationStage, + ) + state = proto.Field( + proto.ENUM, + number=13, + enum=ApplicationState, + ) interviews = proto.RepeatedField( - proto.MESSAGE, number=16, message=common.Interview, + proto.MESSAGE, + number=16, + message=common.Interview, + ) + referral = proto.Field( + proto.MESSAGE, + number=18, + message=wrappers_pb2.BoolValue, ) - referral = proto.Field(proto.MESSAGE, number=18, message=wrappers_pb2.BoolValue,) create_time = proto.Field( - proto.MESSAGE, number=19, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=19, + message=timestamp_pb2.Timestamp, ) update_time = proto.Field( - proto.MESSAGE, number=20, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=20, + message=timestamp_pb2.Timestamp, + ) + outcome_notes = proto.Field( + proto.STRING, + number=21, + ) + outcome = proto.Field( + proto.ENUM, + number=22, + enum=common.Outcome, + ) + is_match = proto.Field( + proto.MESSAGE, + number=28, + message=wrappers_pb2.BoolValue, + ) + job_title_snippet = proto.Field( + proto.STRING, + number=29, ) - outcome_notes = proto.Field(proto.STRING, number=21,) - outcome = proto.Field(proto.ENUM, number=22, enum=common.Outcome,) - is_match = proto.Field(proto.MESSAGE, number=28, message=wrappers_pb2.BoolValue,) - job_title_snippet = proto.Field(proto.STRING, number=29,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/application_service.py b/google/cloud/talent_v4beta1/types/application_service.py index aa25c642..6847c428 100644 --- a/google/cloud/talent_v4beta1/types/application_service.py +++ b/google/cloud/talent_v4beta1/types/application_service.py @@ -48,9 +48,14 @@ class CreateApplicationRequest(proto.Message): Required. The application to be created. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) application = proto.Field( - proto.MESSAGE, number=2, message=gct_application.Application, + proto.MESSAGE, + number=2, + message=gct_application.Application, ) @@ -68,7 +73,10 @@ class GetApplicationRequest(proto.Message): "projects/foo/tenants/bar/profiles/baz/applications/qux". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateApplicationRequest(proto.Message): @@ -94,10 +102,14 @@ class UpdateApplicationRequest(proto.Message): """ application = proto.Field( - proto.MESSAGE, number=1, message=gct_application.Application, + proto.MESSAGE, + number=1, + message=gct_application.Application, ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -115,7 +127,10 @@ class DeleteApplicationRequest(proto.Message): "projects/foo/tenants/bar/profiles/baz/applications/qux". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListApplicationsRequest(proto.Message): @@ -138,9 +153,18 @@ class ListApplicationsRequest(proto.Message): non-positive number is provided. """ - parent = proto.Field(proto.STRING, number=1,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) class ListApplicationsResponse(proto.Message): @@ -161,10 +185,19 @@ def raw_page(self): return self applications = proto.RepeatedField( - proto.MESSAGE, number=1, message=gct_application.Application, + proto.MESSAGE, + number=1, + message=gct_application.Application, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, ) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/batch.py b/google/cloud/talent_v4beta1/types/batch.py index 612c42a3..ba987e4d 100644 --- a/google/cloud/talent_v4beta1/types/batch.py +++ b/google/cloud/talent_v4beta1/types/batch.py @@ -15,7 +15,10 @@ # -__protobuf__ = proto.module(package="google.cloud.talent.v4beta1", manifest={},) +__protobuf__ = proto.module( + package="google.cloud.talent.v4beta1", + manifest={}, +) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/common.py b/google/cloud/talent_v4beta1/types/common.py index 6e4269b4..24991d6a 100644 --- a/google/cloud/talent_v4beta1/types/common.py +++ b/google/cloud/talent_v4beta1/types/common.py @@ -258,8 +258,16 @@ class TimestampRange(proto.Message): End of the period (exclusive). """ - start_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) + start_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) class Location(proto.Message): @@ -307,12 +315,25 @@ class LocationType(proto.Enum): NEIGHBORHOOD = 9 STREET_ADDRESS = 10 - location_type = proto.Field(proto.ENUM, number=1, enum=LocationType,) + location_type = proto.Field( + proto.ENUM, + number=1, + enum=LocationType, + ) postal_address = proto.Field( - proto.MESSAGE, number=2, message=postal_address_pb2.PostalAddress, + proto.MESSAGE, + number=2, + message=postal_address_pb2.PostalAddress, + ) + lat_lng = proto.Field( + proto.MESSAGE, + number=3, + message=latlng_pb2.LatLng, + ) + radius_miles = proto.Field( + proto.DOUBLE, + number=4, ) - lat_lng = proto.Field(proto.MESSAGE, number=3, message=latlng_pb2.LatLng,) - radius_miles = proto.Field(proto.DOUBLE, number=4,) class RequestMetadata(proto.Message): @@ -389,11 +410,27 @@ class RequestMetadata(proto.Message): the time of the call to the service. """ - domain = proto.Field(proto.STRING, number=1,) - session_id = proto.Field(proto.STRING, number=2,) - user_id = proto.Field(proto.STRING, number=3,) - allow_missing_ids = proto.Field(proto.BOOL, number=4,) - device_info = proto.Field(proto.MESSAGE, number=5, message="DeviceInfo",) + domain = proto.Field( + proto.STRING, + number=1, + ) + session_id = proto.Field( + proto.STRING, + number=2, + ) + user_id = proto.Field( + proto.STRING, + number=3, + ) + allow_missing_ids = proto.Field( + proto.BOOL, + number=4, + ) + device_info = proto.Field( + proto.MESSAGE, + number=5, + message="DeviceInfo", + ) class ResponseMetadata(proto.Message): @@ -406,7 +443,10 @@ class ResponseMetadata(proto.Message): This id is logged for tracking purposes. """ - request_id = proto.Field(proto.STRING, number=1,) + request_id = proto.Field( + proto.STRING, + number=1, + ) class DeviceInfo(proto.Message): @@ -436,8 +476,15 @@ class DeviceType(proto.Enum): BOT = 5 OTHER = 6 - device_type = proto.Field(proto.ENUM, number=1, enum=DeviceType,) - id = proto.Field(proto.STRING, number=2,) + device_type = proto.Field( + proto.ENUM, + number=1, + enum=DeviceType, + ) + id = proto.Field( + proto.STRING, + number=2, + ) class CustomAttribute(proto.Message): @@ -482,9 +529,18 @@ class CustomAttribute(proto.Message): Default is false. """ - string_values = proto.RepeatedField(proto.STRING, number=1,) - long_values = proto.RepeatedField(proto.INT64, number=2,) - filterable = proto.Field(proto.BOOL, number=3,) + string_values = proto.RepeatedField( + proto.STRING, + number=1, + ) + long_values = proto.RepeatedField( + proto.INT64, + number=2, + ) + filterable = proto.Field( + proto.BOOL, + number=3, + ) class SpellingCorrection(proto.Message): @@ -508,9 +564,18 @@ class SpellingCorrection(proto.Message): "software engineer". """ - corrected = proto.Field(proto.BOOL, number=1,) - corrected_text = proto.Field(proto.STRING, number=2,) - corrected_html = proto.Field(proto.STRING, number=3,) + corrected = proto.Field( + proto.BOOL, + number=1, + ) + corrected_text = proto.Field( + proto.STRING, + number=2, + ) + corrected_html = proto.Field( + proto.STRING, + number=3, + ) class CompensationInfo(proto.Message): @@ -661,10 +726,14 @@ class CompensationEntry(proto.Message): """ type_ = proto.Field( - proto.ENUM, number=1, enum="CompensationInfo.CompensationType", + proto.ENUM, + number=1, + enum="CompensationInfo.CompensationType", ) unit = proto.Field( - proto.ENUM, number=2, enum="CompensationInfo.CompensationUnit", + proto.ENUM, + number=2, + enum="CompensationInfo.CompensationUnit", ) amount = proto.Field( proto.MESSAGE, @@ -678,9 +747,14 @@ class CompensationEntry(proto.Message): oneof="compensation_amount", message="CompensationInfo.CompensationRange", ) - description = proto.Field(proto.STRING, number=5,) + description = proto.Field( + proto.STRING, + number=5, + ) expected_units_per_year = proto.Field( - proto.MESSAGE, number=6, message=wrappers_pb2.DoubleValue, + proto.MESSAGE, + number=6, + message=wrappers_pb2.DoubleValue, ) class CompensationRange(proto.Message): @@ -700,18 +774,30 @@ class CompensationRange(proto.Message): """ max_compensation = proto.Field( - proto.MESSAGE, number=2, message=money_pb2.Money, + proto.MESSAGE, + number=2, + message=money_pb2.Money, ) min_compensation = proto.Field( - proto.MESSAGE, number=1, message=money_pb2.Money, + proto.MESSAGE, + number=1, + message=money_pb2.Money, ) - entries = proto.RepeatedField(proto.MESSAGE, number=1, message=CompensationEntry,) + entries = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=CompensationEntry, + ) annualized_base_compensation_range = proto.Field( - proto.MESSAGE, number=2, message=CompensationRange, + proto.MESSAGE, + number=2, + message=CompensationRange, ) annualized_total_compensation_range = proto.Field( - proto.MESSAGE, number=3, message=CompensationRange, + proto.MESSAGE, + number=3, + message=CompensationRange, ) @@ -735,11 +821,28 @@ class Certification(proto.Message): Number of characters allowed is 100,000. """ - display_name = proto.Field(proto.STRING, number=1,) - acquire_date = proto.Field(proto.MESSAGE, number=2, message=date_pb2.Date,) - expire_date = proto.Field(proto.MESSAGE, number=3, message=date_pb2.Date,) - authority = proto.Field(proto.STRING, number=4,) - description = proto.Field(proto.STRING, number=5,) + display_name = proto.Field( + proto.STRING, + number=1, + ) + acquire_date = proto.Field( + proto.MESSAGE, + number=2, + message=date_pb2.Date, + ) + expire_date = proto.Field( + proto.MESSAGE, + number=3, + message=date_pb2.Date, + ) + authority = proto.Field( + proto.STRING, + number=4, + ) + description = proto.Field( + proto.STRING, + number=5, + ) class Skill(proto.Message): @@ -767,11 +870,28 @@ class Skill(proto.Message): isn't related to the search query. """ - display_name = proto.Field(proto.STRING, number=1,) - last_used_date = proto.Field(proto.MESSAGE, number=2, message=date_pb2.Date,) - level = proto.Field(proto.ENUM, number=3, enum="SkillProficiencyLevel",) - context = proto.Field(proto.STRING, number=4,) - skill_name_snippet = proto.Field(proto.STRING, number=5,) + display_name = proto.Field( + proto.STRING, + number=1, + ) + last_used_date = proto.Field( + proto.MESSAGE, + number=2, + message=date_pb2.Date, + ) + level = proto.Field( + proto.ENUM, + number=3, + enum="SkillProficiencyLevel", + ) + context = proto.Field( + proto.STRING, + number=4, + ) + skill_name_snippet = proto.Field( + proto.STRING, + number=5, + ) class Interview(proto.Message): @@ -785,8 +905,16 @@ class Interview(proto.Message): this interview (positive, negative, nuetral). """ - rating = proto.Field(proto.MESSAGE, number=6, message="Rating",) - outcome = proto.Field(proto.ENUM, number=7, enum="Outcome",) + rating = proto.Field( + proto.MESSAGE, + number=6, + message="Rating", + ) + outcome = proto.Field( + proto.ENUM, + number=7, + enum="Outcome", + ) class Rating(proto.Message): @@ -806,10 +934,22 @@ class Rating(proto.Message): score can be 1, 2, 3, 4, or 5) """ - overall = proto.Field(proto.DOUBLE, number=1,) - min_ = proto.Field(proto.DOUBLE, number=2,) - max_ = proto.Field(proto.DOUBLE, number=3,) - interval = proto.Field(proto.DOUBLE, number=4,) + overall = proto.Field( + proto.DOUBLE, + number=1, + ) + min_ = proto.Field( + proto.DOUBLE, + number=2, + ) + max_ = proto.Field( + proto.DOUBLE, + number=3, + ) + interval = proto.Field( + proto.DOUBLE, + number=4, + ) class BatchOperationMetadata(proto.Message): @@ -853,14 +993,42 @@ class State(proto.Enum): CANCELLING = 5 CANCELLED = 6 - state = proto.Field(proto.ENUM, number=1, enum=State,) - state_description = proto.Field(proto.STRING, number=2,) - success_count = proto.Field(proto.INT32, number=3,) - failure_count = proto.Field(proto.INT32, number=4,) - total_count = proto.Field(proto.INT32, number=5,) - create_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) + state = proto.Field( + proto.ENUM, + number=1, + enum=State, + ) + state_description = proto.Field( + proto.STRING, + number=2, + ) + success_count = proto.Field( + proto.INT32, + number=3, + ) + failure_count = proto.Field( + proto.INT32, + number=4, + ) + total_count = proto.Field( + proto.INT32, + number=5, + ) + create_time = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/company.py b/google/cloud/talent_v4beta1/types/company.py index 3873ca6a..f70bafec 100644 --- a/google/cloud/talent_v4beta1/types/company.py +++ b/google/cloud/talent_v4beta1/types/company.py @@ -19,7 +19,10 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4beta1", manifest={"Company",}, + package="google.cloud.talent.v4beta1", + manifest={ + "Company", + }, ) @@ -111,24 +114,65 @@ class DerivedInfo(proto.Message): """ headquarters_location = proto.Field( - proto.MESSAGE, number=1, message=common.Location, + proto.MESSAGE, + number=1, + message=common.Location, ) - name = proto.Field(proto.STRING, number=1,) - display_name = proto.Field(proto.STRING, number=2,) - external_id = proto.Field(proto.STRING, number=3,) - size = proto.Field(proto.ENUM, number=4, enum=common.CompanySize,) - headquarters_address = proto.Field(proto.STRING, number=5,) - hiring_agency = proto.Field(proto.BOOL, number=6,) - eeo_text = proto.Field(proto.STRING, number=7,) - website_uri = proto.Field(proto.STRING, number=8,) - career_site_uri = proto.Field(proto.STRING, number=9,) - image_uri = proto.Field(proto.STRING, number=10,) + name = proto.Field( + proto.STRING, + number=1, + ) + display_name = proto.Field( + proto.STRING, + number=2, + ) + external_id = proto.Field( + proto.STRING, + number=3, + ) + size = proto.Field( + proto.ENUM, + number=4, + enum=common.CompanySize, + ) + headquarters_address = proto.Field( + proto.STRING, + number=5, + ) + hiring_agency = proto.Field( + proto.BOOL, + number=6, + ) + eeo_text = proto.Field( + proto.STRING, + number=7, + ) + website_uri = proto.Field( + proto.STRING, + number=8, + ) + career_site_uri = proto.Field( + proto.STRING, + number=9, + ) + image_uri = proto.Field( + proto.STRING, + number=10, + ) keyword_searchable_job_custom_attributes = proto.RepeatedField( - proto.STRING, number=11, + proto.STRING, + number=11, + ) + derived_info = proto.Field( + proto.MESSAGE, + number=12, + message=DerivedInfo, + ) + suspended = proto.Field( + proto.BOOL, + number=13, ) - derived_info = proto.Field(proto.MESSAGE, number=12, message=DerivedInfo,) - suspended = proto.Field(proto.BOOL, number=13,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/company_service.py b/google/cloud/talent_v4beta1/types/company_service.py index e13997b4..712e954d 100644 --- a/google/cloud/talent_v4beta1/types/company_service.py +++ b/google/cloud/talent_v4beta1/types/company_service.py @@ -49,8 +49,15 @@ class CreateCompanyRequest(proto.Message): Required. The company to be created. """ - parent = proto.Field(proto.STRING, number=1,) - company = proto.Field(proto.MESSAGE, number=2, message=gct_company.Company,) + parent = proto.Field( + proto.STRING, + number=1, + ) + company = proto.Field( + proto.MESSAGE, + number=2, + message=gct_company.Company, + ) class GetCompanyRequest(proto.Message): @@ -69,7 +76,10 @@ class GetCompanyRequest(proto.Message): example, "projects/api-test-project/companies/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateCompanyRequest(proto.Message): @@ -94,9 +104,15 @@ class UpdateCompanyRequest(proto.Message): supported. """ - company = proto.Field(proto.MESSAGE, number=1, message=gct_company.Company,) + company = proto.Field( + proto.MESSAGE, + number=1, + message=gct_company.Company, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -115,7 +131,10 @@ class DeleteCompanyRequest(proto.Message): example, "projects/foo/companies/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListCompaniesRequest(proto.Message): @@ -149,10 +168,22 @@ class ListCompaniesRequest(proto.Message): jobs are returned. """ - parent = proto.Field(proto.STRING, number=1,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - require_open_jobs = proto.Field(proto.BOOL, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + require_open_jobs = proto.Field( + proto.BOOL, + number=4, + ) class ListCompaniesResponse(proto.Message): @@ -173,10 +204,19 @@ def raw_page(self): return self companies = proto.RepeatedField( - proto.MESSAGE, number=1, message=gct_company.Company, + proto.MESSAGE, + number=1, + message=gct_company.Company, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, ) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/completion_service.py b/google/cloud/talent_v4beta1/types/completion_service.py index 79baeaec..3c9db65e 100644 --- a/google/cloud/talent_v4beta1/types/completion_service.py +++ b/google/cloud/talent_v4beta1/types/completion_service.py @@ -20,7 +20,10 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", - manifest={"CompleteQueryRequest", "CompleteQueryResponse",}, + manifest={ + "CompleteQueryRequest", + "CompleteQueryResponse", + }, ) @@ -81,13 +84,36 @@ class CompletionType(proto.Enum): COMPANY_NAME = 2 COMBINED = 3 - parent = proto.Field(proto.STRING, number=1,) - query = proto.Field(proto.STRING, number=2,) - language_codes = proto.RepeatedField(proto.STRING, number=3,) - page_size = proto.Field(proto.INT32, number=4,) - company = proto.Field(proto.STRING, number=5,) - scope = proto.Field(proto.ENUM, number=6, enum=CompletionScope,) - type_ = proto.Field(proto.ENUM, number=7, enum=CompletionType,) + parent = proto.Field( + proto.STRING, + number=1, + ) + query = proto.Field( + proto.STRING, + number=2, + ) + language_codes = proto.RepeatedField( + proto.STRING, + number=3, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + company = proto.Field( + proto.STRING, + number=5, + ) + scope = proto.Field( + proto.ENUM, + number=6, + enum=CompletionScope, + ) + type_ = proto.Field( + proto.ENUM, + number=7, + enum=CompletionType, + ) class CompleteQueryResponse(proto.Message): @@ -115,16 +141,30 @@ class CompletionResult(proto.Message): [COMPANY_NAME][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY_NAME]. """ - suggestion = proto.Field(proto.STRING, number=1,) + suggestion = proto.Field( + proto.STRING, + number=1, + ) type_ = proto.Field( - proto.ENUM, number=2, enum="CompleteQueryRequest.CompletionType", + proto.ENUM, + number=2, + enum="CompleteQueryRequest.CompletionType", + ) + image_uri = proto.Field( + proto.STRING, + number=3, ) - image_uri = proto.Field(proto.STRING, number=3,) completion_results = proto.RepeatedField( - proto.MESSAGE, number=1, message=CompletionResult, + proto.MESSAGE, + number=1, + message=CompletionResult, + ) + metadata = proto.Field( + proto.MESSAGE, + number=2, + message=common.ResponseMetadata, ) - metadata = proto.Field(proto.MESSAGE, number=2, message=common.ResponseMetadata,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/event.py b/google/cloud/talent_v4beta1/types/event.py index 8d08f66b..2809cdd4 100644 --- a/google/cloud/talent_v4beta1/types/event.py +++ b/google/cloud/talent_v4beta1/types/event.py @@ -20,7 +20,11 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", - manifest={"ClientEvent", "JobEvent", "ProfileEvent",}, + manifest={ + "ClientEvent", + "JobEvent", + "ProfileEvent", + }, ) @@ -69,14 +73,35 @@ class ClientEvent(proto.Message): profile was bookmarked. """ - request_id = proto.Field(proto.STRING, number=1,) - event_id = proto.Field(proto.STRING, number=2,) - create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) - job_event = proto.Field(proto.MESSAGE, number=5, oneof="event", message="JobEvent",) + request_id = proto.Field( + proto.STRING, + number=1, + ) + event_id = proto.Field( + proto.STRING, + number=2, + ) + create_time = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + job_event = proto.Field( + proto.MESSAGE, + number=5, + oneof="event", + message="JobEvent", + ) profile_event = proto.Field( - proto.MESSAGE, number=6, oneof="event", message="ProfileEvent", + proto.MESSAGE, + number=6, + oneof="event", + message="ProfileEvent", + ) + event_notes = proto.Field( + proto.STRING, + number=9, ) - event_notes = proto.Field(proto.STRING, number=9,) class JobEvent(proto.Message): @@ -130,9 +155,19 @@ class JobEventType(proto.Enum): SENT_CV = 14 INTERVIEW_GRANTED = 15 - type_ = proto.Field(proto.ENUM, number=1, enum=JobEventType,) - jobs = proto.RepeatedField(proto.STRING, number=2,) - profile = proto.Field(proto.STRING, number=3,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=JobEventType, + ) + jobs = proto.RepeatedField( + proto.STRING, + number=2, + ) + profile = proto.Field( + proto.STRING, + number=3, + ) class ProfileEvent(proto.Message): @@ -169,9 +204,19 @@ class ProfileEventType(proto.Enum): VIEW = 2 BOOKMARK = 3 - type_ = proto.Field(proto.ENUM, number=1, enum=ProfileEventType,) - profiles = proto.RepeatedField(proto.STRING, number=2,) - jobs = proto.RepeatedField(proto.STRING, number=6,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=ProfileEventType, + ) + profiles = proto.RepeatedField( + proto.STRING, + number=2, + ) + jobs = proto.RepeatedField( + proto.STRING, + number=6, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/event_service.py b/google/cloud/talent_v4beta1/types/event_service.py index a83b670d..5f3b9fb2 100644 --- a/google/cloud/talent_v4beta1/types/event_service.py +++ b/google/cloud/talent_v4beta1/types/event_service.py @@ -19,7 +19,10 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4beta1", manifest={"CreateClientEventRequest",}, + package="google.cloud.talent.v4beta1", + manifest={ + "CreateClientEventRequest", + }, ) @@ -41,8 +44,15 @@ class CreateClientEventRequest(proto.Message): Cloud Talent Solution. """ - parent = proto.Field(proto.STRING, number=1,) - client_event = proto.Field(proto.MESSAGE, number=2, message=event.ClientEvent,) + parent = proto.Field( + proto.STRING, + number=1, + ) + client_event = proto.Field( + proto.MESSAGE, + number=2, + message=event.ClientEvent, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/filters.py b/google/cloud/talent_v4beta1/types/filters.py index 88a9f965..edaac781 100644 --- a/google/cloud/talent_v4beta1/types/filters.py +++ b/google/cloud/talent_v4beta1/types/filters.py @@ -211,28 +211,68 @@ class JobQuery(proto.Message): At most 400 excluded job names are allowed. """ - query = proto.Field(proto.STRING, number=1,) - query_language_code = proto.Field(proto.STRING, number=14,) - companies = proto.RepeatedField(proto.STRING, number=2,) + query = proto.Field( + proto.STRING, + number=1, + ) + query_language_code = proto.Field( + proto.STRING, + number=14, + ) + companies = proto.RepeatedField( + proto.STRING, + number=2, + ) location_filters = proto.RepeatedField( - proto.MESSAGE, number=3, message="LocationFilter", + proto.MESSAGE, + number=3, + message="LocationFilter", + ) + job_categories = proto.RepeatedField( + proto.ENUM, + number=4, + enum=common.JobCategory, + ) + commute_filter = proto.Field( + proto.MESSAGE, + number=5, + message="CommuteFilter", + ) + company_display_names = proto.RepeatedField( + proto.STRING, + number=6, ) - job_categories = proto.RepeatedField(proto.ENUM, number=4, enum=common.JobCategory,) - commute_filter = proto.Field(proto.MESSAGE, number=5, message="CommuteFilter",) - company_display_names = proto.RepeatedField(proto.STRING, number=6,) compensation_filter = proto.Field( - proto.MESSAGE, number=7, message="CompensationFilter", + proto.MESSAGE, + number=7, + message="CompensationFilter", + ) + custom_attribute_filter = proto.Field( + proto.STRING, + number=8, + ) + disable_spell_check = proto.Field( + proto.BOOL, + number=9, ) - custom_attribute_filter = proto.Field(proto.STRING, number=8,) - disable_spell_check = proto.Field(proto.BOOL, number=9,) employment_types = proto.RepeatedField( - proto.ENUM, number=10, enum=common.EmploymentType, + proto.ENUM, + number=10, + enum=common.EmploymentType, + ) + language_codes = proto.RepeatedField( + proto.STRING, + number=11, ) - language_codes = proto.RepeatedField(proto.STRING, number=11,) publish_time_range = proto.Field( - proto.MESSAGE, number=12, message=common.TimestampRange, + proto.MESSAGE, + number=12, + message=common.TimestampRange, + ) + excluded_jobs = proto.RepeatedField( + proto.STRING, + number=13, ) - excluded_jobs = proto.RepeatedField(proto.STRING, number=13,) class ProfileQuery(proto.Message): @@ -543,45 +583,83 @@ class ProfileQuery(proto.Message): with name "John Smith". """ - query = proto.Field(proto.STRING, number=1,) + query = proto.Field( + proto.STRING, + number=1, + ) location_filters = proto.RepeatedField( - proto.MESSAGE, number=2, message="LocationFilter", + proto.MESSAGE, + number=2, + message="LocationFilter", ) job_title_filters = proto.RepeatedField( - proto.MESSAGE, number=3, message="JobTitleFilter", + proto.MESSAGE, + number=3, + message="JobTitleFilter", ) employer_filters = proto.RepeatedField( - proto.MESSAGE, number=4, message="EmployerFilter", + proto.MESSAGE, + number=4, + message="EmployerFilter", ) education_filters = proto.RepeatedField( - proto.MESSAGE, number=5, message="EducationFilter", + proto.MESSAGE, + number=5, + message="EducationFilter", + ) + skill_filters = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="SkillFilter", ) - skill_filters = proto.RepeatedField(proto.MESSAGE, number=6, message="SkillFilter",) work_experience_filter = proto.RepeatedField( - proto.MESSAGE, number=7, message="WorkExperienceFilter", + proto.MESSAGE, + number=7, + message="WorkExperienceFilter", + ) + time_filters = proto.RepeatedField( + proto.MESSAGE, + number=8, + message="TimeFilter", ) - time_filters = proto.RepeatedField(proto.MESSAGE, number=8, message="TimeFilter",) hirable_filter = proto.Field( - proto.MESSAGE, number=9, message=wrappers_pb2.BoolValue, + proto.MESSAGE, + number=9, + message=wrappers_pb2.BoolValue, ) application_date_filters = proto.RepeatedField( - proto.MESSAGE, number=10, message="ApplicationDateFilter", + proto.MESSAGE, + number=10, + message="ApplicationDateFilter", ) application_outcome_notes_filters = proto.RepeatedField( - proto.MESSAGE, number=11, message="ApplicationOutcomeNotesFilter", + proto.MESSAGE, + number=11, + message="ApplicationOutcomeNotesFilter", ) application_job_filters = proto.RepeatedField( - proto.MESSAGE, number=13, message="ApplicationJobFilter", + proto.MESSAGE, + number=13, + message="ApplicationJobFilter", + ) + custom_attribute_filter = proto.Field( + proto.STRING, + number=15, ) - custom_attribute_filter = proto.Field(proto.STRING, number=15,) candidate_availability_filter = proto.Field( - proto.MESSAGE, number=16, message="CandidateAvailabilityFilter", + proto.MESSAGE, + number=16, + message="CandidateAvailabilityFilter", ) availability_filters = proto.RepeatedField( - proto.MESSAGE, number=18, message="AvailabilityFilter", + proto.MESSAGE, + number=18, + message="AvailabilityFilter", ) person_name_filters = proto.RepeatedField( - proto.MESSAGE, number=17, message="PersonNameFilter", + proto.MESSAGE, + number=17, + message="PersonNameFilter", ) @@ -653,14 +731,32 @@ class TelecommutePreference(proto.Enum): TELECOMMUTE_EXCLUDED = 1 TELECOMMUTE_ALLOWED = 2 - address = proto.Field(proto.STRING, number=1,) - region_code = proto.Field(proto.STRING, number=2,) - lat_lng = proto.Field(proto.MESSAGE, number=3, message=latlng_pb2.LatLng,) - distance_in_miles = proto.Field(proto.DOUBLE, number=4,) + address = proto.Field( + proto.STRING, + number=1, + ) + region_code = proto.Field( + proto.STRING, + number=2, + ) + lat_lng = proto.Field( + proto.MESSAGE, + number=3, + message=latlng_pb2.LatLng, + ) + distance_in_miles = proto.Field( + proto.DOUBLE, + number=4, + ) telecommute_preference = proto.Field( - proto.ENUM, number=5, enum=TelecommutePreference, + proto.ENUM, + number=5, + enum=TelecommutePreference, + ) + negated = proto.Field( + proto.BOOL, + number=6, ) - negated = proto.Field(proto.BOOL, number=6,) class CompensationFilter(proto.Message): @@ -687,15 +783,24 @@ class FilterType(proto.Enum): ANNUALIZED_BASE_AMOUNT = 3 ANNUALIZED_TOTAL_AMOUNT = 4 - type_ = proto.Field(proto.ENUM, number=1, enum=FilterType,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=FilterType, + ) units = proto.RepeatedField( - proto.ENUM, number=2, enum=common.CompensationInfo.CompensationUnit, + proto.ENUM, + number=2, + enum=common.CompensationInfo.CompensationUnit, ) range_ = proto.Field( - proto.MESSAGE, number=3, message=common.CompensationInfo.CompensationRange, + proto.MESSAGE, + number=3, + message=common.CompensationInfo.CompensationRange, ) include_jobs_with_unspecified_compensation_range = proto.Field( - proto.BOOL, number=4, + proto.BOOL, + number=4, ) @@ -749,14 +854,30 @@ class RoadTraffic(proto.Enum): TRAFFIC_FREE = 1 BUSY_HOUR = 2 - commute_method = proto.Field(proto.ENUM, number=1, enum=common.CommuteMethod,) - start_coordinates = proto.Field(proto.MESSAGE, number=2, message=latlng_pb2.LatLng,) + commute_method = proto.Field( + proto.ENUM, + number=1, + enum=common.CommuteMethod, + ) + start_coordinates = proto.Field( + proto.MESSAGE, + number=2, + message=latlng_pb2.LatLng, + ) travel_duration = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + allow_imprecise_addresses = proto.Field( + proto.BOOL, + number=4, ) - allow_imprecise_addresses = proto.Field(proto.BOOL, number=4,) road_traffic = proto.Field( - proto.ENUM, number=5, oneof="traffic_option", enum=RoadTraffic, + proto.ENUM, + number=5, + oneof="traffic_option", + enum=RoadTraffic, ) departure_time = proto.Field( proto.MESSAGE, @@ -778,8 +899,14 @@ class JobTitleFilter(proto.Message): profiles matching the filter are excluded. """ - job_title = proto.Field(proto.STRING, number=1,) - negated = proto.Field(proto.BOOL, number=2,) + job_title = proto.Field( + proto.STRING, + number=1, + ) + negated = proto.Field( + proto.BOOL, + number=2, + ) class SkillFilter(proto.Message): @@ -794,8 +921,14 @@ class SkillFilter(proto.Message): profiles matching the filter are excluded. """ - skill = proto.Field(proto.STRING, number=1,) - negated = proto.Field(proto.BOOL, number=2,) + skill = proto.Field( + proto.STRING, + number=1, + ) + negated = proto.Field( + proto.BOOL, + number=2, + ) class EmployerFilter(proto.Message): @@ -827,9 +960,19 @@ class EmployerFilterMode(proto.Enum): CURRENT_EMPLOYMENT_RECORDS_ONLY = 2 PAST_EMPLOYMENT_RECORDS_ONLY = 3 - employer = proto.Field(proto.STRING, number=1,) - mode = proto.Field(proto.ENUM, number=2, enum=EmployerFilterMode,) - negated = proto.Field(proto.BOOL, number=3,) + employer = proto.Field( + proto.STRING, + number=1, + ) + mode = proto.Field( + proto.ENUM, + number=2, + enum=EmployerFilterMode, + ) + negated = proto.Field( + proto.BOOL, + number=3, + ) class EducationFilter(proto.Message): @@ -854,10 +997,23 @@ class EducationFilter(proto.Message): profiles matching the filter is excluded. """ - school = proto.Field(proto.STRING, number=1,) - field_of_study = proto.Field(proto.STRING, number=2,) - degree_type = proto.Field(proto.ENUM, number=3, enum=common.DegreeType,) - negated = proto.Field(proto.BOOL, number=6,) + school = proto.Field( + proto.STRING, + number=1, + ) + field_of_study = proto.Field( + proto.STRING, + number=2, + ) + degree_type = proto.Field( + proto.ENUM, + number=3, + enum=common.DegreeType, + ) + negated = proto.Field( + proto.BOOL, + number=6, + ) class WorkExperienceFilter(proto.Message): @@ -879,10 +1035,14 @@ class WorkExperienceFilter(proto.Message): """ min_experience = proto.Field( - proto.MESSAGE, number=1, message=duration_pb2.Duration, + proto.MESSAGE, + number=1, + message=duration_pb2.Duration, ) max_experience = proto.Field( - proto.MESSAGE, number=2, message=duration_pb2.Duration, + proto.MESSAGE, + number=2, + message=duration_pb2.Duration, ) @@ -909,8 +1069,16 @@ class ApplicationDateFilter(proto.Message): start date. """ - start_date = proto.Field(proto.MESSAGE, number=1, message=date_pb2.Date,) - end_date = proto.Field(proto.MESSAGE, number=2, message=date_pb2.Date,) + start_date = proto.Field( + proto.MESSAGE, + number=1, + message=date_pb2.Date, + ) + end_date = proto.Field( + proto.MESSAGE, + number=2, + message=date_pb2.Date, + ) class ApplicationOutcomeNotesFilter(proto.Message): @@ -928,8 +1096,14 @@ class ApplicationOutcomeNotesFilter(proto.Message): matching the outcome reason specified in the filter. """ - outcome_notes = proto.Field(proto.STRING, number=1,) - negated = proto.Field(proto.BOOL, number=2,) + outcome_notes = proto.Field( + proto.STRING, + number=1, + ) + negated = proto.Field( + proto.BOOL, + number=2, + ) class ApplicationJobFilter(proto.Message): @@ -955,9 +1129,18 @@ class ApplicationJobFilter(proto.Message): matching the filters. """ - job_requisition_id = proto.Field(proto.STRING, number=2,) - job_title = proto.Field(proto.STRING, number=3,) - negated = proto.Field(proto.BOOL, number=4,) + job_requisition_id = proto.Field( + proto.STRING, + number=2, + ) + job_title = proto.Field( + proto.STRING, + number=3, + ) + negated = proto.Field( + proto.BOOL, + number=4, + ) class TimeFilter(proto.Message): @@ -987,9 +1170,21 @@ class TimeField(proto.Enum): CREATE_TIME = 1 UPDATE_TIME = 2 - start_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) - time_field = proto.Field(proto.ENUM, number=3, enum=TimeField,) + start_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + time_field = proto.Field( + proto.ENUM, + number=3, + enum=TimeField, + ) class CandidateAvailabilityFilter(proto.Message): @@ -1002,7 +1197,10 @@ class CandidateAvailabilityFilter(proto.Message): all the potential available profiles. """ - negated = proto.Field(proto.BOOL, number=1,) + negated = proto.Field( + proto.BOOL, + number=1, + ) class AvailabilityFilter(proto.Message): @@ -1024,9 +1222,20 @@ class AvailabilityFilter(proto.Message): [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter]. """ - signal_type = proto.Field(proto.ENUM, number=1, enum=common.AvailabilitySignalType,) - range_ = proto.Field(proto.MESSAGE, number=2, message=common.TimestampRange,) - required = proto.Field(proto.BOOL, number=3,) + signal_type = proto.Field( + proto.ENUM, + number=1, + enum=common.AvailabilitySignalType, + ) + range_ = proto.Field( + proto.MESSAGE, + number=2, + message=common.TimestampRange, + ) + required = proto.Field( + proto.BOOL, + number=3, + ) class PersonNameFilter(proto.Message): @@ -1043,7 +1252,10 @@ class PersonNameFilter(proto.Message): [PersonName.formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name]. """ - person_name = proto.Field(proto.STRING, number=1,) + person_name = proto.Field( + proto.STRING, + number=1, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/histogram.py b/google/cloud/talent_v4beta1/types/histogram.py index 500f1688..0d0c53fe 100644 --- a/google/cloud/talent_v4beta1/types/histogram.py +++ b/google/cloud/talent_v4beta1/types/histogram.py @@ -18,7 +18,10 @@ __protobuf__ = proto.module( package="google.cloud.talent.v4beta1", - manifest={"HistogramQuery", "HistogramQueryResult",}, + manifest={ + "HistogramQuery", + "HistogramQueryResult", + }, ) @@ -37,7 +40,10 @@ class HistogramQuery(proto.Message): for details about syntax. """ - histogram_query = proto.Field(proto.STRING, number=1,) + histogram_query = proto.Field( + proto.STRING, + number=1, + ) class HistogramQueryResult(proto.Message): @@ -64,8 +70,15 @@ class HistogramQueryResult(proto.Message): ``0-MAX``. """ - histogram_query = proto.Field(proto.STRING, number=1,) - histogram = proto.MapField(proto.STRING, proto.INT64, number=2,) + histogram_query = proto.Field( + proto.STRING, + number=1, + ) + histogram = proto.MapField( + proto.STRING, + proto.INT64, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/job.py b/google/cloud/talent_v4beta1/types/job.py index 749a79a1..b071baca 100644 --- a/google/cloud/talent_v4beta1/types/job.py +++ b/google/cloud/talent_v4beta1/types/job.py @@ -19,7 +19,12 @@ from google.protobuf import timestamp_pb2 # type: ignore -__protobuf__ = proto.module(package="google.cloud.talent.v4beta1", manifest={"Job",},) +__protobuf__ = proto.module( + package="google.cloud.talent.v4beta1", + manifest={ + "Job", + }, +) class Job(proto.Message): @@ -343,9 +348,18 @@ class ApplicationInfo(proto.Message): each entry is 2,000. """ - emails = proto.RepeatedField(proto.STRING, number=1,) - instruction = proto.Field(proto.STRING, number=2,) - uris = proto.RepeatedField(proto.STRING, number=3,) + emails = proto.RepeatedField( + proto.STRING, + number=1, + ) + instruction = proto.Field( + proto.STRING, + number=2, + ) + uris = proto.RepeatedField( + proto.STRING, + number=3, + ) class DerivedInfo(proto.Message): r"""Derived details about the job posting. @@ -366,10 +380,14 @@ class DerivedInfo(proto.Message): """ locations = proto.RepeatedField( - proto.MESSAGE, number=1, message=common.Location, + proto.MESSAGE, + number=1, + message=common.Location, ) job_categories = proto.RepeatedField( - proto.ENUM, number=3, enum=common.JobCategory, + proto.ENUM, + number=3, + enum=common.JobCategory, ) class ProcessingOptions(proto.Message): @@ -396,60 +414,153 @@ class ProcessingOptions(proto.Message): [HtmlSanitization.SIMPLE_FORMATTING_ONLY][google.cloud.talent.v4beta1.HtmlSanitization.SIMPLE_FORMATTING_ONLY]. """ - disable_street_address_resolution = proto.Field(proto.BOOL, number=1,) + disable_street_address_resolution = proto.Field( + proto.BOOL, + number=1, + ) html_sanitization = proto.Field( - proto.ENUM, number=2, enum=common.HtmlSanitization, + proto.ENUM, + number=2, + enum=common.HtmlSanitization, ) - name = proto.Field(proto.STRING, number=1,) - company = proto.Field(proto.STRING, number=2,) - requisition_id = proto.Field(proto.STRING, number=3,) - title = proto.Field(proto.STRING, number=4,) - description = proto.Field(proto.STRING, number=5,) - addresses = proto.RepeatedField(proto.STRING, number=6,) - application_info = proto.Field(proto.MESSAGE, number=7, message=ApplicationInfo,) - job_benefits = proto.RepeatedField(proto.ENUM, number=8, enum=common.JobBenefit,) + name = proto.Field( + proto.STRING, + number=1, + ) + company = proto.Field( + proto.STRING, + number=2, + ) + requisition_id = proto.Field( + proto.STRING, + number=3, + ) + title = proto.Field( + proto.STRING, + number=4, + ) + description = proto.Field( + proto.STRING, + number=5, + ) + addresses = proto.RepeatedField( + proto.STRING, + number=6, + ) + application_info = proto.Field( + proto.MESSAGE, + number=7, + message=ApplicationInfo, + ) + job_benefits = proto.RepeatedField( + proto.ENUM, + number=8, + enum=common.JobBenefit, + ) compensation_info = proto.Field( - proto.MESSAGE, number=9, message=common.CompensationInfo, + proto.MESSAGE, + number=9, + message=common.CompensationInfo, ) custom_attributes = proto.MapField( - proto.STRING, proto.MESSAGE, number=10, message=common.CustomAttribute, + proto.STRING, + proto.MESSAGE, + number=10, + message=common.CustomAttribute, + ) + degree_types = proto.RepeatedField( + proto.ENUM, + number=11, + enum=common.DegreeType, + ) + department = proto.Field( + proto.STRING, + number=12, ) - degree_types = proto.RepeatedField(proto.ENUM, number=11, enum=common.DegreeType,) - department = proto.Field(proto.STRING, number=12,) employment_types = proto.RepeatedField( - proto.ENUM, number=13, enum=common.EmploymentType, + proto.ENUM, + number=13, + enum=common.EmploymentType, + ) + incentives = proto.Field( + proto.STRING, + number=14, + ) + language_code = proto.Field( + proto.STRING, + number=15, + ) + job_level = proto.Field( + proto.ENUM, + number=16, + enum=common.JobLevel, + ) + promotion_value = proto.Field( + proto.INT32, + number=17, + ) + qualifications = proto.Field( + proto.STRING, + number=18, + ) + responsibilities = proto.Field( + proto.STRING, + number=19, + ) + posting_region = proto.Field( + proto.ENUM, + number=20, + enum=common.PostingRegion, + ) + visibility = proto.Field( + proto.ENUM, + number=21, + enum=common.Visibility, ) - incentives = proto.Field(proto.STRING, number=14,) - language_code = proto.Field(proto.STRING, number=15,) - job_level = proto.Field(proto.ENUM, number=16, enum=common.JobLevel,) - promotion_value = proto.Field(proto.INT32, number=17,) - qualifications = proto.Field(proto.STRING, number=18,) - responsibilities = proto.Field(proto.STRING, number=19,) - posting_region = proto.Field(proto.ENUM, number=20, enum=common.PostingRegion,) - visibility = proto.Field(proto.ENUM, number=21, enum=common.Visibility,) job_start_time = proto.Field( - proto.MESSAGE, number=22, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=22, + message=timestamp_pb2.Timestamp, ) job_end_time = proto.Field( - proto.MESSAGE, number=23, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=23, + message=timestamp_pb2.Timestamp, ) posting_publish_time = proto.Field( - proto.MESSAGE, number=24, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=24, + message=timestamp_pb2.Timestamp, ) posting_expire_time = proto.Field( - proto.MESSAGE, number=25, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=25, + message=timestamp_pb2.Timestamp, ) posting_create_time = proto.Field( - proto.MESSAGE, number=26, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=26, + message=timestamp_pb2.Timestamp, ) posting_update_time = proto.Field( - proto.MESSAGE, number=27, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=27, + message=timestamp_pb2.Timestamp, + ) + company_display_name = proto.Field( + proto.STRING, + number=28, + ) + derived_info = proto.Field( + proto.MESSAGE, + number=29, + message=DerivedInfo, ) - company_display_name = proto.Field(proto.STRING, number=28,) - derived_info = proto.Field(proto.MESSAGE, number=29, message=DerivedInfo,) processing_options = proto.Field( - proto.MESSAGE, number=30, message=ProcessingOptions, + proto.MESSAGE, + number=30, + message=ProcessingOptions, ) diff --git a/google/cloud/talent_v4beta1/types/job_service.py b/google/cloud/talent_v4beta1/types/job_service.py index dd13f6bc..2f2b32dc 100644 --- a/google/cloud/talent_v4beta1/types/job_service.py +++ b/google/cloud/talent_v4beta1/types/job_service.py @@ -74,8 +74,15 @@ class CreateJobRequest(proto.Message): Required. The Job to be created. """ - parent = proto.Field(proto.STRING, number=1,) - job = proto.Field(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + job = proto.Field( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) class GetJobRequest(proto.Message): @@ -93,7 +100,10 @@ class GetJobRequest(proto.Message): example, "projects/foo/jobs/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateJobRequest(proto.Message): @@ -116,9 +126,15 @@ class UpdateJobRequest(proto.Message): are supported. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -137,7 +153,10 @@ class DeleteJobRequest(proto.Message): example, "projects/foo/jobs/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class BatchDeleteJobsRequest(proto.Message): @@ -167,8 +186,14 @@ class BatchDeleteJobsRequest(proto.Message): requisitionId = "req-1". """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) class ListJobsRequest(proto.Message): @@ -224,11 +249,27 @@ class ListJobsRequest(proto.Message): if no value is specified. """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) - page_token = proto.Field(proto.STRING, number=3,) - page_size = proto.Field(proto.INT32, number=4,) - job_view = proto.Field(proto.ENUM, number=5, enum="JobView",) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + job_view = proto.Field( + proto.ENUM, + number=5, + enum="JobView", + ) class ListJobsResponse(proto.Message): @@ -250,9 +291,20 @@ class ListJobsResponse(proto.Message): def raw_page(self): return self - jobs = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_job.Job,) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, + ) class SearchJobsRequest(proto.Message): @@ -623,31 +675,78 @@ class ImportanceLevel(proto.Enum): number=1, enum="SearchJobsRequest.CustomRankingInfo.ImportanceLevel", ) - ranking_expression = proto.Field(proto.STRING, number=2,) + ranking_expression = proto.Field( + proto.STRING, + number=2, + ) - parent = proto.Field(proto.STRING, number=1,) - search_mode = proto.Field(proto.ENUM, number=2, enum=SearchMode,) + parent = proto.Field( + proto.STRING, + number=1, + ) + search_mode = proto.Field( + proto.ENUM, + number=2, + enum=SearchMode, + ) request_metadata = proto.Field( - proto.MESSAGE, number=3, message=common.RequestMetadata, + proto.MESSAGE, + number=3, + message=common.RequestMetadata, + ) + job_query = proto.Field( + proto.MESSAGE, + number=4, + message=filters.JobQuery, + ) + enable_broadening = proto.Field( + proto.BOOL, + number=5, + ) + require_precise_result_size = proto.Field( + proto.BOOL, + number=6, ) - job_query = proto.Field(proto.MESSAGE, number=4, message=filters.JobQuery,) - enable_broadening = proto.Field(proto.BOOL, number=5,) - require_precise_result_size = proto.Field(proto.BOOL, number=6,) histogram_queries = proto.RepeatedField( - proto.MESSAGE, number=7, message=histogram.HistogramQuery, + proto.MESSAGE, + number=7, + message=histogram.HistogramQuery, + ) + job_view = proto.Field( + proto.ENUM, + number=8, + enum="JobView", + ) + offset = proto.Field( + proto.INT32, + number=9, + ) + page_size = proto.Field( + proto.INT32, + number=10, + ) + page_token = proto.Field( + proto.STRING, + number=11, + ) + order_by = proto.Field( + proto.STRING, + number=12, ) - job_view = proto.Field(proto.ENUM, number=8, enum="JobView",) - offset = proto.Field(proto.INT32, number=9,) - page_size = proto.Field(proto.INT32, number=10,) - page_token = proto.Field(proto.STRING, number=11,) - order_by = proto.Field(proto.STRING, number=12,) diversification_level = proto.Field( - proto.ENUM, number=13, enum=DiversificationLevel, + proto.ENUM, + number=13, + enum=DiversificationLevel, ) custom_ranking_info = proto.Field( - proto.MESSAGE, number=14, message=CustomRankingInfo, + proto.MESSAGE, + number=14, + message=CustomRankingInfo, + ) + disable_keyword_match = proto.Field( + proto.BOOL, + number=16, ) - disable_keyword_match = proto.Field(proto.BOOL, number=16,) class SearchJobsResponse(proto.Message): @@ -732,12 +831,27 @@ class MatchingJob(proto.Message): [CommuteFilter][google.cloud.talent.v4beta1.CommuteFilter]. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) - job_summary = proto.Field(proto.STRING, number=2,) - job_title_snippet = proto.Field(proto.STRING, number=3,) - search_text_snippet = proto.Field(proto.STRING, number=4,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + job_summary = proto.Field( + proto.STRING, + number=2, + ) + job_title_snippet = proto.Field( + proto.STRING, + number=3, + ) + search_text_snippet = proto.Field( + proto.STRING, + number=4, + ) commute_info = proto.Field( - proto.MESSAGE, number=5, message="SearchJobsResponse.CommuteInfo", + proto.MESSAGE, + number=5, + message="SearchJobsResponse.CommuteInfo", ) class CommuteInfo(proto.Message): @@ -755,29 +869,61 @@ class CommuteInfo(proto.Message): but was returned as part of an expanded query. """ - job_location = proto.Field(proto.MESSAGE, number=1, message=common.Location,) + job_location = proto.Field( + proto.MESSAGE, + number=1, + message=common.Location, + ) travel_duration = proto.Field( - proto.MESSAGE, number=2, message=duration_pb2.Duration, + proto.MESSAGE, + number=2, + message=duration_pb2.Duration, ) @property def raw_page(self): return self - matching_jobs = proto.RepeatedField(proto.MESSAGE, number=1, message=MatchingJob,) + matching_jobs = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=MatchingJob, + ) histogram_query_results = proto.RepeatedField( - proto.MESSAGE, number=2, message=histogram.HistogramQueryResult, + proto.MESSAGE, + number=2, + message=histogram.HistogramQueryResult, + ) + next_page_token = proto.Field( + proto.STRING, + number=3, ) - next_page_token = proto.Field(proto.STRING, number=3,) location_filters = proto.RepeatedField( - proto.MESSAGE, number=4, message=common.Location, + proto.MESSAGE, + number=4, + message=common.Location, + ) + estimated_total_size = proto.Field( + proto.INT32, + number=5, + ) + total_size = proto.Field( + proto.INT32, + number=6, + ) + metadata = proto.Field( + proto.MESSAGE, + number=7, + message=common.ResponseMetadata, + ) + broadened_query_jobs_count = proto.Field( + proto.INT32, + number=8, ) - estimated_total_size = proto.Field(proto.INT32, number=5,) - total_size = proto.Field(proto.INT32, number=6,) - metadata = proto.Field(proto.MESSAGE, number=7, message=common.ResponseMetadata,) - broadened_query_jobs_count = proto.Field(proto.INT32, number=8,) spell_correction = proto.Field( - proto.MESSAGE, number=9, message=common.SpellingCorrection, + proto.MESSAGE, + number=9, + message=common.SpellingCorrection, ) @@ -797,8 +943,15 @@ class BatchCreateJobsRequest(proto.Message): Required. The jobs to be created. """ - parent = proto.Field(proto.STRING, number=1,) - jobs = proto.RepeatedField(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) class BatchUpdateJobsRequest(proto.Message): @@ -841,10 +994,19 @@ class BatchUpdateJobsRequest(proto.Message): response. """ - parent = proto.Field(proto.STRING, number=1,) - jobs = proto.RepeatedField(proto.MESSAGE, number=2, message=gct_job.Job,) + parent = proto.Field( + proto.STRING, + number=1, + ) + jobs = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gct_job.Job, + ) update_mask = proto.Field( - proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=3, + message=field_mask_pb2.FieldMask, ) @@ -885,10 +1047,22 @@ class JobResult(proto.Message): fails. """ - job = proto.Field(proto.MESSAGE, number=1, message=gct_job.Job,) - status = proto.Field(proto.MESSAGE, number=2, message=status_pb2.Status,) + job = proto.Field( + proto.MESSAGE, + number=1, + message=gct_job.Job, + ) + status = proto.Field( + proto.MESSAGE, + number=2, + message=status_pb2.Status, + ) - job_results = proto.RepeatedField(proto.MESSAGE, number=1, message=JobResult,) + job_results = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=JobResult, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/profile.py b/google/cloud/talent_v4beta1/types/profile.py index e6602f29..fde9f272 100644 --- a/google/cloud/talent_v4beta1/types/profile.py +++ b/google/cloud/talent_v4beta1/types/profile.py @@ -300,56 +300,152 @@ class Profile(proto.Message): in the same order. """ - name = proto.Field(proto.STRING, number=1,) - external_id = proto.Field(proto.STRING, number=2,) - source = proto.Field(proto.STRING, number=3,) - uri = proto.Field(proto.STRING, number=4,) - group_id = proto.Field(proto.STRING, number=5,) - is_hirable = proto.Field(proto.MESSAGE, number=6, message=wrappers_pb2.BoolValue,) - create_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) - update_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) + name = proto.Field( + proto.STRING, + number=1, + ) + external_id = proto.Field( + proto.STRING, + number=2, + ) + source = proto.Field( + proto.STRING, + number=3, + ) + uri = proto.Field( + proto.STRING, + number=4, + ) + group_id = proto.Field( + proto.STRING, + number=5, + ) + is_hirable = proto.Field( + proto.MESSAGE, + number=6, + message=wrappers_pb2.BoolValue, + ) + create_time = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + update_time = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) candidate_update_time = proto.Field( - proto.MESSAGE, number=67, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=67, + message=timestamp_pb2.Timestamp, ) resume_update_time = proto.Field( - proto.MESSAGE, number=68, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=68, + message=timestamp_pb2.Timestamp, + ) + resume = proto.Field( + proto.MESSAGE, + number=53, + message="Resume", + ) + person_names = proto.RepeatedField( + proto.MESSAGE, + number=11, + message="PersonName", + ) + addresses = proto.RepeatedField( + proto.MESSAGE, + number=12, + message="Address", + ) + email_addresses = proto.RepeatedField( + proto.MESSAGE, + number=13, + message="Email", + ) + phone_numbers = proto.RepeatedField( + proto.MESSAGE, + number=14, + message="Phone", ) - resume = proto.Field(proto.MESSAGE, number=53, message="Resume",) - person_names = proto.RepeatedField(proto.MESSAGE, number=11, message="PersonName",) - addresses = proto.RepeatedField(proto.MESSAGE, number=12, message="Address",) - email_addresses = proto.RepeatedField(proto.MESSAGE, number=13, message="Email",) - phone_numbers = proto.RepeatedField(proto.MESSAGE, number=14, message="Phone",) personal_uris = proto.RepeatedField( - proto.MESSAGE, number=15, message="PersonalUri", + proto.MESSAGE, + number=15, + message="PersonalUri", ) additional_contact_info = proto.RepeatedField( - proto.MESSAGE, number=16, message="AdditionalContactInfo", + proto.MESSAGE, + number=16, + message="AdditionalContactInfo", ) employment_records = proto.RepeatedField( - proto.MESSAGE, number=17, message="EmploymentRecord", + proto.MESSAGE, + number=17, + message="EmploymentRecord", ) education_records = proto.RepeatedField( - proto.MESSAGE, number=18, message="EducationRecord", + proto.MESSAGE, + number=18, + message="EducationRecord", + ) + skills = proto.RepeatedField( + proto.MESSAGE, + number=19, + message=common.Skill, + ) + activities = proto.RepeatedField( + proto.MESSAGE, + number=20, + message="Activity", + ) + publications = proto.RepeatedField( + proto.MESSAGE, + number=21, + message="Publication", + ) + patents = proto.RepeatedField( + proto.MESSAGE, + number=22, + message="Patent", ) - skills = proto.RepeatedField(proto.MESSAGE, number=19, message=common.Skill,) - activities = proto.RepeatedField(proto.MESSAGE, number=20, message="Activity",) - publications = proto.RepeatedField(proto.MESSAGE, number=21, message="Publication",) - patents = proto.RepeatedField(proto.MESSAGE, number=22, message="Patent",) certifications = proto.RepeatedField( - proto.MESSAGE, number=23, message=common.Certification, + proto.MESSAGE, + number=23, + message=common.Certification, + ) + applications = proto.RepeatedField( + proto.STRING, + number=47, + ) + assignments = proto.RepeatedField( + proto.STRING, + number=48, ) - applications = proto.RepeatedField(proto.STRING, number=47,) - assignments = proto.RepeatedField(proto.STRING, number=48,) custom_attributes = proto.MapField( - proto.STRING, proto.MESSAGE, number=26, message=common.CustomAttribute, + proto.STRING, + proto.MESSAGE, + number=26, + message=common.CustomAttribute, + ) + processed = proto.Field( + proto.BOOL, + number=27, + ) + keyword_snippet = proto.Field( + proto.STRING, + number=28, ) - processed = proto.Field(proto.BOOL, number=27,) - keyword_snippet = proto.Field(proto.STRING, number=28,) availability_signals = proto.RepeatedField( - proto.MESSAGE, number=70, message="AvailabilitySignal", + proto.MESSAGE, + number=70, + message="AvailabilitySignal", ) derived_addresses = proto.RepeatedField( - proto.MESSAGE, number=64, message=common.Location, + proto.MESSAGE, + number=64, + message=common.Location, ) @@ -378,12 +474,20 @@ class AvailabilitySignal(proto.Message): [type][google.cloud.talent.v4beta1.AvailabilitySignal.type]. """ - type_ = proto.Field(proto.ENUM, number=1, enum=common.AvailabilitySignalType,) + type_ = proto.Field( + proto.ENUM, + number=1, + enum=common.AvailabilitySignalType, + ) last_update_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) filter_satisfied = proto.Field( - proto.MESSAGE, number=3, message=wrappers_pb2.BoolValue, + proto.MESSAGE, + number=3, + message=wrappers_pb2.BoolValue, ) @@ -417,8 +521,15 @@ class ResumeType(proto.Enum): HRXML = 1 OTHER_RESUME_TYPE = 2 - structured_resume = proto.Field(proto.STRING, number=1,) - resume_type = proto.Field(proto.ENUM, number=2, enum=ResumeType,) + structured_resume = proto.Field( + proto.STRING, + number=1, + ) + resume_type = proto.Field( + proto.ENUM, + number=2, + enum=ResumeType, + ) class PersonName(proto.Message): @@ -490,18 +601,46 @@ class PersonStructuredName(proto.Message): Number of characters allowed is 20. """ - given_name = proto.Field(proto.STRING, number=1,) - preferred_name = proto.Field(proto.STRING, number=6,) - middle_initial = proto.Field(proto.STRING, number=2,) - family_name = proto.Field(proto.STRING, number=3,) - suffixes = proto.RepeatedField(proto.STRING, number=4,) - prefixes = proto.RepeatedField(proto.STRING, number=5,) - - formatted_name = proto.Field(proto.STRING, number=1, oneof="person_name",) + given_name = proto.Field( + proto.STRING, + number=1, + ) + preferred_name = proto.Field( + proto.STRING, + number=6, + ) + middle_initial = proto.Field( + proto.STRING, + number=2, + ) + family_name = proto.Field( + proto.STRING, + number=3, + ) + suffixes = proto.RepeatedField( + proto.STRING, + number=4, + ) + prefixes = proto.RepeatedField( + proto.STRING, + number=5, + ) + + formatted_name = proto.Field( + proto.STRING, + number=1, + oneof="person_name", + ) structured_name = proto.Field( - proto.MESSAGE, number=2, oneof="person_name", message=PersonStructuredName, + proto.MESSAGE, + number=2, + oneof="person_name", + message=PersonStructuredName, + ) + preferred_name = proto.Field( + proto.STRING, + number=3, ) - preferred_name = proto.Field(proto.STRING, number=3,) class Address(proto.Message): @@ -536,15 +675,27 @@ class Address(proto.Message): address. """ - usage = proto.Field(proto.ENUM, number=1, enum=common.ContactInfoUsage,) - unstructured_address = proto.Field(proto.STRING, number=2, oneof="address",) + usage = proto.Field( + proto.ENUM, + number=1, + enum=common.ContactInfoUsage, + ) + unstructured_address = proto.Field( + proto.STRING, + number=2, + oneof="address", + ) structured_address = proto.Field( proto.MESSAGE, number=3, oneof="address", message=postal_address_pb2.PostalAddress, ) - current = proto.Field(proto.MESSAGE, number=4, message=wrappers_pb2.BoolValue,) + current = proto.Field( + proto.MESSAGE, + number=4, + message=wrappers_pb2.BoolValue, + ) class Email(proto.Message): @@ -559,8 +710,15 @@ class Email(proto.Message): Number of characters allowed is 4,000. """ - usage = proto.Field(proto.ENUM, number=1, enum=common.ContactInfoUsage,) - email_address = proto.Field(proto.STRING, number=2,) + usage = proto.Field( + proto.ENUM, + number=1, + enum=common.ContactInfoUsage, + ) + email_address = proto.Field( + proto.STRING, + number=2, + ) class Phone(proto.Message): @@ -601,10 +759,24 @@ class PhoneType(proto.Enum): VOIP = 8 MOBILE_OR_LANDLINE = 9 - usage = proto.Field(proto.ENUM, number=1, enum=common.ContactInfoUsage,) - type_ = proto.Field(proto.ENUM, number=2, enum=PhoneType,) - number = proto.Field(proto.STRING, number=3,) - when_available = proto.Field(proto.STRING, number=4,) + usage = proto.Field( + proto.ENUM, + number=1, + enum=common.ContactInfoUsage, + ) + type_ = proto.Field( + proto.ENUM, + number=2, + enum=PhoneType, + ) + number = proto.Field( + proto.STRING, + number=3, + ) + when_available = proto.Field( + proto.STRING, + number=4, + ) class PersonalUri(proto.Message): @@ -616,7 +788,10 @@ class PersonalUri(proto.Message): Number of characters allowed is 4,000. """ - uri = proto.Field(proto.STRING, number=1,) + uri = proto.Field( + proto.STRING, + number=1, + ) class AdditionalContactInfo(proto.Message): @@ -637,9 +812,19 @@ class AdditionalContactInfo(proto.Message): Number of characters allowed is 100. """ - usage = proto.Field(proto.ENUM, number=1, enum=common.ContactInfoUsage,) - name = proto.Field(proto.STRING, number=2,) - contact_id = proto.Field(proto.STRING, number=3,) + usage = proto.Field( + proto.ENUM, + number=1, + enum=common.ContactInfoUsage, + ) + name = proto.Field( + proto.STRING, + number=2, + ) + contact_id = proto.Field( + proto.STRING, + number=3, + ) class EmploymentRecord(proto.Message): @@ -696,23 +881,64 @@ class EmploymentRecord(proto.Message): isn't related to the search query. """ - start_date = proto.Field(proto.MESSAGE, number=1, message=date_pb2.Date,) - end_date = proto.Field(proto.MESSAGE, number=2, message=date_pb2.Date,) - employer_name = proto.Field(proto.STRING, number=3,) - division_name = proto.Field(proto.STRING, number=4,) - address = proto.Field(proto.MESSAGE, number=5, message="Address",) - job_title = proto.Field(proto.STRING, number=6,) - job_description = proto.Field(proto.STRING, number=7,) + start_date = proto.Field( + proto.MESSAGE, + number=1, + message=date_pb2.Date, + ) + end_date = proto.Field( + proto.MESSAGE, + number=2, + message=date_pb2.Date, + ) + employer_name = proto.Field( + proto.STRING, + number=3, + ) + division_name = proto.Field( + proto.STRING, + number=4, + ) + address = proto.Field( + proto.MESSAGE, + number=5, + message="Address", + ) + job_title = proto.Field( + proto.STRING, + number=6, + ) + job_description = proto.Field( + proto.STRING, + number=7, + ) is_supervisor = proto.Field( - proto.MESSAGE, number=8, message=wrappers_pb2.BoolValue, + proto.MESSAGE, + number=8, + message=wrappers_pb2.BoolValue, ) is_self_employed = proto.Field( - proto.MESSAGE, number=9, message=wrappers_pb2.BoolValue, + proto.MESSAGE, + number=9, + message=wrappers_pb2.BoolValue, + ) + is_current = proto.Field( + proto.MESSAGE, + number=10, + message=wrappers_pb2.BoolValue, + ) + job_title_snippet = proto.Field( + proto.STRING, + number=11, + ) + job_description_snippet = proto.Field( + proto.STRING, + number=12, + ) + employer_name_snippet = proto.Field( + proto.STRING, + number=13, ) - is_current = proto.Field(proto.MESSAGE, number=10, message=wrappers_pb2.BoolValue,) - job_title_snippet = proto.Field(proto.STRING, number=11,) - job_description_snippet = proto.Field(proto.STRING, number=12,) - employer_name_snippet = proto.Field(proto.STRING, number=13,) class EducationRecord(proto.Message): @@ -772,21 +998,58 @@ class EducationRecord(proto.Message): to the search query. """ - start_date = proto.Field(proto.MESSAGE, number=1, message=date_pb2.Date,) - end_date = proto.Field(proto.MESSAGE, number=2, message=date_pb2.Date,) + start_date = proto.Field( + proto.MESSAGE, + number=1, + message=date_pb2.Date, + ) + end_date = proto.Field( + proto.MESSAGE, + number=2, + message=date_pb2.Date, + ) expected_graduation_date = proto.Field( - proto.MESSAGE, number=3, message=date_pb2.Date, + proto.MESSAGE, + number=3, + message=date_pb2.Date, + ) + school_name = proto.Field( + proto.STRING, + number=4, + ) + address = proto.Field( + proto.MESSAGE, + number=5, + message="Address", + ) + degree_description = proto.Field( + proto.STRING, + number=6, + oneof="degree", ) - school_name = proto.Field(proto.STRING, number=4,) - address = proto.Field(proto.MESSAGE, number=5, message="Address",) - degree_description = proto.Field(proto.STRING, number=6, oneof="degree",) structured_degree = proto.Field( - proto.MESSAGE, number=7, oneof="degree", message="Degree", + proto.MESSAGE, + number=7, + oneof="degree", + message="Degree", + ) + description = proto.Field( + proto.STRING, + number=8, + ) + is_current = proto.Field( + proto.MESSAGE, + number=9, + message=wrappers_pb2.BoolValue, + ) + school_name_snippet = proto.Field( + proto.STRING, + number=10, + ) + degree_snippet = proto.Field( + proto.STRING, + number=11, ) - description = proto.Field(proto.STRING, number=8,) - is_current = proto.Field(proto.MESSAGE, number=9, message=wrappers_pb2.BoolValue,) - school_name_snippet = proto.Field(proto.STRING, number=10,) - degree_snippet = proto.Field(proto.STRING, number=11,) class Degree(proto.Message): @@ -807,9 +1070,19 @@ class Degree(proto.Message): Number of characters allowed is 100. """ - degree_type = proto.Field(proto.ENUM, number=1, enum=common.DegreeType,) - degree_name = proto.Field(proto.STRING, number=2,) - fields_of_study = proto.RepeatedField(proto.STRING, number=3,) + degree_type = proto.Field( + proto.ENUM, + number=1, + enum=common.DegreeType, + ) + degree_name = proto.Field( + proto.STRING, + number=2, + ) + fields_of_study = proto.RepeatedField( + proto.STRING, + number=3, + ) class Activity(proto.Message): @@ -863,16 +1136,49 @@ class Activity(proto.Message): are not related to the search query. """ - display_name = proto.Field(proto.STRING, number=1,) - description = proto.Field(proto.STRING, number=2,) - uri = proto.Field(proto.STRING, number=3,) - create_date = proto.Field(proto.MESSAGE, number=4, message=date_pb2.Date,) - update_date = proto.Field(proto.MESSAGE, number=5, message=date_pb2.Date,) - team_members = proto.RepeatedField(proto.STRING, number=6,) - skills_used = proto.RepeatedField(proto.MESSAGE, number=7, message=common.Skill,) - activity_name_snippet = proto.Field(proto.STRING, number=8,) - activity_description_snippet = proto.Field(proto.STRING, number=9,) - skills_used_snippet = proto.RepeatedField(proto.STRING, number=10,) + display_name = proto.Field( + proto.STRING, + number=1, + ) + description = proto.Field( + proto.STRING, + number=2, + ) + uri = proto.Field( + proto.STRING, + number=3, + ) + create_date = proto.Field( + proto.MESSAGE, + number=4, + message=date_pb2.Date, + ) + update_date = proto.Field( + proto.MESSAGE, + number=5, + message=date_pb2.Date, + ) + team_members = proto.RepeatedField( + proto.STRING, + number=6, + ) + skills_used = proto.RepeatedField( + proto.MESSAGE, + number=7, + message=common.Skill, + ) + activity_name_snippet = proto.Field( + proto.STRING, + number=8, + ) + activity_description_snippet = proto.Field( + proto.STRING, + number=9, + ) + skills_used_snippet = proto.RepeatedField( + proto.STRING, + number=10, + ) class Publication(proto.Message): @@ -908,15 +1214,43 @@ class Publication(proto.Message): Number of characters allowed is 100. """ - authors = proto.RepeatedField(proto.STRING, number=1,) - title = proto.Field(proto.STRING, number=2,) - description = proto.Field(proto.STRING, number=3,) - journal = proto.Field(proto.STRING, number=4,) - volume = proto.Field(proto.STRING, number=5,) - publisher = proto.Field(proto.STRING, number=6,) - publication_date = proto.Field(proto.MESSAGE, number=7, message=date_pb2.Date,) - publication_type = proto.Field(proto.STRING, number=8,) - isbn = proto.Field(proto.STRING, number=9,) + authors = proto.RepeatedField( + proto.STRING, + number=1, + ) + title = proto.Field( + proto.STRING, + number=2, + ) + description = proto.Field( + proto.STRING, + number=3, + ) + journal = proto.Field( + proto.STRING, + number=4, + ) + volume = proto.Field( + proto.STRING, + number=5, + ) + publisher = proto.Field( + proto.STRING, + number=6, + ) + publication_date = proto.Field( + proto.MESSAGE, + number=7, + message=date_pb2.Date, + ) + publication_type = proto.Field( + proto.STRING, + number=8, + ) + isbn = proto.Field( + proto.STRING, + number=9, + ) class Patent(proto.Message): @@ -950,15 +1284,45 @@ class Patent(proto.Message): The skills used in this patent. """ - display_name = proto.Field(proto.STRING, number=1,) - inventors = proto.RepeatedField(proto.STRING, number=2,) - patent_status = proto.Field(proto.STRING, number=3,) - patent_status_date = proto.Field(proto.MESSAGE, number=4, message=date_pb2.Date,) - patent_filing_date = proto.Field(proto.MESSAGE, number=5, message=date_pb2.Date,) - patent_office = proto.Field(proto.STRING, number=6,) - patent_number = proto.Field(proto.STRING, number=7,) - patent_description = proto.Field(proto.STRING, number=8,) - skills_used = proto.RepeatedField(proto.MESSAGE, number=9, message=common.Skill,) + display_name = proto.Field( + proto.STRING, + number=1, + ) + inventors = proto.RepeatedField( + proto.STRING, + number=2, + ) + patent_status = proto.Field( + proto.STRING, + number=3, + ) + patent_status_date = proto.Field( + proto.MESSAGE, + number=4, + message=date_pb2.Date, + ) + patent_filing_date = proto.Field( + proto.MESSAGE, + number=5, + message=date_pb2.Date, + ) + patent_office = proto.Field( + proto.STRING, + number=6, + ) + patent_number = proto.Field( + proto.STRING, + number=7, + ) + patent_description = proto.Field( + proto.STRING, + number=8, + ) + skills_used = proto.RepeatedField( + proto.MESSAGE, + number=9, + message=common.Skill, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/profile_service.py b/google/cloud/talent_v4beta1/types/profile_service.py index 7fc96b54..7f281986 100644 --- a/google/cloud/talent_v4beta1/types/profile_service.py +++ b/google/cloud/talent_v4beta1/types/profile_service.py @@ -87,11 +87,27 @@ class ListProfilesRequest(proto.Message): - name """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=5,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - read_mask = proto.Field(proto.MESSAGE, number=4, message=field_mask_pb2.FieldMask,) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=5, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + read_mask = proto.Field( + proto.MESSAGE, + number=4, + message=field_mask_pb2.FieldMask, + ) class ListProfilesResponse(proto.Message): @@ -110,9 +126,14 @@ def raw_page(self): return self profiles = proto.RepeatedField( - proto.MESSAGE, number=1, message=gct_profile.Profile, + proto.MESSAGE, + number=1, + message=gct_profile.Profile, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, ) - next_page_token = proto.Field(proto.STRING, number=2,) class CreateProfileRequest(proto.Message): @@ -128,8 +149,15 @@ class CreateProfileRequest(proto.Message): Required. The profile to be created. """ - parent = proto.Field(proto.STRING, number=1,) - profile = proto.Field(proto.MESSAGE, number=2, message=gct_profile.Profile,) + parent = proto.Field( + proto.STRING, + number=1, + ) + profile = proto.Field( + proto.MESSAGE, + number=2, + message=gct_profile.Profile, + ) class GetProfileRequest(proto.Message): @@ -144,7 +172,10 @@ class GetProfileRequest(proto.Message): For example, "projects/foo/tenants/bar/profiles/baz". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateProfileRequest(proto.Message): @@ -159,9 +190,15 @@ class UpdateProfileRequest(proto.Message): A full update is performed if it is unset. """ - profile = proto.Field(proto.MESSAGE, number=1, message=gct_profile.Profile,) + profile = proto.Field( + proto.MESSAGE, + number=1, + message=gct_profile.Profile, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -177,7 +214,10 @@ class DeleteProfileRequest(proto.Message): For example, "projects/foo/tenants/bar/profiles/baz". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class SearchProfilesRequest(proto.Message): @@ -418,22 +458,57 @@ class SearchProfilesRequest(proto.Message): longer boolean strings. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) request_metadata = proto.Field( - proto.MESSAGE, number=2, message=common.RequestMetadata, - ) - profile_query = proto.Field(proto.MESSAGE, number=3, message=filters.ProfileQuery,) - page_size = proto.Field(proto.INT32, number=4,) - page_token = proto.Field(proto.STRING, number=5,) - offset = proto.Field(proto.INT32, number=6,) - disable_spell_check = proto.Field(proto.BOOL, number=7,) - order_by = proto.Field(proto.STRING, number=8,) - case_sensitive_sort = proto.Field(proto.BOOL, number=9,) + proto.MESSAGE, + number=2, + message=common.RequestMetadata, + ) + profile_query = proto.Field( + proto.MESSAGE, + number=3, + message=filters.ProfileQuery, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + page_token = proto.Field( + proto.STRING, + number=5, + ) + offset = proto.Field( + proto.INT32, + number=6, + ) + disable_spell_check = proto.Field( + proto.BOOL, + number=7, + ) + order_by = proto.Field( + proto.STRING, + number=8, + ) + case_sensitive_sort = proto.Field( + proto.BOOL, + number=9, + ) histogram_queries = proto.RepeatedField( - proto.MESSAGE, number=10, message=histogram.HistogramQuery, + proto.MESSAGE, + number=10, + message=histogram.HistogramQuery, + ) + result_set_id = proto.Field( + proto.STRING, + number=12, + ) + strict_keywords_search = proto.Field( + proto.BOOL, + number=13, ) - result_set_id = proto.Field(proto.STRING, number=12,) - strict_keywords_search = proto.Field(proto.BOOL, number=13,) class SearchProfilesResponse(proto.Message): @@ -468,19 +543,38 @@ class SearchProfilesResponse(proto.Message): def raw_page(self): return self - estimated_total_size = proto.Field(proto.INT64, number=1,) + estimated_total_size = proto.Field( + proto.INT64, + number=1, + ) spell_correction = proto.Field( - proto.MESSAGE, number=2, message=common.SpellingCorrection, + proto.MESSAGE, + number=2, + message=common.SpellingCorrection, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, + ) + next_page_token = proto.Field( + proto.STRING, + number=4, ) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) - next_page_token = proto.Field(proto.STRING, number=4,) histogram_query_results = proto.RepeatedField( - proto.MESSAGE, number=5, message=histogram.HistogramQueryResult, + proto.MESSAGE, + number=5, + message=histogram.HistogramQueryResult, ) summarized_profiles = proto.RepeatedField( - proto.MESSAGE, number=6, message="SummarizedProfile", + proto.MESSAGE, + number=6, + message="SummarizedProfile", + ) + result_set_id = proto.Field( + proto.STRING, + number=7, ) - result_set_id = proto.Field(proto.STRING, number=7,) class SummarizedProfile(proto.Message): @@ -512,9 +606,15 @@ class SummarizedProfile(proto.Message): """ profiles = proto.RepeatedField( - proto.MESSAGE, number=1, message=gct_profile.Profile, + proto.MESSAGE, + number=1, + message=gct_profile.Profile, + ) + summary = proto.Field( + proto.MESSAGE, + number=2, + message=gct_profile.Profile, ) - summary = proto.Field(proto.MESSAGE, number=2, message=gct_profile.Profile,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/talent_v4beta1/types/tenant.py b/google/cloud/talent_v4beta1/types/tenant.py index 968a3c85..45a3ab50 100644 --- a/google/cloud/talent_v4beta1/types/tenant.py +++ b/google/cloud/talent_v4beta1/types/tenant.py @@ -17,7 +17,10 @@ __protobuf__ = proto.module( - package="google.cloud.talent.v4beta1", manifest={"Tenant",}, + package="google.cloud.talent.v4beta1", + manifest={ + "Tenant", + }, ) @@ -67,11 +70,22 @@ class DataUsageType(proto.Enum): AGGREGATED = 1 ISOLATED = 2 - name = proto.Field(proto.STRING, number=1,) - external_id = proto.Field(proto.STRING, number=2,) - usage_type = proto.Field(proto.ENUM, number=3, enum=DataUsageType,) + name = proto.Field( + proto.STRING, + number=1, + ) + external_id = proto.Field( + proto.STRING, + number=2, + ) + usage_type = proto.Field( + proto.ENUM, + number=3, + enum=DataUsageType, + ) keyword_searchable_profile_custom_attributes = proto.RepeatedField( - proto.STRING, number=4, + proto.STRING, + number=4, ) diff --git a/google/cloud/talent_v4beta1/types/tenant_service.py b/google/cloud/talent_v4beta1/types/tenant_service.py index 5831c6be..78e30c89 100644 --- a/google/cloud/talent_v4beta1/types/tenant_service.py +++ b/google/cloud/talent_v4beta1/types/tenant_service.py @@ -47,8 +47,15 @@ class CreateTenantRequest(proto.Message): Required. The tenant to be created. """ - parent = proto.Field(proto.STRING, number=1,) - tenant = proto.Field(proto.MESSAGE, number=2, message=gct_tenant.Tenant,) + parent = proto.Field( + proto.STRING, + number=1, + ) + tenant = proto.Field( + proto.MESSAGE, + number=2, + message=gct_tenant.Tenant, + ) class GetTenantRequest(proto.Message): @@ -62,7 +69,10 @@ class GetTenantRequest(proto.Message): for example, "projects/foo/tenants/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateTenantRequest(proto.Message): @@ -86,9 +96,15 @@ class UpdateTenantRequest(proto.Message): [Tenant][google.cloud.talent.v4beta1.Tenant] are supported. """ - tenant = proto.Field(proto.MESSAGE, number=1, message=gct_tenant.Tenant,) + tenant = proto.Field( + proto.MESSAGE, + number=1, + message=gct_tenant.Tenant, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -103,7 +119,10 @@ class DeleteTenantRequest(proto.Message): for example, "projects/foo/tenants/bar". """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListTenantsRequest(proto.Message): @@ -125,9 +144,18 @@ class ListTenantsRequest(proto.Message): number is provided. """ - parent = proto.Field(proto.STRING, number=1,) - page_token = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_token = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) class ListTenantsResponse(proto.Message): @@ -147,9 +175,20 @@ class ListTenantsResponse(proto.Message): def raw_page(self): return self - tenants = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_tenant.Tenant,) - next_page_token = proto.Field(proto.STRING, number=2,) - metadata = proto.Field(proto.MESSAGE, number=3, message=common.ResponseMetadata,) + tenants = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_tenant.Tenant, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + metadata = proto.Field( + proto.MESSAGE, + number=3, + message=common.ResponseMetadata, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index 2a2001c4..3addb4ed 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) diff --git a/samples/snippets/job_search_commute_search.py b/samples/snippets/job_search_commute_search.py index 704043c1..1cba53db 100644 --- a/samples/snippets/job_search_commute_search.py +++ b/samples/snippets/job_search_commute_search.py @@ -53,7 +53,9 @@ def search_jobs(project_id, tenant_id): # Iterate over all results results = [] request = talent.SearchJobsRequest( - parent=parent, request_metadata=request_metadata, job_query=job_query, + parent=parent, + request_metadata=request_metadata, + job_query=job_query, ) for response_item in client.search_jobs(request=request).matching_jobs: print(f"Job summary: {response_item.job_summary}") diff --git a/samples/snippets/job_search_create_job.py b/samples/snippets/job_search_create_job.py index 0252a3e0..83c83ea6 100644 --- a/samples/snippets/job_search_create_job.py +++ b/samples/snippets/job_search_create_job.py @@ -19,7 +19,11 @@ def create_job( - project_id, tenant_id, company_id, requisition_id, job_application_url, + project_id, + tenant_id, + company_id, + requisition_id, + job_application_url, ): """Create Job""" diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 85f5836d..25f87a21 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/tests/unit/gapic/talent_v4/test_company_service.py b/tests/unit/gapic/talent_v4/test_company_service.py index 67ee84e4..1a46ce10 100644 --- a/tests/unit/gapic/talent_v4/test_company_service.py +++ b/tests/unit/gapic/talent_v4/test_company_service.py @@ -91,7 +91,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [CompanyServiceClient, CompanyServiceAsyncClient,] + "client_class", + [ + CompanyServiceClient, + CompanyServiceAsyncClient, + ], ) def test_company_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -133,7 +137,11 @@ def test_company_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [CompanyServiceClient, CompanyServiceAsyncClient,] + "client_class", + [ + CompanyServiceClient, + CompanyServiceAsyncClient, + ], ) def test_company_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -497,7 +505,9 @@ def test_company_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -640,10 +650,17 @@ def test_company_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [company_service.CreateCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.CreateCompanyRequest, + dict, + ], +) def test_create_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -698,7 +715,8 @@ def test_create_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -714,7 +732,8 @@ async def test_create_company_async( transport: str = "grpc_asyncio", request_type=company_service.CreateCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -773,7 +792,9 @@ async def test_create_company_async_from_dict(): def test_create_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -793,7 +814,10 @@ def test_create_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -820,11 +844,16 @@ async def test_create_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -833,7 +862,8 @@ def test_create_company_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_company( - parent="parent_value", company=gct_company.Company(name="name_value"), + parent="parent_value", + company=gct_company.Company(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -849,7 +879,9 @@ def test_create_company_flattened(): def test_create_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -876,7 +908,8 @@ async def test_create_company_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_company( - parent="parent_value", company=gct_company.Company(name="name_value"), + parent="parent_value", + company=gct_company.Company(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -907,10 +940,17 @@ async def test_create_company_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [company_service.GetCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.GetCompanyRequest, + dict, + ], +) def test_get_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -965,7 +1005,8 @@ def test_get_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -981,7 +1022,8 @@ async def test_get_company_async( transport: str = "grpc_asyncio", request_type=company_service.GetCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1040,7 +1082,9 @@ async def test_get_company_async_from_dict(): def test_get_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1060,7 +1104,10 @@ def test_get_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1087,11 +1134,16 @@ async def test_get_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1099,7 +1151,9 @@ def test_get_company_flattened(): call.return_value = company.Company() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_company(name="name_value",) + client.get_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1111,13 +1165,16 @@ def test_get_company_flattened(): def test_get_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_company( - company_service.GetCompanyRequest(), name="name_value", + company_service.GetCompanyRequest(), + name="name_value", ) @@ -1135,7 +1192,9 @@ async def test_get_company_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(company.Company()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_company(name="name_value",) + response = await client.get_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1156,14 +1215,22 @@ async def test_get_company_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_company( - company_service.GetCompanyRequest(), name="name_value", + company_service.GetCompanyRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [company_service.UpdateCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.UpdateCompanyRequest, + dict, + ], +) def test_update_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1218,7 +1285,8 @@ def test_update_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1234,7 +1302,8 @@ async def test_update_company_async( transport: str = "grpc_asyncio", request_type=company_service.UpdateCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1293,7 +1362,9 @@ async def test_update_company_async_from_dict(): def test_update_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1313,9 +1384,10 @@ def test_update_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "company.name=company.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "company.name=company.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1342,13 +1414,16 @@ async def test_update_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "company.name=company.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "company.name=company.name/value", + ) in kw["metadata"] def test_update_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1374,7 +1449,9 @@ def test_update_company_flattened(): def test_update_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1433,10 +1510,17 @@ async def test_update_company_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [company_service.DeleteCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.DeleteCompanyRequest, + dict, + ], +) def test_delete_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1462,7 +1546,8 @@ def test_delete_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1478,7 +1563,8 @@ async def test_delete_company_async( transport: str = "grpc_asyncio", request_type=company_service.DeleteCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1506,7 +1592,9 @@ async def test_delete_company_async_from_dict(): def test_delete_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1526,7 +1614,10 @@ def test_delete_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1553,11 +1644,16 @@ async def test_delete_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1565,7 +1661,9 @@ def test_delete_company_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_company(name="name_value",) + client.delete_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1577,13 +1675,16 @@ def test_delete_company_flattened(): def test_delete_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_company( - company_service.DeleteCompanyRequest(), name="name_value", + company_service.DeleteCompanyRequest(), + name="name_value", ) @@ -1601,7 +1702,9 @@ async def test_delete_company_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_company(name="name_value",) + response = await client.delete_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1622,14 +1725,22 @@ async def test_delete_company_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_company( - company_service.DeleteCompanyRequest(), name="name_value", + company_service.DeleteCompanyRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [company_service.ListCompaniesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.ListCompaniesRequest, + dict, + ], +) def test_list_companies(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1658,7 +1769,8 @@ def test_list_companies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1674,7 +1786,8 @@ async def test_list_companies_async( transport: str = "grpc_asyncio", request_type=company_service.ListCompaniesRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1707,7 +1820,9 @@ async def test_list_companies_async_from_dict(): def test_list_companies_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1727,7 +1842,10 @@ def test_list_companies_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1756,11 +1874,16 @@ async def test_list_companies_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_companies_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1768,7 +1891,9 @@ def test_list_companies_flattened(): call.return_value = company_service.ListCompaniesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_companies(parent="parent_value",) + client.list_companies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1780,13 +1905,16 @@ def test_list_companies_flattened(): def test_list_companies_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_companies( - company_service.ListCompaniesRequest(), parent="parent_value", + company_service.ListCompaniesRequest(), + parent="parent_value", ) @@ -1806,7 +1934,9 @@ async def test_list_companies_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_companies(parent="parent_value",) + response = await client.list_companies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1827,13 +1957,15 @@ async def test_list_companies_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_companies( - company_service.ListCompaniesRequest(), parent="parent_value", + company_service.ListCompaniesRequest(), + parent="parent_value", ) def test_list_companies_pager(transport_name: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1841,15 +1973,28 @@ def test_list_companies_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1869,7 +2014,8 @@ def test_list_companies_pager(transport_name: str = "grpc"): def test_list_companies_pages(transport_name: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1877,15 +2023,28 @@ def test_list_companies_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1896,7 +2055,9 @@ def test_list_companies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_companies_async_pager(): - client = CompanyServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CompanyServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1905,19 +2066,34 @@ async def test_list_companies_async_pager(): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) - async_pager = await client.list_companies(request={},) + async_pager = await client.list_companies( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1929,7 +2105,9 @@ async def test_list_companies_async_pager(): @pytest.mark.asyncio async def test_list_companies_async_pages(): - client = CompanyServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CompanyServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1938,15 +2116,28 @@ async def test_list_companies_async_pages(): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1964,7 +2155,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -1984,7 +2176,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CompanyServiceClient(client_options=options, transport=transport,) + client = CompanyServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -2000,7 +2195,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompanyServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -2045,8 +2241,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CompanyServiceGrpcTransport,) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CompanyServiceGrpcTransport, + ) def test_company_service_base_transport_error(): @@ -2095,7 +2296,8 @@ def test_company_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CompanyServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2263,7 +2465,8 @@ def test_company_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CompanyServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2275,7 +2478,8 @@ def test_company_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CompanyServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2387,7 +2591,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = CompanyServiceClient.company_path(project, tenant, company) assert expected == actual @@ -2410,7 +2616,8 @@ def test_tenant_path(): project = "cuttlefish" tenant = "mussel" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = CompanyServiceClient.tenant_path(project, tenant) assert expected == actual @@ -2450,7 +2657,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "squid" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CompanyServiceClient.common_folder_path(folder) assert expected == actual @@ -2468,7 +2677,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "whelk" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CompanyServiceClient.common_organization_path(organization) assert expected == actual @@ -2486,7 +2697,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "oyster" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CompanyServiceClient.common_project_path(project) assert expected == actual @@ -2506,7 +2719,8 @@ def test_common_location_path(): project = "cuttlefish" location = "mussel" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CompanyServiceClient.common_location_path(project, location) assert expected == actual @@ -2531,7 +2745,8 @@ def test_client_with_default_client_info(): transports.CompanyServiceTransport, "_prep_wrapped_messages" ) as prep: client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2540,7 +2755,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CompanyServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2548,7 +2764,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4/test_completion.py b/tests/unit/gapic/talent_v4/test_completion.py index 0b03499c..06c4f770 100644 --- a/tests/unit/gapic/talent_v4/test_completion.py +++ b/tests/unit/gapic/talent_v4/test_completion.py @@ -81,7 +81,13 @@ def test__get_default_mtls_endpoint(): assert CompletionClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [CompletionClient, CompletionAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CompletionClient, + CompletionAsyncClient, + ], +) def test_completion_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -121,7 +127,13 @@ def test_completion_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [CompletionClient, CompletionAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CompletionClient, + CompletionAsyncClient, + ], +) def test_completion_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -476,7 +488,9 @@ def test_completion_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -608,11 +622,16 @@ def test_completion_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [completion_service.CompleteQueryRequest, dict,] + "request_type", + [ + completion_service.CompleteQueryRequest, + dict, + ], ) def test_complete_query(request_type, transport: str = "grpc"): client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -638,7 +657,8 @@ def test_complete_query_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -655,7 +675,8 @@ async def test_complete_query_async( request_type=completion_service.CompleteQueryRequest, ): client = CompletionAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -685,7 +706,9 @@ async def test_complete_query_async_from_dict(): def test_complete_query_field_headers(): - client = CompletionClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompletionClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -705,12 +728,17 @@ def test_complete_query_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant=tenant/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant=tenant/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_complete_query_field_headers_async(): - client = CompletionAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompletionAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -732,7 +760,10 @@ async def test_complete_query_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant=tenant/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant=tenant/value", + ) in kw["metadata"] def test_credentials_transport_error(): @@ -742,7 +773,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -762,7 +794,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CompletionClient(client_options=options, transport=transport,) + client = CompletionClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -778,7 +813,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompletionClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -808,7 +844,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.CompletionGrpcTransport, transports.CompletionGrpcAsyncIOTransport,], + [ + transports.CompletionGrpcTransport, + transports.CompletionGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -820,8 +859,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CompletionClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CompletionGrpcTransport,) + client = CompletionClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CompletionGrpcTransport, + ) def test_completion_base_transport_error(): @@ -864,7 +908,8 @@ def test_completion_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CompletionTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -905,7 +950,10 @@ def test_completion_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.CompletionGrpcTransport, transports.CompletionGrpcAsyncIOTransport,], + [ + transports.CompletionGrpcTransport, + transports.CompletionGrpcAsyncIOTransport, + ], ) def test_completion_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -1026,7 +1074,8 @@ def test_completion_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CompletionGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1038,7 +1087,8 @@ def test_completion_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CompletionGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1142,7 +1192,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = CompletionClient.company_path(project, tenant, company) assert expected == actual @@ -1165,7 +1217,8 @@ def test_tenant_path(): project = "cuttlefish" tenant = "mussel" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = CompletionClient.tenant_path(project, tenant) assert expected == actual @@ -1205,7 +1258,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "squid" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CompletionClient.common_folder_path(folder) assert expected == actual @@ -1223,7 +1278,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "whelk" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CompletionClient.common_organization_path(organization) assert expected == actual @@ -1241,7 +1298,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "oyster" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CompletionClient.common_project_path(project) assert expected == actual @@ -1261,7 +1320,8 @@ def test_common_location_path(): project = "cuttlefish" location = "mussel" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CompletionClient.common_location_path(project, location) assert expected == actual @@ -1286,7 +1346,8 @@ def test_client_with_default_client_info(): transports.CompletionTransport, "_prep_wrapped_messages" ) as prep: client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1295,7 +1356,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CompletionClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1303,7 +1365,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CompletionAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4/test_event_service.py b/tests/unit/gapic/talent_v4/test_event_service.py index 72ae64c3..80820cc6 100644 --- a/tests/unit/gapic/talent_v4/test_event_service.py +++ b/tests/unit/gapic/talent_v4/test_event_service.py @@ -82,7 +82,13 @@ def test__get_default_mtls_endpoint(): assert EventServiceClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [EventServiceClient, EventServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + EventServiceClient, + EventServiceAsyncClient, + ], +) def test_event_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -122,7 +128,13 @@ def test_event_service_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [EventServiceClient, EventServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + EventServiceClient, + EventServiceAsyncClient, + ], +) def test_event_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -477,7 +489,9 @@ def test_event_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -619,11 +633,16 @@ def test_event_service_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [event_service.CreateClientEventRequest, dict,] + "request_type", + [ + event_service.CreateClientEventRequest, + dict, + ], ) def test_create_client_event(request_type, transport: str = "grpc"): client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -659,7 +678,8 @@ def test_create_client_event_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -677,7 +697,8 @@ async def test_create_client_event_async( transport: str = "grpc_asyncio", request_type=event_service.CreateClientEventRequest ): client = EventServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -716,7 +737,9 @@ async def test_create_client_event_async_from_dict(): def test_create_client_event_field_headers(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -738,12 +761,17 @@ def test_create_client_event_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_client_event_field_headers_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -765,11 +793,16 @@ async def test_create_client_event_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_client_event_flattened(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -797,7 +830,9 @@ def test_create_client_event_flattened(): def test_create_client_event_flattened_error(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -811,7 +846,9 @@ def test_create_client_event_flattened_error(): @pytest.mark.asyncio async def test_create_client_event_flattened_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -842,7 +879,9 @@ async def test_create_client_event_flattened_async(): @pytest.mark.asyncio async def test_create_client_event_flattened_error_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -861,7 +900,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -881,7 +921,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = EventServiceClient(client_options=options, transport=transport,) + client = EventServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -897,7 +940,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = EventServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -942,8 +986,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.EventServiceGrpcTransport,) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.EventServiceGrpcTransport, + ) def test_event_service_base_transport_error(): @@ -986,7 +1035,8 @@ def test_event_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.EventServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -1151,7 +1201,8 @@ def test_event_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.EventServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1163,7 +1214,8 @@ def test_event_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.EventServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1266,7 +1318,8 @@ def test_tenant_path(): project = "squid" tenant = "clam" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = EventServiceClient.tenant_path(project, tenant) assert expected == actual @@ -1306,7 +1359,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "cuttlefish" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = EventServiceClient.common_folder_path(folder) assert expected == actual @@ -1324,7 +1379,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "winkle" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = EventServiceClient.common_organization_path(organization) assert expected == actual @@ -1342,7 +1399,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "scallop" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = EventServiceClient.common_project_path(project) assert expected == actual @@ -1362,7 +1421,8 @@ def test_common_location_path(): project = "squid" location = "clam" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = EventServiceClient.common_location_path(project, location) assert expected == actual @@ -1387,7 +1447,8 @@ def test_client_with_default_client_info(): transports.EventServiceTransport, "_prep_wrapped_messages" ) as prep: client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1396,7 +1457,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = EventServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1404,7 +1466,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = EventServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4/test_job_service.py b/tests/unit/gapic/talent_v4/test_job_service.py index 3aaeedb5..308f7df0 100644 --- a/tests/unit/gapic/talent_v4/test_job_service.py +++ b/tests/unit/gapic/talent_v4/test_job_service.py @@ -99,7 +99,13 @@ def test__get_default_mtls_endpoint(): assert JobServiceClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [JobServiceClient, JobServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + JobServiceClient, + JobServiceAsyncClient, + ], +) def test_job_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -139,7 +145,13 @@ def test_job_service_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [JobServiceClient, JobServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + JobServiceClient, + JobServiceAsyncClient, + ], +) def test_job_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -494,7 +506,9 @@ def test_job_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -625,10 +639,17 @@ def test_job_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [job_service.CreateJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.CreateJobRequest, + dict, + ], +) def test_create_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -693,7 +714,8 @@ def test_create_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -709,7 +731,8 @@ async def test_create_job_async( transport: str = "grpc_asyncio", request_type=job_service.CreateJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -778,7 +801,9 @@ async def test_create_job_async_from_dict(): def test_create_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -798,12 +823,17 @@ def test_create_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -823,11 +853,16 @@ async def test_create_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -836,7 +871,8 @@ def test_create_job_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_job( - parent="parent_value", job=gct_job.Job(name="name_value"), + parent="parent_value", + job=gct_job.Job(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -852,7 +888,9 @@ def test_create_job_flattened(): def test_create_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -866,7 +904,9 @@ def test_create_job_flattened_error(): @pytest.mark.asyncio async def test_create_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -877,7 +917,8 @@ async def test_create_job_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_job( - parent="parent_value", job=gct_job.Job(name="name_value"), + parent="parent_value", + job=gct_job.Job(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -894,7 +935,9 @@ async def test_create_job_flattened_async(): @pytest.mark.asyncio async def test_create_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -906,10 +949,17 @@ async def test_create_job_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.BatchCreateJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchCreateJobsRequest, + dict, + ], +) def test_batch_create_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -937,7 +987,8 @@ def test_batch_create_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -955,7 +1006,8 @@ async def test_batch_create_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchCreateJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -987,7 +1039,9 @@ async def test_batch_create_jobs_async_from_dict(): def test_batch_create_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1009,12 +1063,17 @@ def test_batch_create_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_create_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1038,11 +1097,16 @@ async def test_batch_create_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_create_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1053,7 +1117,8 @@ def test_batch_create_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_create_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1069,7 +1134,9 @@ def test_batch_create_jobs_flattened(): def test_batch_create_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1083,7 +1150,9 @@ def test_batch_create_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_create_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1098,7 +1167,8 @@ async def test_batch_create_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_create_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1115,7 +1185,9 @@ async def test_batch_create_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_create_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1127,10 +1199,17 @@ async def test_batch_create_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.GetJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.GetJobRequest, + dict, + ], +) def test_get_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1195,7 +1274,8 @@ def test_get_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1211,7 +1291,8 @@ async def test_get_job_async( transport: str = "grpc_asyncio", request_type=job_service.GetJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1280,7 +1361,9 @@ async def test_get_job_async_from_dict(): def test_get_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1300,12 +1383,17 @@ def test_get_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1325,11 +1413,16 @@ async def test_get_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1337,7 +1430,9 @@ def test_get_job_flattened(): call.return_value = job.Job() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_job(name="name_value",) + client.get_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1349,19 +1444,24 @@ def test_get_job_flattened(): def test_get_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_job( - job_service.GetJobRequest(), name="name_value", + job_service.GetJobRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1371,7 +1471,9 @@ async def test_get_job_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(job.Job()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_job(name="name_value",) + response = await client.get_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1384,20 +1486,30 @@ async def test_get_job_flattened_async(): @pytest.mark.asyncio async def test_get_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_job( - job_service.GetJobRequest(), name="name_value", + job_service.GetJobRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [job_service.UpdateJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.UpdateJobRequest, + dict, + ], +) def test_update_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1462,7 +1574,8 @@ def test_update_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1478,7 +1591,8 @@ async def test_update_job_async( transport: str = "grpc_asyncio", request_type=job_service.UpdateJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1547,7 +1661,9 @@ async def test_update_job_async_from_dict(): def test_update_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1567,12 +1683,17 @@ def test_update_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "job.name=job.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "job.name=job.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1592,11 +1713,16 @@ async def test_update_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "job.name=job.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "job.name=job.name/value", + ) in kw["metadata"] def test_update_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1622,7 +1748,9 @@ def test_update_job_flattened(): def test_update_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1636,7 +1764,9 @@ def test_update_job_flattened_error(): @pytest.mark.asyncio async def test_update_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1665,7 +1795,9 @@ async def test_update_job_flattened_async(): @pytest.mark.asyncio async def test_update_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1677,10 +1809,17 @@ async def test_update_job_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.BatchUpdateJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchUpdateJobsRequest, + dict, + ], +) def test_batch_update_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1708,7 +1847,8 @@ def test_batch_update_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1726,7 +1866,8 @@ async def test_batch_update_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchUpdateJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1758,7 +1899,9 @@ async def test_batch_update_jobs_async_from_dict(): def test_batch_update_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1780,12 +1923,17 @@ def test_batch_update_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_update_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1809,11 +1957,16 @@ async def test_batch_update_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_update_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1824,7 +1977,8 @@ def test_batch_update_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_update_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1840,7 +1994,9 @@ def test_batch_update_jobs_flattened(): def test_batch_update_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1854,7 +2010,9 @@ def test_batch_update_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_update_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1869,7 +2027,8 @@ async def test_batch_update_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_update_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1886,7 +2045,9 @@ async def test_batch_update_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_update_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1898,10 +2059,17 @@ async def test_batch_update_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.DeleteJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.DeleteJobRequest, + dict, + ], +) def test_delete_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1927,7 +2095,8 @@ def test_delete_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1943,7 +2112,8 @@ async def test_delete_job_async( transport: str = "grpc_asyncio", request_type=job_service.DeleteJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1971,7 +2141,9 @@ async def test_delete_job_async_from_dict(): def test_delete_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1991,12 +2163,17 @@ def test_delete_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2016,11 +2193,16 @@ async def test_delete_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2028,7 +2210,9 @@ def test_delete_job_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_job(name="name_value",) + client.delete_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2040,19 +2224,24 @@ def test_delete_job_flattened(): def test_delete_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_job( - job_service.DeleteJobRequest(), name="name_value", + job_service.DeleteJobRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2062,7 +2251,9 @@ async def test_delete_job_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_job(name="name_value",) + response = await client.delete_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2075,20 +2266,30 @@ async def test_delete_job_flattened_async(): @pytest.mark.asyncio async def test_delete_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_job( - job_service.DeleteJobRequest(), name="name_value", + job_service.DeleteJobRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [job_service.BatchDeleteJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchDeleteJobsRequest, + dict, + ], +) def test_batch_delete_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2116,7 +2317,8 @@ def test_batch_delete_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2134,7 +2336,8 @@ async def test_batch_delete_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchDeleteJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2166,7 +2369,9 @@ async def test_batch_delete_jobs_async_from_dict(): def test_batch_delete_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2188,12 +2393,17 @@ def test_batch_delete_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_delete_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2217,11 +2427,16 @@ async def test_batch_delete_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_delete_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2232,7 +2447,8 @@ def test_batch_delete_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_delete_jobs( - parent="parent_value", names=["names_value"], + parent="parent_value", + names=["names_value"], ) # Establish that the underlying call was made with the expected @@ -2248,7 +2464,9 @@ def test_batch_delete_jobs_flattened(): def test_batch_delete_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2262,7 +2480,9 @@ def test_batch_delete_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_delete_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2277,7 +2497,8 @@ async def test_batch_delete_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_delete_jobs( - parent="parent_value", names=["names_value"], + parent="parent_value", + names=["names_value"], ) # Establish that the underlying call was made with the expected @@ -2294,7 +2515,9 @@ async def test_batch_delete_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_delete_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2306,10 +2529,17 @@ async def test_batch_delete_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.ListJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.ListJobsRequest, + dict, + ], +) def test_list_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2338,7 +2568,8 @@ def test_list_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2354,7 +2585,8 @@ async def test_list_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.ListJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2365,7 +2597,9 @@ async def test_list_jobs_async( with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - job_service.ListJobsResponse(next_page_token="next_page_token_value",) + job_service.ListJobsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_jobs(request) @@ -2385,7 +2619,9 @@ async def test_list_jobs_async_from_dict(): def test_list_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2405,12 +2641,17 @@ def test_list_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2432,11 +2673,16 @@ async def test_list_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2445,7 +2691,8 @@ def test_list_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.list_jobs( - parent="parent_value", filter="filter_value", + parent="parent_value", + filter="filter_value", ) # Establish that the underlying call was made with the expected @@ -2461,19 +2708,25 @@ def test_list_jobs_flattened(): def test_list_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_jobs( - job_service.ListJobsRequest(), parent="parent_value", filter="filter_value", + job_service.ListJobsRequest(), + parent="parent_value", + filter="filter_value", ) @pytest.mark.asyncio async def test_list_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2485,7 +2738,10 @@ async def test_list_jobs_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_jobs(parent="parent_value", filter="filter_value",) + response = await client.list_jobs( + parent="parent_value", + filter="filter_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2501,19 +2757,24 @@ async def test_list_jobs_flattened_async(): @pytest.mark.asyncio async def test_list_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_jobs( - job_service.ListJobsRequest(), parent="parent_value", filter="filter_value", + job_service.ListJobsRequest(), + parent="parent_value", + filter="filter_value", ) def test_list_jobs_pager(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2521,11 +2782,29 @@ def test_list_jobs_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) @@ -2544,7 +2823,8 @@ def test_list_jobs_pager(transport_name: str = "grpc"): def test_list_jobs_pages(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2552,11 +2832,29 @@ def test_list_jobs_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) pages = list(client.list_jobs(request={}).pages) @@ -2566,7 +2864,9 @@ def test_list_jobs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_jobs_async_pager(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2575,14 +2875,34 @@ async def test_list_jobs_async_pager(): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) - async_pager = await client.list_jobs(request={},) + async_pager = await client.list_jobs( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2594,7 +2914,9 @@ async def test_list_jobs_async_pager(): @pytest.mark.asyncio async def test_list_jobs_async_pages(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2603,11 +2925,29 @@ async def test_list_jobs_async_pages(): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) pages = [] @@ -2617,10 +2957,17 @@ async def test_list_jobs_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [job_service.SearchJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.SearchJobsRequest, + dict, + ], +) def test_search_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2654,7 +3001,8 @@ def test_search_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2670,7 +3018,8 @@ async def test_search_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.SearchJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2707,7 +3056,9 @@ async def test_search_jobs_async_from_dict(): def test_search_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2727,12 +3078,17 @@ def test_search_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_search_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2754,13 +3110,23 @@ async def test_search_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] -@pytest.mark.parametrize("request_type", [job_service.SearchJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.SearchJobsRequest, + dict, + ], +) def test_search_jobs_for_alert(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2796,7 +3162,8 @@ def test_search_jobs_for_alert_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2814,7 +3181,8 @@ async def test_search_jobs_for_alert_async( transport: str = "grpc_asyncio", request_type=job_service.SearchJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2853,7 +3221,9 @@ async def test_search_jobs_for_alert_async_from_dict(): def test_search_jobs_for_alert_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2875,12 +3245,17 @@ def test_search_jobs_for_alert_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_search_jobs_for_alert_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2904,7 +3279,10 @@ async def test_search_jobs_for_alert_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_credentials_transport_error(): @@ -2914,7 +3292,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -2934,7 +3313,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = JobServiceClient(client_options=options, transport=transport,) + client = JobServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -2950,7 +3332,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = JobServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -2980,7 +3363,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.JobServiceGrpcTransport, transports.JobServiceGrpcAsyncIOTransport,], + [ + transports.JobServiceGrpcTransport, + transports.JobServiceGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -2992,8 +3378,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.JobServiceGrpcTransport,) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.JobServiceGrpcTransport, + ) def test_job_service_base_transport_error(): @@ -3052,7 +3443,8 @@ def test_job_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.JobServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -3093,7 +3485,10 @@ def test_job_service_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.JobServiceGrpcTransport, transports.JobServiceGrpcAsyncIOTransport,], + [ + transports.JobServiceGrpcTransport, + transports.JobServiceGrpcAsyncIOTransport, + ], ) def test_job_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -3214,7 +3609,8 @@ def test_job_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.JobServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -3226,7 +3622,8 @@ def test_job_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.JobServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -3327,12 +3724,16 @@ def test_job_service_transport_channel_mtls_with_adc(transport_class): def test_job_service_grpc_lro_client(): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -3340,12 +3741,16 @@ def test_job_service_grpc_lro_client(): def test_job_service_grpc_lro_async_client(): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -3356,7 +3761,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = JobServiceClient.company_path(project, tenant, company) assert expected == actual @@ -3380,7 +3787,9 @@ def test_job_path(): tenant = "mussel" job = "winkle" expected = "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) actual = JobServiceClient.job_path(project, tenant, job) assert expected == actual @@ -3403,7 +3812,8 @@ def test_tenant_path(): project = "squid" tenant = "clam" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = JobServiceClient.tenant_path(project, tenant) assert expected == actual @@ -3443,7 +3853,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "cuttlefish" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = JobServiceClient.common_folder_path(folder) assert expected == actual @@ -3461,7 +3873,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "winkle" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = JobServiceClient.common_organization_path(organization) assert expected == actual @@ -3479,7 +3893,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "scallop" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = JobServiceClient.common_project_path(project) assert expected == actual @@ -3499,7 +3915,8 @@ def test_common_location_path(): project = "squid" location = "clam" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = JobServiceClient.common_location_path(project, location) assert expected == actual @@ -3524,7 +3941,8 @@ def test_client_with_default_client_info(): transports.JobServiceTransport, "_prep_wrapped_messages" ) as prep: client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3533,7 +3951,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = JobServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3541,7 +3960,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4/test_tenant_service.py b/tests/unit/gapic/talent_v4/test_tenant_service.py index f656c072..a35c64d3 100644 --- a/tests/unit/gapic/talent_v4/test_tenant_service.py +++ b/tests/unit/gapic/talent_v4/test_tenant_service.py @@ -88,7 +88,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [TenantServiceClient, TenantServiceAsyncClient,] + "client_class", + [ + TenantServiceClient, + TenantServiceAsyncClient, + ], ) def test_tenant_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -130,7 +134,11 @@ def test_tenant_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [TenantServiceClient, TenantServiceAsyncClient,] + "client_class", + [ + TenantServiceClient, + TenantServiceAsyncClient, + ], ) def test_tenant_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -494,7 +502,9 @@ def test_tenant_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -637,10 +647,17 @@ def test_tenant_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [tenant_service.CreateTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.CreateTenantRequest, + dict, + ], +) def test_create_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -651,7 +668,8 @@ def test_create_tenant(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gct_tenant.Tenant( - name="name_value", external_id="external_id_value", + name="name_value", + external_id="external_id_value", ) response = client.create_tenant(request) @@ -670,7 +688,8 @@ def test_create_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -686,7 +705,8 @@ async def test_create_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.CreateTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -697,7 +717,10 @@ async def test_create_tenant_async( with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_tenant.Tenant(name="name_value", external_id="external_id_value",) + gct_tenant.Tenant( + name="name_value", + external_id="external_id_value", + ) ) response = await client.create_tenant(request) @@ -718,7 +741,9 @@ async def test_create_tenant_async_from_dict(): def test_create_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -738,7 +763,10 @@ def test_create_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -765,11 +793,16 @@ async def test_create_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -778,7 +811,8 @@ def test_create_tenant_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_tenant( - parent="parent_value", tenant=gct_tenant.Tenant(name="name_value"), + parent="parent_value", + tenant=gct_tenant.Tenant(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -794,7 +828,9 @@ def test_create_tenant_flattened(): def test_create_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -821,7 +857,8 @@ async def test_create_tenant_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_tenant( - parent="parent_value", tenant=gct_tenant.Tenant(name="name_value"), + parent="parent_value", + tenant=gct_tenant.Tenant(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -852,10 +889,17 @@ async def test_create_tenant_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [tenant_service.GetTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.GetTenantRequest, + dict, + ], +) def test_get_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -866,7 +910,8 @@ def test_get_tenant(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = tenant.Tenant( - name="name_value", external_id="external_id_value", + name="name_value", + external_id="external_id_value", ) response = client.get_tenant(request) @@ -885,7 +930,8 @@ def test_get_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -901,7 +947,8 @@ async def test_get_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.GetTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -912,7 +959,10 @@ async def test_get_tenant_async( with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tenant.Tenant(name="name_value", external_id="external_id_value",) + tenant.Tenant( + name="name_value", + external_id="external_id_value", + ) ) response = await client.get_tenant(request) @@ -933,7 +983,9 @@ async def test_get_tenant_async_from_dict(): def test_get_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -953,7 +1005,10 @@ def test_get_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -980,11 +1035,16 @@ async def test_get_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -992,7 +1052,9 @@ def test_get_tenant_flattened(): call.return_value = tenant.Tenant() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_tenant(name="name_value",) + client.get_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1004,13 +1066,16 @@ def test_get_tenant_flattened(): def test_get_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_tenant( - tenant_service.GetTenantRequest(), name="name_value", + tenant_service.GetTenantRequest(), + name="name_value", ) @@ -1028,7 +1093,9 @@ async def test_get_tenant_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(tenant.Tenant()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_tenant(name="name_value",) + response = await client.get_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1049,14 +1116,22 @@ async def test_get_tenant_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_tenant( - tenant_service.GetTenantRequest(), name="name_value", + tenant_service.GetTenantRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [tenant_service.UpdateTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.UpdateTenantRequest, + dict, + ], +) def test_update_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1067,7 +1142,8 @@ def test_update_tenant(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gct_tenant.Tenant( - name="name_value", external_id="external_id_value", + name="name_value", + external_id="external_id_value", ) response = client.update_tenant(request) @@ -1086,7 +1162,8 @@ def test_update_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1102,7 +1179,8 @@ async def test_update_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.UpdateTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1113,7 +1191,10 @@ async def test_update_tenant_async( with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_tenant.Tenant(name="name_value", external_id="external_id_value",) + gct_tenant.Tenant( + name="name_value", + external_id="external_id_value", + ) ) response = await client.update_tenant(request) @@ -1134,7 +1215,9 @@ async def test_update_tenant_async_from_dict(): def test_update_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1154,7 +1237,10 @@ def test_update_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant.name=tenant.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant.name=tenant.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1181,11 +1267,16 @@ async def test_update_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant.name=tenant.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant.name=tenant.name/value", + ) in kw["metadata"] def test_update_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1211,7 +1302,9 @@ def test_update_tenant_flattened(): def test_update_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1270,10 +1363,17 @@ async def test_update_tenant_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [tenant_service.DeleteTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.DeleteTenantRequest, + dict, + ], +) def test_delete_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1299,7 +1399,8 @@ def test_delete_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1315,7 +1416,8 @@ async def test_delete_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.DeleteTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1343,7 +1445,9 @@ async def test_delete_tenant_async_from_dict(): def test_delete_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1363,7 +1467,10 @@ def test_delete_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1390,11 +1497,16 @@ async def test_delete_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1402,7 +1514,9 @@ def test_delete_tenant_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_tenant(name="name_value",) + client.delete_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1414,13 +1528,16 @@ def test_delete_tenant_flattened(): def test_delete_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tenant( - tenant_service.DeleteTenantRequest(), name="name_value", + tenant_service.DeleteTenantRequest(), + name="name_value", ) @@ -1438,7 +1555,9 @@ async def test_delete_tenant_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tenant(name="name_value",) + response = await client.delete_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1459,14 +1578,22 @@ async def test_delete_tenant_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_tenant( - tenant_service.DeleteTenantRequest(), name="name_value", + tenant_service.DeleteTenantRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [tenant_service.ListTenantsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.ListTenantsRequest, + dict, + ], +) def test_list_tenants(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1495,7 +1622,8 @@ def test_list_tenants_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1511,7 +1639,8 @@ async def test_list_tenants_async( transport: str = "grpc_asyncio", request_type=tenant_service.ListTenantsRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1522,7 +1651,9 @@ async def test_list_tenants_async( with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tenant_service.ListTenantsResponse(next_page_token="next_page_token_value",) + tenant_service.ListTenantsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tenants(request) @@ -1542,7 +1673,9 @@ async def test_list_tenants_async_from_dict(): def test_list_tenants_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1562,7 +1695,10 @@ def test_list_tenants_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1591,11 +1727,16 @@ async def test_list_tenants_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tenants_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1603,7 +1744,9 @@ def test_list_tenants_flattened(): call.return_value = tenant_service.ListTenantsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tenants(parent="parent_value",) + client.list_tenants( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1615,13 +1758,16 @@ def test_list_tenants_flattened(): def test_list_tenants_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tenants( - tenant_service.ListTenantsRequest(), parent="parent_value", + tenant_service.ListTenantsRequest(), + parent="parent_value", ) @@ -1641,7 +1787,9 @@ async def test_list_tenants_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tenants(parent="parent_value",) + response = await client.list_tenants( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1662,13 +1810,15 @@ async def test_list_tenants_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_tenants( - tenant_service.ListTenantsRequest(), parent="parent_value", + tenant_service.ListTenantsRequest(), + parent="parent_value", ) def test_list_tenants_pager(transport_name: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1676,15 +1826,28 @@ def test_list_tenants_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1704,7 +1867,8 @@ def test_list_tenants_pager(transport_name: str = "grpc"): def test_list_tenants_pages(transport_name: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1712,15 +1876,28 @@ def test_list_tenants_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1731,7 +1908,9 @@ def test_list_tenants_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tenants_async_pager(): - client = TenantServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = TenantServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1740,19 +1919,34 @@ async def test_list_tenants_async_pager(): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) - async_pager = await client.list_tenants(request={},) + async_pager = await client.list_tenants( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1764,7 +1958,9 @@ async def test_list_tenants_async_pager(): @pytest.mark.asyncio async def test_list_tenants_async_pages(): - client = TenantServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = TenantServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1773,15 +1969,28 @@ async def test_list_tenants_async_pages(): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1799,7 +2008,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -1819,7 +2029,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = TenantServiceClient(client_options=options, transport=transport,) + client = TenantServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -1835,7 +2048,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = TenantServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -1880,8 +2094,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.TenantServiceGrpcTransport,) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.TenantServiceGrpcTransport, + ) def test_tenant_service_base_transport_error(): @@ -1930,7 +2149,8 @@ def test_tenant_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.TenantServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2098,7 +2318,8 @@ def test_tenant_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.TenantServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2110,7 +2331,8 @@ def test_tenant_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.TenantServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2219,7 +2441,8 @@ def test_tenant_path(): project = "squid" tenant = "clam" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = TenantServiceClient.tenant_path(project, tenant) assert expected == actual @@ -2259,7 +2482,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "cuttlefish" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = TenantServiceClient.common_folder_path(folder) assert expected == actual @@ -2277,7 +2502,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "winkle" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = TenantServiceClient.common_organization_path(organization) assert expected == actual @@ -2295,7 +2522,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "scallop" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = TenantServiceClient.common_project_path(project) assert expected == actual @@ -2315,7 +2544,8 @@ def test_common_location_path(): project = "squid" location = "clam" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = TenantServiceClient.common_location_path(project, location) assert expected == actual @@ -2340,7 +2570,8 @@ def test_client_with_default_client_info(): transports.TenantServiceTransport, "_prep_wrapped_messages" ) as prep: client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2349,7 +2580,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = TenantServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2357,7 +2589,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_application_service.py b/tests/unit/gapic/talent_v4beta1/test_application_service.py index f4e7da09..dd233ebc 100644 --- a/tests/unit/gapic/talent_v4beta1/test_application_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_application_service.py @@ -97,7 +97,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ApplicationServiceClient, ApplicationServiceAsyncClient,] + "client_class", + [ + ApplicationServiceClient, + ApplicationServiceAsyncClient, + ], ) def test_application_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -139,7 +143,11 @@ def test_application_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [ApplicationServiceClient, ApplicationServiceAsyncClient,] + "client_class", + [ + ApplicationServiceClient, + ApplicationServiceAsyncClient, + ], ) def test_application_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -513,7 +521,9 @@ def test_application_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -657,11 +667,16 @@ def test_application_service_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [application_service.CreateApplicationRequest, dict,] + "request_type", + [ + application_service.CreateApplicationRequest, + dict, + ], ) def test_create_application(request_type, transport: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -710,7 +725,8 @@ def test_create_application_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -729,7 +745,8 @@ async def test_create_application_async( request_type=application_service.CreateApplicationRequest, ): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -806,7 +823,10 @@ def test_create_application_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -837,7 +857,10 @@ async def test_create_application_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_application_flattened(): @@ -937,11 +960,16 @@ async def test_create_application_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [application_service.GetApplicationRequest, dict,] + "request_type", + [ + application_service.GetApplicationRequest, + dict, + ], ) def test_get_application(request_type, transport: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -988,7 +1016,8 @@ def test_get_application_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1005,7 +1034,8 @@ async def test_get_application_async( request_type=application_service.GetApplicationRequest, ): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1078,7 +1108,10 @@ def test_get_application_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1107,7 +1140,10 @@ async def test_get_application_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_application_flattened(): @@ -1121,7 +1157,9 @@ def test_get_application_flattened(): call.return_value = application.Application() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_application(name="name_value",) + client.get_application( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1141,7 +1179,8 @@ def test_get_application_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.get_application( - application_service.GetApplicationRequest(), name="name_value", + application_service.GetApplicationRequest(), + name="name_value", ) @@ -1161,7 +1200,9 @@ async def test_get_application_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_application(name="name_value",) + response = await client.get_application( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1182,16 +1223,22 @@ async def test_get_application_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_application( - application_service.GetApplicationRequest(), name="name_value", + application_service.GetApplicationRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [application_service.UpdateApplicationRequest, dict,] + "request_type", + [ + application_service.UpdateApplicationRequest, + dict, + ], ) def test_update_application(request_type, transport: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1240,7 +1287,8 @@ def test_update_application_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1259,7 +1307,8 @@ async def test_update_application_async( request_type=application_service.UpdateApplicationRequest, ): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1336,9 +1385,10 @@ def test_update_application_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "application.name=application.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "application.name=application.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1369,9 +1419,10 @@ async def test_update_application_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "application.name=application.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "application.name=application.name/value", + ) in kw["metadata"] def test_update_application_flattened(): @@ -1461,11 +1512,16 @@ async def test_update_application_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [application_service.DeleteApplicationRequest, dict,] + "request_type", + [ + application_service.DeleteApplicationRequest, + dict, + ], ) def test_delete_application(request_type, transport: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1493,7 +1549,8 @@ def test_delete_application_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1512,7 +1569,8 @@ async def test_delete_application_async( request_type=application_service.DeleteApplicationRequest, ): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1566,7 +1624,10 @@ def test_delete_application_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1595,7 +1656,10 @@ async def test_delete_application_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_application_flattened(): @@ -1611,7 +1675,9 @@ def test_delete_application_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_application(name="name_value",) + client.delete_application( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1631,7 +1697,8 @@ def test_delete_application_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.delete_application( - application_service.DeleteApplicationRequest(), name="name_value", + application_service.DeleteApplicationRequest(), + name="name_value", ) @@ -1651,7 +1718,9 @@ async def test_delete_application_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_application(name="name_value",) + response = await client.delete_application( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1672,16 +1741,22 @@ async def test_delete_application_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_application( - application_service.DeleteApplicationRequest(), name="name_value", + application_service.DeleteApplicationRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [application_service.ListApplicationsRequest, dict,] + "request_type", + [ + application_service.ListApplicationsRequest, + dict, + ], ) def test_list_applications(request_type, transport: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1712,7 +1787,8 @@ def test_list_applications_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1731,7 +1807,8 @@ async def test_list_applications_async( request_type=application_service.ListApplicationsRequest, ): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1790,7 +1867,10 @@ def test_list_applications_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1821,7 +1901,10 @@ async def test_list_applications_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_applications_flattened(): @@ -1837,7 +1920,9 @@ def test_list_applications_flattened(): call.return_value = application_service.ListApplicationsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_applications(parent="parent_value",) + client.list_applications( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1857,7 +1942,8 @@ def test_list_applications_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.list_applications( - application_service.ListApplicationsRequest(), parent="parent_value", + application_service.ListApplicationsRequest(), + parent="parent_value", ) @@ -1879,7 +1965,9 @@ async def test_list_applications_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_applications(parent="parent_value",) + response = await client.list_applications( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1900,13 +1988,15 @@ async def test_list_applications_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_applications( - application_service.ListApplicationsRequest(), parent="parent_value", + application_service.ListApplicationsRequest(), + parent="parent_value", ) def test_list_applications_pager(transport_name: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1924,13 +2014,20 @@ def test_list_applications_pager(transport_name: str = "grpc"): next_page_token="abc", ), application_service.ListApplicationsResponse( - applications=[], next_page_token="def", + applications=[], + next_page_token="def", ), application_service.ListApplicationsResponse( - applications=[application.Application(),], next_page_token="ghi", + applications=[ + application.Application(), + ], + next_page_token="ghi", ), application_service.ListApplicationsResponse( - applications=[application.Application(), application.Application(),], + applications=[ + application.Application(), + application.Application(), + ], ), RuntimeError, ) @@ -1950,7 +2047,8 @@ def test_list_applications_pager(transport_name: str = "grpc"): def test_list_applications_pages(transport_name: str = "grpc"): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1968,13 +2066,20 @@ def test_list_applications_pages(transport_name: str = "grpc"): next_page_token="abc", ), application_service.ListApplicationsResponse( - applications=[], next_page_token="def", + applications=[], + next_page_token="def", ), application_service.ListApplicationsResponse( - applications=[application.Application(),], next_page_token="ghi", + applications=[ + application.Application(), + ], + next_page_token="ghi", ), application_service.ListApplicationsResponse( - applications=[application.Application(), application.Application(),], + applications=[ + application.Application(), + application.Application(), + ], ), RuntimeError, ) @@ -2006,17 +2111,26 @@ async def test_list_applications_async_pager(): next_page_token="abc", ), application_service.ListApplicationsResponse( - applications=[], next_page_token="def", + applications=[], + next_page_token="def", ), application_service.ListApplicationsResponse( - applications=[application.Application(),], next_page_token="ghi", + applications=[ + application.Application(), + ], + next_page_token="ghi", ), application_service.ListApplicationsResponse( - applications=[application.Application(), application.Application(),], + applications=[ + application.Application(), + application.Application(), + ], ), RuntimeError, ) - async_pager = await client.list_applications(request={},) + async_pager = await client.list_applications( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2049,13 +2163,20 @@ async def test_list_applications_async_pages(): next_page_token="abc", ), application_service.ListApplicationsResponse( - applications=[], next_page_token="def", + applications=[], + next_page_token="def", ), application_service.ListApplicationsResponse( - applications=[application.Application(),], next_page_token="ghi", + applications=[ + application.Application(), + ], + next_page_token="ghi", ), application_service.ListApplicationsResponse( - applications=[application.Application(), application.Application(),], + applications=[ + application.Application(), + application.Application(), + ], ), RuntimeError, ) @@ -2073,7 +2194,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -2093,7 +2215,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = ApplicationServiceClient(client_options=options, transport=transport,) + client = ApplicationServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -2109,7 +2234,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ApplicationServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -2157,7 +2283,10 @@ def test_transport_grpc_default(): client = ApplicationServiceClient( credentials=ga_credentials.AnonymousCredentials(), ) - assert isinstance(client.transport, transports.ApplicationServiceGrpcTransport,) + assert isinstance( + client.transport, + transports.ApplicationServiceGrpcTransport, + ) def test_application_service_base_transport_error(): @@ -2206,7 +2335,8 @@ def test_application_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ApplicationServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2376,7 +2506,8 @@ def test_application_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.ApplicationServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2388,7 +2519,8 @@ def test_application_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.ApplicationServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2501,7 +2633,10 @@ def test_application_path(): profile = "whelk" application = "octopus" expected = "projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}".format( - project=project, tenant=tenant, profile=profile, application=application, + project=project, + tenant=tenant, + profile=profile, + application=application, ) actual = ApplicationServiceClient.application_path( project, tenant, profile, application @@ -2528,7 +2663,9 @@ def test_company_path(): tenant = "nautilus" company = "scallop" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = ApplicationServiceClient.company_path(project, tenant, company) assert expected == actual @@ -2552,7 +2689,9 @@ def test_job_path(): tenant = "octopus" job = "oyster" expected = "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) actual = ApplicationServiceClient.job_path(project, tenant, job) assert expected == actual @@ -2576,7 +2715,9 @@ def test_profile_path(): tenant = "nautilus" profile = "scallop" expected = "projects/{project}/tenants/{tenant}/profiles/{profile}".format( - project=project, tenant=tenant, profile=profile, + project=project, + tenant=tenant, + profile=profile, ) actual = ApplicationServiceClient.profile_path(project, tenant, profile) assert expected == actual @@ -2617,7 +2758,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = ApplicationServiceClient.common_folder_path(folder) assert expected == actual @@ -2635,7 +2778,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = ApplicationServiceClient.common_organization_path(organization) assert expected == actual @@ -2653,7 +2798,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = ApplicationServiceClient.common_project_path(project) assert expected == actual @@ -2673,7 +2820,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = ApplicationServiceClient.common_location_path(project, location) assert expected == actual @@ -2698,7 +2846,8 @@ def test_client_with_default_client_info(): transports.ApplicationServiceTransport, "_prep_wrapped_messages" ) as prep: client = ApplicationServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2707,7 +2856,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ApplicationServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2715,7 +2865,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ApplicationServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_company_service.py b/tests/unit/gapic/talent_v4beta1/test_company_service.py index 3c50f283..b723e65e 100644 --- a/tests/unit/gapic/talent_v4beta1/test_company_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_company_service.py @@ -93,7 +93,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [CompanyServiceClient, CompanyServiceAsyncClient,] + "client_class", + [ + CompanyServiceClient, + CompanyServiceAsyncClient, + ], ) def test_company_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -135,7 +139,11 @@ def test_company_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [CompanyServiceClient, CompanyServiceAsyncClient,] + "client_class", + [ + CompanyServiceClient, + CompanyServiceAsyncClient, + ], ) def test_company_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -499,7 +507,9 @@ def test_company_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -642,10 +652,17 @@ def test_company_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [company_service.CreateCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.CreateCompanyRequest, + dict, + ], +) def test_create_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -700,7 +717,8 @@ def test_create_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -716,7 +734,8 @@ async def test_create_company_async( transport: str = "grpc_asyncio", request_type=company_service.CreateCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -775,7 +794,9 @@ async def test_create_company_async_from_dict(): def test_create_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -795,7 +816,10 @@ def test_create_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -822,11 +846,16 @@ async def test_create_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_company), "__call__") as call: @@ -835,7 +864,8 @@ def test_create_company_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_company( - parent="parent_value", company=gct_company.Company(name="name_value"), + parent="parent_value", + company=gct_company.Company(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -851,7 +881,9 @@ def test_create_company_flattened(): def test_create_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -878,7 +910,8 @@ async def test_create_company_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_company( - parent="parent_value", company=gct_company.Company(name="name_value"), + parent="parent_value", + company=gct_company.Company(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -909,10 +942,17 @@ async def test_create_company_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [company_service.GetCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.GetCompanyRequest, + dict, + ], +) def test_get_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -967,7 +1007,8 @@ def test_get_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -983,7 +1024,8 @@ async def test_get_company_async( transport: str = "grpc_asyncio", request_type=company_service.GetCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1042,7 +1084,9 @@ async def test_get_company_async_from_dict(): def test_get_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1062,7 +1106,10 @@ def test_get_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1089,11 +1136,16 @@ async def test_get_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_company), "__call__") as call: @@ -1101,7 +1153,9 @@ def test_get_company_flattened(): call.return_value = company.Company() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_company(name="name_value",) + client.get_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1113,13 +1167,16 @@ def test_get_company_flattened(): def test_get_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_company( - company_service.GetCompanyRequest(), name="name_value", + company_service.GetCompanyRequest(), + name="name_value", ) @@ -1137,7 +1194,9 @@ async def test_get_company_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(company.Company()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_company(name="name_value",) + response = await client.get_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1158,14 +1217,22 @@ async def test_get_company_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_company( - company_service.GetCompanyRequest(), name="name_value", + company_service.GetCompanyRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [company_service.UpdateCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.UpdateCompanyRequest, + dict, + ], +) def test_update_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1220,7 +1287,8 @@ def test_update_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1236,7 +1304,8 @@ async def test_update_company_async( transport: str = "grpc_asyncio", request_type=company_service.UpdateCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1295,7 +1364,9 @@ async def test_update_company_async_from_dict(): def test_update_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1315,9 +1386,10 @@ def test_update_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "company.name=company.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "company.name=company.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1344,13 +1416,16 @@ async def test_update_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "company.name=company.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "company.name=company.name/value", + ) in kw["metadata"] def test_update_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_company), "__call__") as call: @@ -1358,7 +1433,9 @@ def test_update_company_flattened(): call.return_value = gct_company.Company() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_company(company=gct_company.Company(name="name_value"),) + client.update_company( + company=gct_company.Company(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -1370,7 +1447,9 @@ def test_update_company_flattened(): def test_update_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1423,10 +1502,17 @@ async def test_update_company_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [company_service.DeleteCompanyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.DeleteCompanyRequest, + dict, + ], +) def test_delete_company(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1452,7 +1538,8 @@ def test_delete_company_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1468,7 +1555,8 @@ async def test_delete_company_async( transport: str = "grpc_asyncio", request_type=company_service.DeleteCompanyRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1496,7 +1584,9 @@ async def test_delete_company_async_from_dict(): def test_delete_company_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1516,7 +1606,10 @@ def test_delete_company_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1543,11 +1636,16 @@ async def test_delete_company_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_company_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_company), "__call__") as call: @@ -1555,7 +1653,9 @@ def test_delete_company_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_company(name="name_value",) + client.delete_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1567,13 +1667,16 @@ def test_delete_company_flattened(): def test_delete_company_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_company( - company_service.DeleteCompanyRequest(), name="name_value", + company_service.DeleteCompanyRequest(), + name="name_value", ) @@ -1591,7 +1694,9 @@ async def test_delete_company_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_company(name="name_value",) + response = await client.delete_company( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1612,14 +1717,22 @@ async def test_delete_company_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_company( - company_service.DeleteCompanyRequest(), name="name_value", + company_service.DeleteCompanyRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [company_service.ListCompaniesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + company_service.ListCompaniesRequest, + dict, + ], +) def test_list_companies(request_type, transport: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1648,7 +1761,8 @@ def test_list_companies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1664,7 +1778,8 @@ async def test_list_companies_async( transport: str = "grpc_asyncio", request_type=company_service.ListCompaniesRequest ): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1697,7 +1812,9 @@ async def test_list_companies_async_from_dict(): def test_list_companies_field_headers(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1717,7 +1834,10 @@ def test_list_companies_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1746,11 +1866,16 @@ async def test_list_companies_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_companies_flattened(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_companies), "__call__") as call: @@ -1758,7 +1883,9 @@ def test_list_companies_flattened(): call.return_value = company_service.ListCompaniesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_companies(parent="parent_value",) + client.list_companies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1770,13 +1897,16 @@ def test_list_companies_flattened(): def test_list_companies_flattened_error(): - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_companies( - company_service.ListCompaniesRequest(), parent="parent_value", + company_service.ListCompaniesRequest(), + parent="parent_value", ) @@ -1796,7 +1926,9 @@ async def test_list_companies_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_companies(parent="parent_value",) + response = await client.list_companies( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1817,13 +1949,15 @@ async def test_list_companies_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_companies( - company_service.ListCompaniesRequest(), parent="parent_value", + company_service.ListCompaniesRequest(), + parent="parent_value", ) def test_list_companies_pager(transport_name: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1831,15 +1965,28 @@ def test_list_companies_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + ], + next_page_token="ghi", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1859,7 +2006,8 @@ def test_list_companies_pager(transport_name: str = "grpc"): def test_list_companies_pages(transport_name: str = "grpc"): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1867,15 +2015,28 @@ def test_list_companies_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1886,7 +2047,9 @@ def test_list_companies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_companies_async_pager(): - client = CompanyServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CompanyServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1895,19 +2058,34 @@ async def test_list_companies_async_pager(): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + ], + next_page_token="ghi", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) - async_pager = await client.list_companies(request={},) + async_pager = await client.list_companies( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1919,7 +2097,9 @@ async def test_list_companies_async_pager(): @pytest.mark.asyncio async def test_list_companies_async_pages(): - client = CompanyServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CompanyServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1928,15 +2108,28 @@ async def test_list_companies_async_pages(): # Set the response to a series of pages. call.side_effect = ( company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + company.Company(), + ], next_page_token="abc", ), - company_service.ListCompaniesResponse(companies=[], next_page_token="def",), company_service.ListCompaniesResponse( - companies=[company.Company(),], next_page_token="ghi", + companies=[], + next_page_token="def", + ), + company_service.ListCompaniesResponse( + companies=[ + company.Company(), + ], + next_page_token="ghi", ), company_service.ListCompaniesResponse( - companies=[company.Company(), company.Company(),], + companies=[ + company.Company(), + company.Company(), + ], ), RuntimeError, ) @@ -1954,7 +2147,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -1974,7 +2168,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CompanyServiceClient(client_options=options, transport=transport,) + client = CompanyServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -1990,7 +2187,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompanyServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -2035,8 +2233,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CompanyServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CompanyServiceGrpcTransport,) + client = CompanyServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CompanyServiceGrpcTransport, + ) def test_company_service_base_transport_error(): @@ -2085,7 +2288,8 @@ def test_company_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CompanyServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2253,7 +2457,8 @@ def test_company_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CompanyServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2265,7 +2470,8 @@ def test_company_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CompanyServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2377,7 +2583,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = CompanyServiceClient.company_path(project, tenant, company) assert expected == actual @@ -2418,7 +2626,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "winkle" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CompanyServiceClient.common_folder_path(folder) assert expected == actual @@ -2436,7 +2646,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "scallop" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CompanyServiceClient.common_organization_path(organization) assert expected == actual @@ -2454,7 +2666,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "squid" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CompanyServiceClient.common_project_path(project) assert expected == actual @@ -2474,7 +2688,8 @@ def test_common_location_path(): project = "whelk" location = "octopus" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CompanyServiceClient.common_location_path(project, location) assert expected == actual @@ -2499,7 +2714,8 @@ def test_client_with_default_client_info(): transports.CompanyServiceTransport, "_prep_wrapped_messages" ) as prep: client = CompanyServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2508,7 +2724,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CompanyServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2516,7 +2733,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CompanyServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_completion.py b/tests/unit/gapic/talent_v4beta1/test_completion.py index fd5f3688..176b1e00 100644 --- a/tests/unit/gapic/talent_v4beta1/test_completion.py +++ b/tests/unit/gapic/talent_v4beta1/test_completion.py @@ -81,7 +81,13 @@ def test__get_default_mtls_endpoint(): assert CompletionClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [CompletionClient, CompletionAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CompletionClient, + CompletionAsyncClient, + ], +) def test_completion_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -121,7 +127,13 @@ def test_completion_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [CompletionClient, CompletionAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CompletionClient, + CompletionAsyncClient, + ], +) def test_completion_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -476,7 +488,9 @@ def test_completion_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -608,11 +622,16 @@ def test_completion_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [completion_service.CompleteQueryRequest, dict,] + "request_type", + [ + completion_service.CompleteQueryRequest, + dict, + ], ) def test_complete_query(request_type, transport: str = "grpc"): client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -638,7 +657,8 @@ def test_complete_query_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -655,7 +675,8 @@ async def test_complete_query_async( request_type=completion_service.CompleteQueryRequest, ): client = CompletionAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -685,7 +706,9 @@ async def test_complete_query_async_from_dict(): def test_complete_query_field_headers(): - client = CompletionClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompletionClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -705,12 +728,17 @@ def test_complete_query_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_complete_query_field_headers_async(): - client = CompletionAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CompletionAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -732,7 +760,10 @@ async def test_complete_query_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_credentials_transport_error(): @@ -742,7 +773,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -762,7 +794,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CompletionClient(client_options=options, transport=transport,) + client = CompletionClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -778,7 +813,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CompletionClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -808,7 +844,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.CompletionGrpcTransport, transports.CompletionGrpcAsyncIOTransport,], + [ + transports.CompletionGrpcTransport, + transports.CompletionGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -820,8 +859,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CompletionClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CompletionGrpcTransport,) + client = CompletionClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CompletionGrpcTransport, + ) def test_completion_base_transport_error(): @@ -864,7 +908,8 @@ def test_completion_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CompletionTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -905,7 +950,10 @@ def test_completion_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.CompletionGrpcTransport, transports.CompletionGrpcAsyncIOTransport,], + [ + transports.CompletionGrpcTransport, + transports.CompletionGrpcAsyncIOTransport, + ], ) def test_completion_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -1026,7 +1074,8 @@ def test_completion_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CompletionGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1038,7 +1087,8 @@ def test_completion_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CompletionGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1142,7 +1192,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = CompletionClient.company_path(project, tenant, company) assert expected == actual @@ -1183,7 +1235,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "winkle" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CompletionClient.common_folder_path(folder) assert expected == actual @@ -1201,7 +1255,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "scallop" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CompletionClient.common_organization_path(organization) assert expected == actual @@ -1219,7 +1275,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "squid" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CompletionClient.common_project_path(project) assert expected == actual @@ -1239,7 +1297,8 @@ def test_common_location_path(): project = "whelk" location = "octopus" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CompletionClient.common_location_path(project, location) assert expected == actual @@ -1264,7 +1323,8 @@ def test_client_with_default_client_info(): transports.CompletionTransport, "_prep_wrapped_messages" ) as prep: client = CompletionClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1273,7 +1333,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CompletionClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1281,7 +1342,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CompletionAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_event_service.py b/tests/unit/gapic/talent_v4beta1/test_event_service.py index 452513b5..205d97fb 100644 --- a/tests/unit/gapic/talent_v4beta1/test_event_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_event_service.py @@ -82,7 +82,13 @@ def test__get_default_mtls_endpoint(): assert EventServiceClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [EventServiceClient, EventServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + EventServiceClient, + EventServiceAsyncClient, + ], +) def test_event_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -122,7 +128,13 @@ def test_event_service_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [EventServiceClient, EventServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + EventServiceClient, + EventServiceAsyncClient, + ], +) def test_event_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -477,7 +489,9 @@ def test_event_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -619,11 +633,16 @@ def test_event_service_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [event_service.CreateClientEventRequest, dict,] + "request_type", + [ + event_service.CreateClientEventRequest, + dict, + ], ) def test_create_client_event(request_type, transport: str = "grpc"): client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -659,7 +678,8 @@ def test_create_client_event_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -677,7 +697,8 @@ async def test_create_client_event_async( transport: str = "grpc_asyncio", request_type=event_service.CreateClientEventRequest ): client = EventServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -716,7 +737,9 @@ async def test_create_client_event_async_from_dict(): def test_create_client_event_field_headers(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -738,12 +761,17 @@ def test_create_client_event_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_client_event_field_headers_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -765,11 +793,16 @@ async def test_create_client_event_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_client_event_flattened(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -797,7 +830,9 @@ def test_create_client_event_flattened(): def test_create_client_event_flattened_error(): - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -811,7 +846,9 @@ def test_create_client_event_flattened_error(): @pytest.mark.asyncio async def test_create_client_event_flattened_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -842,7 +879,9 @@ async def test_create_client_event_flattened_async(): @pytest.mark.asyncio async def test_create_client_event_flattened_error_async(): - client = EventServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = EventServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -861,7 +900,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -881,7 +921,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = EventServiceClient(client_options=options, transport=transport,) + client = EventServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -897,7 +940,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = EventServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -942,8 +986,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = EventServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.EventServiceGrpcTransport,) + client = EventServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.EventServiceGrpcTransport, + ) def test_event_service_base_transport_error(): @@ -986,7 +1035,8 @@ def test_event_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.EventServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -1151,7 +1201,8 @@ def test_event_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.EventServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1163,7 +1214,8 @@ def test_event_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.EventServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -1267,7 +1319,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = EventServiceClient.company_path(project, tenant, company) assert expected == actual @@ -1308,7 +1362,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "winkle" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = EventServiceClient.common_folder_path(folder) assert expected == actual @@ -1326,7 +1382,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "scallop" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = EventServiceClient.common_organization_path(organization) assert expected == actual @@ -1344,7 +1402,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "squid" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = EventServiceClient.common_project_path(project) assert expected == actual @@ -1364,7 +1424,8 @@ def test_common_location_path(): project = "whelk" location = "octopus" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = EventServiceClient.common_location_path(project, location) assert expected == actual @@ -1389,7 +1450,8 @@ def test_client_with_default_client_info(): transports.EventServiceTransport, "_prep_wrapped_messages" ) as prep: client = EventServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1398,7 +1460,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = EventServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1406,7 +1469,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = EventServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_job_service.py b/tests/unit/gapic/talent_v4beta1/test_job_service.py index 6e3393eb..7fb524b3 100644 --- a/tests/unit/gapic/talent_v4beta1/test_job_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_job_service.py @@ -99,7 +99,13 @@ def test__get_default_mtls_endpoint(): assert JobServiceClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [JobServiceClient, JobServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + JobServiceClient, + JobServiceAsyncClient, + ], +) def test_job_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -139,7 +145,13 @@ def test_job_service_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [JobServiceClient, JobServiceAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + JobServiceClient, + JobServiceAsyncClient, + ], +) def test_job_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -494,7 +506,9 @@ def test_job_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -625,10 +639,17 @@ def test_job_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [job_service.CreateJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.CreateJobRequest, + dict, + ], +) def test_create_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -693,7 +714,8 @@ def test_create_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -709,7 +731,8 @@ async def test_create_job_async( transport: str = "grpc_asyncio", request_type=job_service.CreateJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -778,7 +801,9 @@ async def test_create_job_async_from_dict(): def test_create_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -798,12 +823,17 @@ def test_create_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -823,11 +853,16 @@ async def test_create_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -836,7 +871,8 @@ def test_create_job_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_job( - parent="parent_value", job=gct_job.Job(name="name_value"), + parent="parent_value", + job=gct_job.Job(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -852,7 +888,9 @@ def test_create_job_flattened(): def test_create_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -866,7 +904,9 @@ def test_create_job_flattened_error(): @pytest.mark.asyncio async def test_create_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_job), "__call__") as call: @@ -877,7 +917,8 @@ async def test_create_job_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_job( - parent="parent_value", job=gct_job.Job(name="name_value"), + parent="parent_value", + job=gct_job.Job(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -894,7 +935,9 @@ async def test_create_job_flattened_async(): @pytest.mark.asyncio async def test_create_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -906,10 +949,17 @@ async def test_create_job_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.BatchCreateJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchCreateJobsRequest, + dict, + ], +) def test_batch_create_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -937,7 +987,8 @@ def test_batch_create_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -955,7 +1006,8 @@ async def test_batch_create_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchCreateJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -987,7 +1039,9 @@ async def test_batch_create_jobs_async_from_dict(): def test_batch_create_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1009,12 +1063,17 @@ def test_batch_create_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_create_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1038,11 +1097,16 @@ async def test_batch_create_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_create_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1053,7 +1117,8 @@ def test_batch_create_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_create_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1069,7 +1134,9 @@ def test_batch_create_jobs_flattened(): def test_batch_create_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1083,7 +1150,9 @@ def test_batch_create_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_create_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1098,7 +1167,8 @@ async def test_batch_create_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_create_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1115,7 +1185,9 @@ async def test_batch_create_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_create_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1127,10 +1199,17 @@ async def test_batch_create_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.GetJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.GetJobRequest, + dict, + ], +) def test_get_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1195,7 +1274,8 @@ def test_get_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1211,7 +1291,8 @@ async def test_get_job_async( transport: str = "grpc_asyncio", request_type=job_service.GetJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1280,7 +1361,9 @@ async def test_get_job_async_from_dict(): def test_get_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1300,12 +1383,17 @@ def test_get_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1325,11 +1413,16 @@ async def test_get_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1337,7 +1430,9 @@ def test_get_job_flattened(): call.return_value = job.Job() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_job(name="name_value",) + client.get_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1349,19 +1444,24 @@ def test_get_job_flattened(): def test_get_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_job( - job_service.GetJobRequest(), name="name_value", + job_service.GetJobRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_job), "__call__") as call: @@ -1371,7 +1471,9 @@ async def test_get_job_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(job.Job()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_job(name="name_value",) + response = await client.get_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1384,20 +1486,30 @@ async def test_get_job_flattened_async(): @pytest.mark.asyncio async def test_get_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_job( - job_service.GetJobRequest(), name="name_value", + job_service.GetJobRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [job_service.UpdateJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.UpdateJobRequest, + dict, + ], +) def test_update_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1462,7 +1574,8 @@ def test_update_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1478,7 +1591,8 @@ async def test_update_job_async( transport: str = "grpc_asyncio", request_type=job_service.UpdateJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1547,7 +1661,9 @@ async def test_update_job_async_from_dict(): def test_update_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1567,12 +1683,17 @@ def test_update_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "job.name=job.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "job.name=job.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1592,11 +1713,16 @@ async def test_update_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "job.name=job.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "job.name=job.name/value", + ) in kw["metadata"] def test_update_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1604,7 +1730,9 @@ def test_update_job_flattened(): call.return_value = gct_job.Job() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_job(job=gct_job.Job(name="name_value"),) + client.update_job( + job=gct_job.Job(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -1616,19 +1744,24 @@ def test_update_job_flattened(): def test_update_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.update_job( - job_service.UpdateJobRequest(), job=gct_job.Job(name="name_value"), + job_service.UpdateJobRequest(), + job=gct_job.Job(name="name_value"), ) @pytest.mark.asyncio async def test_update_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_job), "__call__") as call: @@ -1638,7 +1771,9 @@ async def test_update_job_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(gct_job.Job()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.update_job(job=gct_job.Job(name="name_value"),) + response = await client.update_job( + job=gct_job.Job(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -1651,20 +1786,30 @@ async def test_update_job_flattened_async(): @pytest.mark.asyncio async def test_update_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.update_job( - job_service.UpdateJobRequest(), job=gct_job.Job(name="name_value"), + job_service.UpdateJobRequest(), + job=gct_job.Job(name="name_value"), ) -@pytest.mark.parametrize("request_type", [job_service.BatchUpdateJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchUpdateJobsRequest, + dict, + ], +) def test_batch_update_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1692,7 +1837,8 @@ def test_batch_update_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1710,7 +1856,8 @@ async def test_batch_update_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchUpdateJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1742,7 +1889,9 @@ async def test_batch_update_jobs_async_from_dict(): def test_batch_update_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1764,12 +1913,17 @@ def test_batch_update_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_update_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1793,11 +1947,16 @@ async def test_batch_update_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_update_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1808,7 +1967,8 @@ def test_batch_update_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_update_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1824,7 +1984,9 @@ def test_batch_update_jobs_flattened(): def test_batch_update_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1838,7 +2000,9 @@ def test_batch_update_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_update_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1853,7 +2017,8 @@ async def test_batch_update_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_update_jobs( - parent="parent_value", jobs=[job.Job(name="name_value")], + parent="parent_value", + jobs=[job.Job(name="name_value")], ) # Establish that the underlying call was made with the expected @@ -1870,7 +2035,9 @@ async def test_batch_update_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_update_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1882,10 +2049,17 @@ async def test_batch_update_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.DeleteJobRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.DeleteJobRequest, + dict, + ], +) def test_delete_job(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1911,7 +2085,8 @@ def test_delete_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1927,7 +2102,8 @@ async def test_delete_job_async( transport: str = "grpc_asyncio", request_type=job_service.DeleteJobRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1955,7 +2131,9 @@ async def test_delete_job_async_from_dict(): def test_delete_job_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1975,12 +2153,17 @@ def test_delete_job_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_job_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2000,11 +2183,16 @@ async def test_delete_job_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_job_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2012,7 +2200,9 @@ def test_delete_job_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_job(name="name_value",) + client.delete_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2024,19 +2214,24 @@ def test_delete_job_flattened(): def test_delete_job_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_job( - job_service.DeleteJobRequest(), name="name_value", + job_service.DeleteJobRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_job_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_job), "__call__") as call: @@ -2046,7 +2241,9 @@ async def test_delete_job_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_job(name="name_value",) + response = await client.delete_job( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2059,20 +2256,30 @@ async def test_delete_job_flattened_async(): @pytest.mark.asyncio async def test_delete_job_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_job( - job_service.DeleteJobRequest(), name="name_value", + job_service.DeleteJobRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [job_service.BatchDeleteJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.BatchDeleteJobsRequest, + dict, + ], +) def test_batch_delete_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2100,7 +2307,8 @@ def test_batch_delete_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2118,7 +2326,8 @@ async def test_batch_delete_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.BatchDeleteJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2148,7 +2357,9 @@ async def test_batch_delete_jobs_async_from_dict(): def test_batch_delete_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2170,12 +2381,17 @@ def test_batch_delete_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_batch_delete_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2197,11 +2413,16 @@ async def test_batch_delete_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_batch_delete_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2212,7 +2433,8 @@ def test_batch_delete_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.batch_delete_jobs( - parent="parent_value", filter="filter_value", + parent="parent_value", + filter="filter_value", ) # Establish that the underlying call was made with the expected @@ -2228,7 +2450,9 @@ def test_batch_delete_jobs_flattened(): def test_batch_delete_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2242,7 +2466,9 @@ def test_batch_delete_jobs_flattened_error(): @pytest.mark.asyncio async def test_batch_delete_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2255,7 +2481,8 @@ async def test_batch_delete_jobs_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.batch_delete_jobs( - parent="parent_value", filter="filter_value", + parent="parent_value", + filter="filter_value", ) # Establish that the underlying call was made with the expected @@ -2272,7 +2499,9 @@ async def test_batch_delete_jobs_flattened_async(): @pytest.mark.asyncio async def test_batch_delete_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2284,10 +2513,17 @@ async def test_batch_delete_jobs_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [job_service.ListJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.ListJobsRequest, + dict, + ], +) def test_list_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2316,7 +2552,8 @@ def test_list_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2332,7 +2569,8 @@ async def test_list_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.ListJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2343,7 +2581,9 @@ async def test_list_jobs_async( with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - job_service.ListJobsResponse(next_page_token="next_page_token_value",) + job_service.ListJobsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_jobs(request) @@ -2363,7 +2603,9 @@ async def test_list_jobs_async_from_dict(): def test_list_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2383,12 +2625,17 @@ def test_list_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2410,11 +2657,16 @@ async def test_list_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_jobs_flattened(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2423,7 +2675,8 @@ def test_list_jobs_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.list_jobs( - parent="parent_value", filter="filter_value", + parent="parent_value", + filter="filter_value", ) # Establish that the underlying call was made with the expected @@ -2439,19 +2692,25 @@ def test_list_jobs_flattened(): def test_list_jobs_flattened_error(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_jobs( - job_service.ListJobsRequest(), parent="parent_value", filter="filter_value", + job_service.ListJobsRequest(), + parent="parent_value", + filter="filter_value", ) @pytest.mark.asyncio async def test_list_jobs_flattened_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_jobs), "__call__") as call: @@ -2463,7 +2722,10 @@ async def test_list_jobs_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_jobs(parent="parent_value", filter="filter_value",) + response = await client.list_jobs( + parent="parent_value", + filter="filter_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2479,19 +2741,24 @@ async def test_list_jobs_flattened_async(): @pytest.mark.asyncio async def test_list_jobs_flattened_error_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_jobs( - job_service.ListJobsRequest(), parent="parent_value", filter="filter_value", + job_service.ListJobsRequest(), + parent="parent_value", + filter="filter_value", ) def test_list_jobs_pager(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2499,11 +2766,29 @@ def test_list_jobs_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) @@ -2522,7 +2807,8 @@ def test_list_jobs_pager(transport_name: str = "grpc"): def test_list_jobs_pages(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2530,11 +2816,29 @@ def test_list_jobs_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) pages = list(client.list_jobs(request={}).pages) @@ -2544,7 +2848,9 @@ def test_list_jobs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_jobs_async_pager(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2553,14 +2859,34 @@ async def test_list_jobs_async_pager(): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) - async_pager = await client.list_jobs(request={},) + async_pager = await client.list_jobs( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2572,7 +2898,9 @@ async def test_list_jobs_async_pager(): @pytest.mark.asyncio async def test_list_jobs_async_pages(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2581,11 +2909,29 @@ async def test_list_jobs_async_pages(): # Set the response to a series of pages. call.side_effect = ( job_service.ListJobsResponse( - jobs=[job.Job(), job.Job(), job.Job(),], next_page_token="abc", + jobs=[ + job.Job(), + job.Job(), + job.Job(), + ], + next_page_token="abc", + ), + job_service.ListJobsResponse( + jobs=[], + next_page_token="def", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + ], + next_page_token="ghi", + ), + job_service.ListJobsResponse( + jobs=[ + job.Job(), + job.Job(), + ], ), - job_service.ListJobsResponse(jobs=[], next_page_token="def",), - job_service.ListJobsResponse(jobs=[job.Job(),], next_page_token="ghi",), - job_service.ListJobsResponse(jobs=[job.Job(), job.Job(),],), RuntimeError, ) pages = [] @@ -2595,10 +2941,17 @@ async def test_list_jobs_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [job_service.SearchJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.SearchJobsRequest, + dict, + ], +) def test_search_jobs(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2633,7 +2986,8 @@ def test_search_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2649,7 +3003,8 @@ async def test_search_jobs_async( transport: str = "grpc_asyncio", request_type=job_service.SearchJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2688,7 +3043,9 @@ async def test_search_jobs_async_from_dict(): def test_search_jobs_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2708,12 +3065,17 @@ def test_search_jobs_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_search_jobs_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2735,12 +3097,16 @@ async def test_search_jobs_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_search_jobs_pager(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2755,9 +3121,14 @@ def test_search_jobs_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -2786,7 +3157,8 @@ def test_search_jobs_pager(transport_name: str = "grpc"): def test_search_jobs_pages(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2801,9 +3173,14 @@ def test_search_jobs_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -2821,7 +3198,9 @@ def test_search_jobs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_search_jobs_async_pager(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2837,9 +3216,14 @@ async def test_search_jobs_async_pager(): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -2850,7 +3234,9 @@ async def test_search_jobs_async_pager(): ), RuntimeError, ) - async_pager = await client.search_jobs(request={},) + async_pager = await client.search_jobs( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2864,7 +3250,9 @@ async def test_search_jobs_async_pager(): @pytest.mark.asyncio async def test_search_jobs_async_pages(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2880,9 +3268,14 @@ async def test_search_jobs_async_pages(): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -2900,10 +3293,17 @@ async def test_search_jobs_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [job_service.SearchJobsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + job_service.SearchJobsRequest, + dict, + ], +) def test_search_jobs_for_alert(request_type, transport: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2940,7 +3340,8 @@ def test_search_jobs_for_alert_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2958,7 +3359,8 @@ async def test_search_jobs_for_alert_async( transport: str = "grpc_asyncio", request_type=job_service.SearchJobsRequest ): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2999,7 +3401,9 @@ async def test_search_jobs_for_alert_async_from_dict(): def test_search_jobs_for_alert_field_headers(): - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3021,12 +3425,17 @@ def test_search_jobs_for_alert_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_search_jobs_for_alert_field_headers_async(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3050,12 +3459,16 @@ async def test_search_jobs_for_alert_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_search_jobs_for_alert_pager(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3072,9 +3485,14 @@ def test_search_jobs_for_alert_pager(transport_name: str = "grpc"): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -3103,7 +3521,8 @@ def test_search_jobs_for_alert_pager(transport_name: str = "grpc"): def test_search_jobs_for_alert_pages(transport_name: str = "grpc"): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3120,9 +3539,14 @@ def test_search_jobs_for_alert_pages(transport_name: str = "grpc"): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -3140,7 +3564,9 @@ def test_search_jobs_for_alert_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_search_jobs_for_alert_async_pager(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3158,9 +3584,14 @@ async def test_search_jobs_for_alert_async_pager(): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -3171,7 +3602,9 @@ async def test_search_jobs_for_alert_async_pager(): ), RuntimeError, ) - async_pager = await client.search_jobs_for_alert(request={},) + async_pager = await client.search_jobs_for_alert( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3185,7 +3618,9 @@ async def test_search_jobs_for_alert_async_pager(): @pytest.mark.asyncio async def test_search_jobs_for_alert_async_pages(): - client = JobServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = JobServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3203,9 +3638,14 @@ async def test_search_jobs_for_alert_async_pages(): ], next_page_token="abc", ), - job_service.SearchJobsResponse(matching_jobs=[], next_page_token="def",), job_service.SearchJobsResponse( - matching_jobs=[job_service.SearchJobsResponse.MatchingJob(),], + matching_jobs=[], + next_page_token="def", + ), + job_service.SearchJobsResponse( + matching_jobs=[ + job_service.SearchJobsResponse.MatchingJob(), + ], next_page_token="ghi", ), job_service.SearchJobsResponse( @@ -3230,7 +3670,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -3250,7 +3691,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = JobServiceClient(client_options=options, transport=transport,) + client = JobServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -3266,7 +3710,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = JobServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -3296,7 +3741,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.JobServiceGrpcTransport, transports.JobServiceGrpcAsyncIOTransport,], + [ + transports.JobServiceGrpcTransport, + transports.JobServiceGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -3308,8 +3756,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = JobServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.JobServiceGrpcTransport,) + client = JobServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.JobServiceGrpcTransport, + ) def test_job_service_base_transport_error(): @@ -3368,7 +3821,8 @@ def test_job_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.JobServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -3409,7 +3863,10 @@ def test_job_service_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.JobServiceGrpcTransport, transports.JobServiceGrpcAsyncIOTransport,], + [ + transports.JobServiceGrpcTransport, + transports.JobServiceGrpcAsyncIOTransport, + ], ) def test_job_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -3530,7 +3987,8 @@ def test_job_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.JobServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -3542,7 +4000,8 @@ def test_job_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.JobServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -3643,12 +4102,16 @@ def test_job_service_transport_channel_mtls_with_adc(transport_class): def test_job_service_grpc_lro_client(): client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -3656,12 +4119,16 @@ def test_job_service_grpc_lro_client(): def test_job_service_grpc_lro_async_client(): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) transport = client.transport # Ensure that we have a api-core operations client. - assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) # Ensure that subsequent calls to the property send the exact same object. assert transport.operations_client is transport.operations_client @@ -3672,7 +4139,9 @@ def test_company_path(): tenant = "clam" company = "whelk" expected = "projects/{project}/tenants/{tenant}/companies/{company}".format( - project=project, tenant=tenant, company=company, + project=project, + tenant=tenant, + company=company, ) actual = JobServiceClient.company_path(project, tenant, company) assert expected == actual @@ -3696,7 +4165,9 @@ def test_job_path(): tenant = "mussel" job = "winkle" expected = "projects/{project}/tenants/{tenant}/jobs/{job}".format( - project=project, tenant=tenant, job=job, + project=project, + tenant=tenant, + job=job, ) actual = JobServiceClient.job_path(project, tenant, job) assert expected == actual @@ -3737,7 +4208,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "whelk" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = JobServiceClient.common_folder_path(folder) assert expected == actual @@ -3755,7 +4228,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "oyster" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = JobServiceClient.common_organization_path(organization) assert expected == actual @@ -3773,7 +4248,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "cuttlefish" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = JobServiceClient.common_project_path(project) assert expected == actual @@ -3793,7 +4270,8 @@ def test_common_location_path(): project = "winkle" location = "nautilus" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = JobServiceClient.common_location_path(project, location) assert expected == actual @@ -3818,7 +4296,8 @@ def test_client_with_default_client_info(): transports.JobServiceTransport, "_prep_wrapped_messages" ) as prep: client = JobServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3827,7 +4306,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = JobServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3835,7 +4315,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = JobServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_profile_service.py b/tests/unit/gapic/talent_v4beta1/test_profile_service.py index 27edab87..44b394b0 100644 --- a/tests/unit/gapic/talent_v4beta1/test_profile_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_profile_service.py @@ -99,7 +99,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ProfileServiceClient, ProfileServiceAsyncClient,] + "client_class", + [ + ProfileServiceClient, + ProfileServiceAsyncClient, + ], ) def test_profile_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -141,7 +145,11 @@ def test_profile_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [ProfileServiceClient, ProfileServiceAsyncClient,] + "client_class", + [ + ProfileServiceClient, + ProfileServiceAsyncClient, + ], ) def test_profile_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -505,7 +513,9 @@ def test_profile_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -648,10 +658,17 @@ def test_profile_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [profile_service.ListProfilesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.ListProfilesRequest, + dict, + ], +) def test_list_profiles(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -680,7 +697,8 @@ def test_list_profiles_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -696,7 +714,8 @@ async def test_list_profiles_async( transport: str = "grpc_asyncio", request_type=profile_service.ListProfilesRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -729,7 +748,9 @@ async def test_list_profiles_async_from_dict(): def test_list_profiles_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -749,7 +770,10 @@ def test_list_profiles_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -778,11 +802,16 @@ async def test_list_profiles_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_profiles_flattened(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_profiles), "__call__") as call: @@ -790,7 +819,9 @@ def test_list_profiles_flattened(): call.return_value = profile_service.ListProfilesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_profiles(parent="parent_value",) + client.list_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -802,13 +833,16 @@ def test_list_profiles_flattened(): def test_list_profiles_flattened_error(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_profiles( - profile_service.ListProfilesRequest(), parent="parent_value", + profile_service.ListProfilesRequest(), + parent="parent_value", ) @@ -828,7 +862,9 @@ async def test_list_profiles_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_profiles(parent="parent_value",) + response = await client.list_profiles( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -849,13 +885,15 @@ async def test_list_profiles_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_profiles( - profile_service.ListProfilesRequest(), parent="parent_value", + profile_service.ListProfilesRequest(), + parent="parent_value", ) def test_list_profiles_pager(transport_name: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -863,15 +901,28 @@ def test_list_profiles_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + profile.Profile(), + profile.Profile(), + ], next_page_token="abc", ), - profile_service.ListProfilesResponse(profiles=[], next_page_token="def",), profile_service.ListProfilesResponse( - profiles=[profile.Profile(),], next_page_token="ghi", + profiles=[], + next_page_token="def", ), profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + ], + next_page_token="ghi", + ), + profile_service.ListProfilesResponse( + profiles=[ + profile.Profile(), + profile.Profile(), + ], ), RuntimeError, ) @@ -891,7 +942,8 @@ def test_list_profiles_pager(transport_name: str = "grpc"): def test_list_profiles_pages(transport_name: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -899,15 +951,28 @@ def test_list_profiles_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + profile.Profile(), + profile.Profile(), + ], next_page_token="abc", ), - profile_service.ListProfilesResponse(profiles=[], next_page_token="def",), profile_service.ListProfilesResponse( - profiles=[profile.Profile(),], next_page_token="ghi", + profiles=[], + next_page_token="def", ), profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + ], + next_page_token="ghi", + ), + profile_service.ListProfilesResponse( + profiles=[ + profile.Profile(), + profile.Profile(), + ], ), RuntimeError, ) @@ -918,7 +983,9 @@ def test_list_profiles_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_profiles_async_pager(): - client = ProfileServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = ProfileServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -927,19 +994,34 @@ async def test_list_profiles_async_pager(): # Set the response to a series of pages. call.side_effect = ( profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + profile.Profile(), + profile.Profile(), + ], next_page_token="abc", ), - profile_service.ListProfilesResponse(profiles=[], next_page_token="def",), profile_service.ListProfilesResponse( - profiles=[profile.Profile(),], next_page_token="ghi", + profiles=[], + next_page_token="def", ), profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + ], + next_page_token="ghi", + ), + profile_service.ListProfilesResponse( + profiles=[ + profile.Profile(), + profile.Profile(), + ], ), RuntimeError, ) - async_pager = await client.list_profiles(request={},) + async_pager = await client.list_profiles( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -951,7 +1033,9 @@ async def test_list_profiles_async_pager(): @pytest.mark.asyncio async def test_list_profiles_async_pages(): - client = ProfileServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = ProfileServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -960,15 +1044,28 @@ async def test_list_profiles_async_pages(): # Set the response to a series of pages. call.side_effect = ( profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + profile.Profile(), + profile.Profile(), + ], next_page_token="abc", ), - profile_service.ListProfilesResponse(profiles=[], next_page_token="def",), profile_service.ListProfilesResponse( - profiles=[profile.Profile(),], next_page_token="ghi", + profiles=[], + next_page_token="def", ), profile_service.ListProfilesResponse( - profiles=[profile.Profile(), profile.Profile(),], + profiles=[ + profile.Profile(), + ], + next_page_token="ghi", + ), + profile_service.ListProfilesResponse( + profiles=[ + profile.Profile(), + profile.Profile(), + ], ), RuntimeError, ) @@ -979,10 +1076,17 @@ async def test_list_profiles_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [profile_service.CreateProfileRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.CreateProfileRequest, + dict, + ], +) def test_create_profile(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1027,7 +1131,8 @@ def test_create_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1043,7 +1148,8 @@ async def test_create_profile_async( transport: str = "grpc_asyncio", request_type=profile_service.CreateProfileRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1092,7 +1198,9 @@ async def test_create_profile_async_from_dict(): def test_create_profile_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1112,7 +1220,10 @@ def test_create_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1139,11 +1250,16 @@ async def test_create_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_profile_flattened(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_profile), "__call__") as call: @@ -1152,7 +1268,8 @@ def test_create_profile_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_profile( - parent="parent_value", profile=gct_profile.Profile(name="name_value"), + parent="parent_value", + profile=gct_profile.Profile(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1168,7 +1285,9 @@ def test_create_profile_flattened(): def test_create_profile_flattened_error(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1195,7 +1314,8 @@ async def test_create_profile_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_profile( - parent="parent_value", profile=gct_profile.Profile(name="name_value"), + parent="parent_value", + profile=gct_profile.Profile(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1226,10 +1346,17 @@ async def test_create_profile_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [profile_service.GetProfileRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.GetProfileRequest, + dict, + ], +) def test_get_profile(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1274,7 +1401,8 @@ def test_get_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1290,7 +1418,8 @@ async def test_get_profile_async( transport: str = "grpc_asyncio", request_type=profile_service.GetProfileRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1339,7 +1468,9 @@ async def test_get_profile_async_from_dict(): def test_get_profile_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1359,7 +1490,10 @@ def test_get_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1386,11 +1520,16 @@ async def test_get_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_profile_flattened(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_profile), "__call__") as call: @@ -1398,7 +1537,9 @@ def test_get_profile_flattened(): call.return_value = profile.Profile() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_profile(name="name_value",) + client.get_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1410,13 +1551,16 @@ def test_get_profile_flattened(): def test_get_profile_flattened_error(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_profile( - profile_service.GetProfileRequest(), name="name_value", + profile_service.GetProfileRequest(), + name="name_value", ) @@ -1434,7 +1578,9 @@ async def test_get_profile_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(profile.Profile()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_profile(name="name_value",) + response = await client.get_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1455,14 +1601,22 @@ async def test_get_profile_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_profile( - profile_service.GetProfileRequest(), name="name_value", + profile_service.GetProfileRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [profile_service.UpdateProfileRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.UpdateProfileRequest, + dict, + ], +) def test_update_profile(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1507,7 +1661,8 @@ def test_update_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1523,7 +1678,8 @@ async def test_update_profile_async( transport: str = "grpc_asyncio", request_type=profile_service.UpdateProfileRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1572,7 +1728,9 @@ async def test_update_profile_async_from_dict(): def test_update_profile_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1592,9 +1750,10 @@ def test_update_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "profile.name=profile.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "profile.name=profile.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1621,13 +1780,16 @@ async def test_update_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "profile.name=profile.name/value",) in kw[ - "metadata" - ] + assert ( + "x-goog-request-params", + "profile.name=profile.name/value", + ) in kw["metadata"] def test_update_profile_flattened(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_profile), "__call__") as call: @@ -1635,7 +1797,9 @@ def test_update_profile_flattened(): call.return_value = gct_profile.Profile() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_profile(profile=gct_profile.Profile(name="name_value"),) + client.update_profile( + profile=gct_profile.Profile(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -1647,7 +1811,9 @@ def test_update_profile_flattened(): def test_update_profile_flattened_error(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1700,10 +1866,17 @@ async def test_update_profile_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [profile_service.DeleteProfileRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.DeleteProfileRequest, + dict, + ], +) def test_delete_profile(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1729,7 +1902,8 @@ def test_delete_profile_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1745,7 +1919,8 @@ async def test_delete_profile_async( transport: str = "grpc_asyncio", request_type=profile_service.DeleteProfileRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1773,7 +1948,9 @@ async def test_delete_profile_async_from_dict(): def test_delete_profile_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1793,7 +1970,10 @@ def test_delete_profile_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1820,11 +2000,16 @@ async def test_delete_profile_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_profile_flattened(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_profile), "__call__") as call: @@ -1832,7 +2017,9 @@ def test_delete_profile_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_profile(name="name_value",) + client.delete_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1844,13 +2031,16 @@ def test_delete_profile_flattened(): def test_delete_profile_flattened_error(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_profile( - profile_service.DeleteProfileRequest(), name="name_value", + profile_service.DeleteProfileRequest(), + name="name_value", ) @@ -1868,7 +2058,9 @@ async def test_delete_profile_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_profile(name="name_value",) + response = await client.delete_profile( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1889,14 +2081,22 @@ async def test_delete_profile_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_profile( - profile_service.DeleteProfileRequest(), name="name_value", + profile_service.DeleteProfileRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [profile_service.SearchProfilesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + profile_service.SearchProfilesRequest, + dict, + ], +) def test_search_profiles(request_type, transport: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1929,7 +2129,8 @@ def test_search_profiles_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1945,7 +2146,8 @@ async def test_search_profiles_async( transport: str = "grpc_asyncio", request_type=profile_service.SearchProfilesRequest ): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1982,7 +2184,9 @@ async def test_search_profiles_async_from_dict(): def test_search_profiles_field_headers(): - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2002,7 +2206,10 @@ def test_search_profiles_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2031,12 +2238,16 @@ async def test_search_profiles_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_search_profiles_pager(transport_name: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2052,10 +2263,13 @@ def test_search_profiles_pager(transport_name: str = "grpc"): next_page_token="abc", ), profile_service.SearchProfilesResponse( - histogram_query_results=[], next_page_token="def", + histogram_query_results=[], + next_page_token="def", ), profile_service.SearchProfilesResponse( - histogram_query_results=[histogram.HistogramQueryResult(),], + histogram_query_results=[ + histogram.HistogramQueryResult(), + ], next_page_token="ghi", ), profile_service.SearchProfilesResponse( @@ -2082,7 +2296,8 @@ def test_search_profiles_pager(transport_name: str = "grpc"): def test_search_profiles_pages(transport_name: str = "grpc"): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2098,10 +2313,13 @@ def test_search_profiles_pages(transport_name: str = "grpc"): next_page_token="abc", ), profile_service.SearchProfilesResponse( - histogram_query_results=[], next_page_token="def", + histogram_query_results=[], + next_page_token="def", ), profile_service.SearchProfilesResponse( - histogram_query_results=[histogram.HistogramQueryResult(),], + histogram_query_results=[ + histogram.HistogramQueryResult(), + ], next_page_token="ghi", ), profile_service.SearchProfilesResponse( @@ -2119,7 +2337,9 @@ def test_search_profiles_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_search_profiles_async_pager(): - client = ProfileServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = ProfileServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2136,10 +2356,13 @@ async def test_search_profiles_async_pager(): next_page_token="abc", ), profile_service.SearchProfilesResponse( - histogram_query_results=[], next_page_token="def", + histogram_query_results=[], + next_page_token="def", ), profile_service.SearchProfilesResponse( - histogram_query_results=[histogram.HistogramQueryResult(),], + histogram_query_results=[ + histogram.HistogramQueryResult(), + ], next_page_token="ghi", ), profile_service.SearchProfilesResponse( @@ -2150,7 +2373,9 @@ async def test_search_profiles_async_pager(): ), RuntimeError, ) - async_pager = await client.search_profiles(request={},) + async_pager = await client.search_profiles( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -2162,7 +2387,9 @@ async def test_search_profiles_async_pager(): @pytest.mark.asyncio async def test_search_profiles_async_pages(): - client = ProfileServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = ProfileServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2179,10 +2406,13 @@ async def test_search_profiles_async_pages(): next_page_token="abc", ), profile_service.SearchProfilesResponse( - histogram_query_results=[], next_page_token="def", + histogram_query_results=[], + next_page_token="def", ), profile_service.SearchProfilesResponse( - histogram_query_results=[histogram.HistogramQueryResult(),], + histogram_query_results=[ + histogram.HistogramQueryResult(), + ], next_page_token="ghi", ), profile_service.SearchProfilesResponse( @@ -2207,7 +2437,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -2227,7 +2458,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = ProfileServiceClient(client_options=options, transport=transport,) + client = ProfileServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -2243,7 +2477,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = ProfileServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -2288,8 +2523,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = ProfileServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.ProfileServiceGrpcTransport,) + client = ProfileServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.ProfileServiceGrpcTransport, + ) def test_profile_service_base_transport_error(): @@ -2339,7 +2579,8 @@ def test_profile_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ProfileServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2507,7 +2748,8 @@ def test_profile_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.ProfileServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2519,7 +2761,8 @@ def test_profile_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.ProfileServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2631,7 +2874,9 @@ def test_profile_path(): tenant = "clam" profile = "whelk" expected = "projects/{project}/tenants/{tenant}/profiles/{profile}".format( - project=project, tenant=tenant, profile=profile, + project=project, + tenant=tenant, + profile=profile, ) actual = ProfileServiceClient.profile_path(project, tenant, profile) assert expected == actual @@ -2654,7 +2899,8 @@ def test_tenant_path(): project = "cuttlefish" tenant = "mussel" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = ProfileServiceClient.tenant_path(project, tenant) assert expected == actual @@ -2694,7 +2940,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "squid" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = ProfileServiceClient.common_folder_path(folder) assert expected == actual @@ -2712,7 +2960,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "whelk" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = ProfileServiceClient.common_organization_path(organization) assert expected == actual @@ -2730,7 +2980,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "oyster" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = ProfileServiceClient.common_project_path(project) assert expected == actual @@ -2750,7 +3002,8 @@ def test_common_location_path(): project = "cuttlefish" location = "mussel" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = ProfileServiceClient.common_location_path(project, location) assert expected == actual @@ -2775,7 +3028,8 @@ def test_client_with_default_client_info(): transports.ProfileServiceTransport, "_prep_wrapped_messages" ) as prep: client = ProfileServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2784,7 +3038,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ProfileServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2792,7 +3047,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ProfileServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/talent_v4beta1/test_tenant_service.py b/tests/unit/gapic/talent_v4beta1/test_tenant_service.py index 9f01a87d..10445522 100644 --- a/tests/unit/gapic/talent_v4beta1/test_tenant_service.py +++ b/tests/unit/gapic/talent_v4beta1/test_tenant_service.py @@ -88,7 +88,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [TenantServiceClient, TenantServiceAsyncClient,] + "client_class", + [ + TenantServiceClient, + TenantServiceAsyncClient, + ], ) def test_tenant_service_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -130,7 +134,11 @@ def test_tenant_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [TenantServiceClient, TenantServiceAsyncClient,] + "client_class", + [ + TenantServiceClient, + TenantServiceAsyncClient, + ], ) def test_tenant_service_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -494,7 +502,9 @@ def test_tenant_service_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -637,10 +647,17 @@ def test_tenant_service_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [tenant_service.CreateTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.CreateTenantRequest, + dict, + ], +) def test_create_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -679,7 +696,8 @@ def test_create_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -695,7 +713,8 @@ async def test_create_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.CreateTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -738,7 +757,9 @@ async def test_create_tenant_async_from_dict(): def test_create_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -758,7 +779,10 @@ def test_create_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -785,11 +809,16 @@ async def test_create_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_tenant), "__call__") as call: @@ -798,7 +827,8 @@ def test_create_tenant_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_tenant( - parent="parent_value", tenant=gct_tenant.Tenant(name="name_value"), + parent="parent_value", + tenant=gct_tenant.Tenant(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -814,7 +844,9 @@ def test_create_tenant_flattened(): def test_create_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -841,7 +873,8 @@ async def test_create_tenant_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_tenant( - parent="parent_value", tenant=gct_tenant.Tenant(name="name_value"), + parent="parent_value", + tenant=gct_tenant.Tenant(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -872,10 +905,17 @@ async def test_create_tenant_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [tenant_service.GetTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.GetTenantRequest, + dict, + ], +) def test_get_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -914,7 +954,8 @@ def test_get_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -930,7 +971,8 @@ async def test_get_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.GetTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -973,7 +1015,9 @@ async def test_get_tenant_async_from_dict(): def test_get_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -993,7 +1037,10 @@ def test_get_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1020,11 +1067,16 @@ async def test_get_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_tenant), "__call__") as call: @@ -1032,7 +1084,9 @@ def test_get_tenant_flattened(): call.return_value = tenant.Tenant() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_tenant(name="name_value",) + client.get_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1044,13 +1098,16 @@ def test_get_tenant_flattened(): def test_get_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_tenant( - tenant_service.GetTenantRequest(), name="name_value", + tenant_service.GetTenantRequest(), + name="name_value", ) @@ -1068,7 +1125,9 @@ async def test_get_tenant_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(tenant.Tenant()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_tenant(name="name_value",) + response = await client.get_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1089,14 +1148,22 @@ async def test_get_tenant_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_tenant( - tenant_service.GetTenantRequest(), name="name_value", + tenant_service.GetTenantRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [tenant_service.UpdateTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.UpdateTenantRequest, + dict, + ], +) def test_update_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1135,7 +1202,8 @@ def test_update_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1151,7 +1219,8 @@ async def test_update_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.UpdateTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1194,7 +1263,9 @@ async def test_update_tenant_async_from_dict(): def test_update_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1214,7 +1285,10 @@ def test_update_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant.name=tenant.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant.name=tenant.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1241,11 +1315,16 @@ async def test_update_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "tenant.name=tenant.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "tenant.name=tenant.name/value", + ) in kw["metadata"] def test_update_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_tenant), "__call__") as call: @@ -1253,7 +1332,9 @@ def test_update_tenant_flattened(): call.return_value = gct_tenant.Tenant() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_tenant(tenant=gct_tenant.Tenant(name="name_value"),) + client.update_tenant( + tenant=gct_tenant.Tenant(name="name_value"), + ) # Establish that the underlying call was made with the expected # request object values. @@ -1265,7 +1346,9 @@ def test_update_tenant_flattened(): def test_update_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1318,10 +1401,17 @@ async def test_update_tenant_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [tenant_service.DeleteTenantRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.DeleteTenantRequest, + dict, + ], +) def test_delete_tenant(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1347,7 +1437,8 @@ def test_delete_tenant_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1363,7 +1454,8 @@ async def test_delete_tenant_async( transport: str = "grpc_asyncio", request_type=tenant_service.DeleteTenantRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1391,7 +1483,9 @@ async def test_delete_tenant_async_from_dict(): def test_delete_tenant_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1411,7 +1505,10 @@ def test_delete_tenant_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1438,11 +1535,16 @@ async def test_delete_tenant_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_tenant_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_tenant), "__call__") as call: @@ -1450,7 +1552,9 @@ def test_delete_tenant_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_tenant(name="name_value",) + client.delete_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1462,13 +1566,16 @@ def test_delete_tenant_flattened(): def test_delete_tenant_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_tenant( - tenant_service.DeleteTenantRequest(), name="name_value", + tenant_service.DeleteTenantRequest(), + name="name_value", ) @@ -1486,7 +1593,9 @@ async def test_delete_tenant_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_tenant(name="name_value",) + response = await client.delete_tenant( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1507,14 +1616,22 @@ async def test_delete_tenant_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_tenant( - tenant_service.DeleteTenantRequest(), name="name_value", + tenant_service.DeleteTenantRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [tenant_service.ListTenantsRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + tenant_service.ListTenantsRequest, + dict, + ], +) def test_list_tenants(request_type, transport: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1543,7 +1660,8 @@ def test_list_tenants_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1559,7 +1677,8 @@ async def test_list_tenants_async( transport: str = "grpc_asyncio", request_type=tenant_service.ListTenantsRequest ): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1570,7 +1689,9 @@ async def test_list_tenants_async( with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - tenant_service.ListTenantsResponse(next_page_token="next_page_token_value",) + tenant_service.ListTenantsResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tenants(request) @@ -1590,7 +1711,9 @@ async def test_list_tenants_async_from_dict(): def test_list_tenants_field_headers(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1610,7 +1733,10 @@ def test_list_tenants_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -1639,11 +1765,16 @@ async def test_list_tenants_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tenants_flattened(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tenants), "__call__") as call: @@ -1651,7 +1782,9 @@ def test_list_tenants_flattened(): call.return_value = tenant_service.ListTenantsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tenants(parent="parent_value",) + client.list_tenants( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1663,13 +1796,16 @@ def test_list_tenants_flattened(): def test_list_tenants_flattened_error(): - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tenants( - tenant_service.ListTenantsRequest(), parent="parent_value", + tenant_service.ListTenantsRequest(), + parent="parent_value", ) @@ -1689,7 +1825,9 @@ async def test_list_tenants_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tenants(parent="parent_value",) + response = await client.list_tenants( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1710,13 +1848,15 @@ async def test_list_tenants_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_tenants( - tenant_service.ListTenantsRequest(), parent="parent_value", + tenant_service.ListTenantsRequest(), + parent="parent_value", ) def test_list_tenants_pager(transport_name: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1724,15 +1864,28 @@ def test_list_tenants_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1752,7 +1905,8 @@ def test_list_tenants_pager(transport_name: str = "grpc"): def test_list_tenants_pages(transport_name: str = "grpc"): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1760,15 +1914,28 @@ def test_list_tenants_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1779,7 +1946,9 @@ def test_list_tenants_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tenants_async_pager(): - client = TenantServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = TenantServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1788,19 +1957,34 @@ async def test_list_tenants_async_pager(): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) - async_pager = await client.list_tenants(request={},) + async_pager = await client.list_tenants( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1812,7 +1996,9 @@ async def test_list_tenants_async_pager(): @pytest.mark.asyncio async def test_list_tenants_async_pages(): - client = TenantServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = TenantServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1821,15 +2007,28 @@ async def test_list_tenants_async_pages(): # Set the response to a series of pages. call.side_effect = ( tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + tenant.Tenant(), + ], next_page_token="abc", ), - tenant_service.ListTenantsResponse(tenants=[], next_page_token="def",), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(),], next_page_token="ghi", + tenants=[], + next_page_token="def", + ), + tenant_service.ListTenantsResponse( + tenants=[ + tenant.Tenant(), + ], + next_page_token="ghi", ), tenant_service.ListTenantsResponse( - tenants=[tenant.Tenant(), tenant.Tenant(),], + tenants=[ + tenant.Tenant(), + tenant.Tenant(), + ], ), RuntimeError, ) @@ -1847,7 +2046,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -1867,7 +2067,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = TenantServiceClient(client_options=options, transport=transport,) + client = TenantServiceClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -1883,7 +2086,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = TenantServiceClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -1928,8 +2132,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = TenantServiceClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.TenantServiceGrpcTransport,) + client = TenantServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.TenantServiceGrpcTransport, + ) def test_tenant_service_base_transport_error(): @@ -1978,7 +2187,8 @@ def test_tenant_service_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.TenantServiceTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -2146,7 +2356,8 @@ def test_tenant_service_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.TenantServiceGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2158,7 +2369,8 @@ def test_tenant_service_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.TenantServiceGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -2267,7 +2479,8 @@ def test_tenant_path(): project = "squid" tenant = "clam" expected = "projects/{project}/tenants/{tenant}".format( - project=project, tenant=tenant, + project=project, + tenant=tenant, ) actual = TenantServiceClient.tenant_path(project, tenant) assert expected == actual @@ -2307,7 +2520,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "cuttlefish" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = TenantServiceClient.common_folder_path(folder) assert expected == actual @@ -2325,7 +2540,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "winkle" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = TenantServiceClient.common_organization_path(organization) assert expected == actual @@ -2343,7 +2560,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "scallop" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = TenantServiceClient.common_project_path(project) assert expected == actual @@ -2363,7 +2582,8 @@ def test_common_location_path(): project = "squid" location = "clam" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = TenantServiceClient.common_location_path(project, location) assert expected == actual @@ -2388,7 +2608,8 @@ def test_client_with_default_client_info(): transports.TenantServiceTransport, "_prep_wrapped_messages" ) as prep: client = TenantServiceClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2397,7 +2618,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = TenantServiceClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2405,7 +2627,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = TenantServiceAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" From be5b258b7544c4dd3b5bcaac9c962e25e261a761 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:40:24 -0400 Subject: [PATCH 7/7] chore(main): release 2.5.2 (#223) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bd02c5..87ebc4b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-talent/#history +### [2.5.2](https://github.com/googleapis/python-talent/compare/v2.5.1...v2.5.2) (2022-03-29) + + +### Documentation + +* Added functionality in the companyDisplayNames filter to support fuzzy matching ([#221](https://github.com/googleapis/python-talent/issues/221)) ([985508c](https://github.com/googleapis/python-talent/commit/985508ce1cdd1050f5d6a7c7b6919408946e4c1d)) + ### [2.5.1](https://github.com/googleapis/python-talent/compare/v2.5.0...v2.5.1) (2022-03-05) diff --git a/setup.py b/setup.py index 23b740aa..5cfbdf22 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-talent" description = "Google Cloud Talent Solution API client library" -version = "2.5.1" +version = "2.5.2" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta'