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

Commit

Permalink
Integrate Python GAPIC Microgenerator in googleapis. This PR uses usi…
Browse files Browse the repository at this point in the history
…ng documentai as an example. Depends on googleapis/gapic-generator-python#402

PiperOrigin-RevId: 309824146

Source-Author: Google APIs <[email protected]>
Source-Date: Mon May 4 15:06:44 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: e0f9d9e1f9de890db765be46f45ca8490723e3eb
Source-Link: googleapis/googleapis@e0f9d9e
  • Loading branch information
yoshi-automation committed Jun 24, 2020
1 parent a9f9c14 commit 75da206
Show file tree
Hide file tree
Showing 33 changed files with 2,465 additions and 2,497 deletions.
6 changes: 3 additions & 3 deletions google/cloud/talent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
__all__ = (
"enums",
"types",
"JobServiceClient",
"ApplicationServiceClient",
"CompanyServiceClient",
"CompletionClient",
"ApplicationServiceClient",
"TenantServiceClient",
"EventServiceClient",
"JobServiceClient",
"ProfileServiceClient",
"TenantServiceClient",
)
26 changes: 13 additions & 13 deletions google/cloud/talent_v4beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
warnings.warn(message, DeprecationWarning)


class JobServiceClient(job_service_client.JobServiceClient):
__doc__ = job_service_client.JobServiceClient.__doc__
class ApplicationServiceClient(application_service_client.ApplicationServiceClient):
__doc__ = application_service_client.ApplicationServiceClient.__doc__
enums = enums


Expand All @@ -54,34 +54,34 @@ class CompletionClient(completion_client.CompletionClient):
enums = enums


class ApplicationServiceClient(application_service_client.ApplicationServiceClient):
__doc__ = application_service_client.ApplicationServiceClient.__doc__
class EventServiceClient(event_service_client.EventServiceClient):
__doc__ = event_service_client.EventServiceClient.__doc__
enums = enums


class TenantServiceClient(tenant_service_client.TenantServiceClient):
__doc__ = tenant_service_client.TenantServiceClient.__doc__
class JobServiceClient(job_service_client.JobServiceClient):
__doc__ = job_service_client.JobServiceClient.__doc__
enums = enums


class EventServiceClient(event_service_client.EventServiceClient):
__doc__ = event_service_client.EventServiceClient.__doc__
class ProfileServiceClient(profile_service_client.ProfileServiceClient):
__doc__ = profile_service_client.ProfileServiceClient.__doc__
enums = enums


class ProfileServiceClient(profile_service_client.ProfileServiceClient):
__doc__ = profile_service_client.ProfileServiceClient.__doc__
class TenantServiceClient(tenant_service_client.TenantServiceClient):
__doc__ = tenant_service_client.TenantServiceClient.__doc__
enums = enums


__all__ = (
"enums",
"types",
"JobServiceClient",
"ApplicationServiceClient",
"CompanyServiceClient",
"CompletionClient",
"ApplicationServiceClient",
"TenantServiceClient",
"EventServiceClient",
"JobServiceClient",
"ProfileServiceClient",
"TenantServiceClient",
)
32 changes: 10 additions & 22 deletions google/cloud/talent_v4beta1/gapic/application_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@
from google.cloud.talent_v4beta1.proto import application_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import common_pb2
from google.cloud.talent_v4beta1.proto import company_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import completion_service_pb2
from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import filters_pb2
from google.cloud.talent_v4beta1.proto import histogram_pb2
from google.cloud.talent_v4beta1.proto import job_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2

Expand Down Expand Up @@ -282,7 +270,7 @@ def delete_application(
name (str): Required. The resource name of the application to be deleted.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}/applications/{application\_id}".
"projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
Expand Down Expand Up @@ -353,12 +341,12 @@ def create_application(
>>> response = client.create_application(parent, application)
Args:
parent (str): Required. Resource name of the profile under which the application is
created.
parent (str): Required. Resource name of the profile under which the application
is created.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}".
For example, "projects/foo/tenants/bar/profiles/baz".
"projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
example, "projects/foo/tenants/bar/profiles/baz".
application (Union[dict, ~google.cloud.talent_v4beta1.types.Application]): Required. The application to be created.
If a dict is provided, it must be of the same form as the protobuf
Expand Down Expand Up @@ -436,7 +424,7 @@ def get_application(
name (str): Required. The resource name of the application to be retrieved.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}/applications/{application\_id}".
"projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
Expand Down Expand Up @@ -605,12 +593,12 @@ def list_applications(
... pass
Args:
parent (str): Required. Resource name of the profile under which the application is
created.
parent (str): Required. Resource name of the profile under which the application
is created.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}",
for example, "projects/foo/tenants/bar/profiles/baz".
"projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for
example, "projects/foo/tenants/bar/profiles/baz".
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
Expand Down
32 changes: 14 additions & 18 deletions google/cloud/talent_v4beta1/gapic/company_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@
from google.cloud.talent_v4beta1.gapic import company_service_client_config
from google.cloud.talent_v4beta1.gapic import enums
from google.cloud.talent_v4beta1.gapic.transports import company_service_grpc_transport
from google.cloud.talent_v4beta1.proto import common_pb2
from google.cloud.talent_v4beta1.proto import application_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import company_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import filters_pb2
from google.cloud.talent_v4beta1.proto import histogram_pb2
from google.cloud.talent_v4beta1.proto import job_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2

Expand Down Expand Up @@ -249,8 +245,8 @@ def delete_company(
name (str): Required. The resource name of the company to be deleted.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}",
for example, "projects/foo/tenants/bar/companies/baz".
"projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
example, "projects/foo/tenants/bar/companies/baz".
If tenant id is unspecified, the default tenant is used, for example,
"projects/foo/companies/bar".
Expand Down Expand Up @@ -315,7 +311,7 @@ def create_company(
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>> parent = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> # TODO: Initialize `company`:
>>> company = {}
Expand All @@ -326,9 +322,9 @@ def create_company(
parent (str): Required. Resource name of the tenant under which the company is
created.
The format is "projects/{project\_id}/tenants/{tenant\_id}", for
example, "projects/foo/tenant/bar". If tenant id is unspecified, a
default tenant is created, for example, "projects/foo".
The format is "projects/{project_id}/tenants/{tenant_id}", for example,
"projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
is created, for example, "projects/foo".
company (Union[dict, ~google.cloud.talent_v4beta1.types.Company]): Required. The company to be created.
If a dict is provided, it must be of the same form as the protobuf
Expand Down Expand Up @@ -406,8 +402,8 @@ def get_company(
name (str): Required. The resource name of the company to be retrieved.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}",
for example, "projects/api-test-project/tenants/foo/companies/bar".
"projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
example, "projects/api-test-project/tenants/foo/companies/bar".
If tenant id is unspecified, the default tenant is used, for example,
"projects/api-test-project/companies/bar".
Expand Down Expand Up @@ -562,7 +558,7 @@ def list_companies(
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>> parent = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> # Iterate over all results
>>> for element in client.list_companies(parent):
Expand All @@ -582,8 +578,8 @@ def list_companies(
parent (str): Required. Resource name of the tenant under which the company is
created.
The format is "projects/{project\_id}/tenants/{tenant\_id}", for
example, "projects/foo/tenant/bar".
The format is "projects/{project_id}/tenants/{tenant_id}", for example,
"projects/foo/tenant/bar".
If tenant id is unspecified, the default tenant will be used, for
example, "projects/foo".
Expand Down
30 changes: 14 additions & 16 deletions google/cloud/talent_v4beta1/gapic/completion_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@
from google.cloud.talent_v4beta1.gapic import completion_client_config
from google.cloud.talent_v4beta1.gapic import enums
from google.cloud.talent_v4beta1.gapic.transports import completion_grpc_transport
from google.cloud.talent_v4beta1.proto import common_pb2
from google.cloud.talent_v4beta1.proto import application_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2
from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import company_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2
from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import completion_service_pb2
from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc
from google.cloud.talent_v4beta1.proto import filters_pb2
from google.cloud.talent_v4beta1.proto import histogram_pb2
from google.cloud.talent_v4beta1.proto import job_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2
from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2

Expand Down Expand Up @@ -247,7 +243,7 @@ def complete_query(
>>>
>>> client = talent_v4beta1.CompletionClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>> parent = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> # TODO: Initialize `query`:
>>> query = ''
Expand All @@ -258,10 +254,11 @@ def complete_query(
>>> response = client.complete_query(parent, query, page_size)
Args:
parent (str): Required. Resource name of tenant the completion is performed within.
parent (str): Required. Resource name of tenant the completion is performed
within.
The format is "projects/{project\_id}/tenants/{tenant\_id}", for
example, "projects/foo/tenant/bar".
The format is "projects/{project_id}/tenants/{tenant_id}", for example,
"projects/foo/tenant/bar".
If tenant id is unspecified, the default tenant is used, for example,
"projects/foo".
Expand All @@ -271,20 +268,21 @@ def complete_query(
page_size (int): Required. Completion result count.
The maximum allowed page size is 10.
language_codes (list[str]): The list of languages of the query. This is the BCP-47 language code,
such as "en-US" or "sr-Latn". For more information, see `Tags for
language_codes (list[str]): The list of languages of the query. This is the BCP-47 language
code, such as "en-US" or "sr-Latn". For more information, see `Tags for
Identifying Languages <https://tools.ietf.org/html/bcp47>`__.
The maximum number of allowed characters is 255.
company (str): If provided, restricts completion to specified company.
The format is
"projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}",
for example, "projects/foo/tenants/bar/companies/baz".
"projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
example, "projects/foo/tenants/bar/companies/baz".
If tenant id is unspecified, the default tenant is used, for example,
"projects/foo".
scope (~google.cloud.talent_v4beta1.types.CompletionScope): The scope of the completion. The defaults is ``CompletionScope.PUBLIC``.
scope (~google.cloud.talent_v4beta1.types.CompletionScope): The scope of the completion. The defaults is
``CompletionScope.PUBLIC``.
type_ (~google.cloud.talent_v4beta1.types.CompletionType): The completion topic. The default is ``CompletionType.COMBINED``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
Expand Down
Loading

0 comments on commit 75da206

Please sign in to comment.