ProfileServiceClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
A service that handles profile management, including profile CRUD, enumeration and search.
Methods
ProfileServiceClient
ProfileServiceClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Constructor.
Parameters | |
---|---|
Name | Description |
channel |
grpc.Channel
DEPRECATED. A |
credentials |
google.auth.credentials.Credentials
The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config |
dict
DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
client_options |
Union[dict, google.api_core.client_options.ClientOptions]
Client options used to set user options on the client. API Endpoint should be set through client_options. |
create_profile
create_profile(parent, profile, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates and returns a new profile.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
profile
:profile = {}
response = client.create_profile(parent, profile)
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the tenant this profile belongs to. The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/api-test-project/tenants/foo". |
profile |
Union[dict, Profile]
Required. The profile to be created. If a dict is provided, it must be of the same form as the protobuf message Profile |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_profile
delete_profile(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes the specified profile. Prerequisite: The profile has no associated applications or assignments associated.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]')
client.delete_profile(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the profile to be deleted. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for example, "projects/api-test-project/tenants/foo/profiles/bar". |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
ProfileServiceClient | The constructed client. |
from_service_account_json
from_service_account_json(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
ProfileServiceClient | The constructed client. |
get_profile
get_profile(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets the specified profile.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]')
response = client.get_profile(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the profile to get. The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for example, "projects/api-test-project/tenants/foo/profiles/bar". |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_profiles
list_profiles(parent, page_size=None, read_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists profiles by filter. The order is unspecified.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
Iterate over all results
for element in client.list_profiles(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_profiles(parent).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The resource name of the tenant under which the profile is created. The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/api-test-project/tenants/foo". |
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 streaming is performed per-page, this determines the maximum number of resources in a page. |
read_mask |
Union[dict, FieldMask]
Optional. A field mask to specify the profile fields to be listed in response. All fields are listed if it is unset. Valid values are: - name If a dict is provided, it must be of the same form as the protobuf message FieldMask |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
profile_path
profile_path(project, tenant, profile)
Return a fully-qualified profile string.
search_profiles
search_profiles(parent, request_metadata, profile_query=None, page_size=None, offset=None, disable_spell_check=None, order_by=None, case_sensitive_sort=None, histogram_queries=None, result_set_id=None, strict_keywords_search=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Searches for profiles within a tenant.
For example, search by raw queries "software engineer in Mountain View" or search by structured filters (location filter, education filter, etc.).
See SearchProfilesRequest
for more information.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
parent = client.tenant_path('[PROJECT]', '[TENANT]')
TODO: Initialize
request_metadata
:request_metadata = {}
Iterate over all results
for element in client.search_profiles(parent, request_metadata): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.search_profiles(parent, request_metadata).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The resource name of the tenant to search within. The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/api-test-project/tenants/foo". |
request_metadata |
Union[dict, RequestMetadata]
Required. The meta information collected about the profile search user. This is used to improve the search quality of the service. These values are provided by users, and must be precise and consistent. If a dict is provided, it must be of the same form as the protobuf message RequestMetadata |
profile_query |
Union[dict, ProfileQuery]
Optional. Search query to execute. See |
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 streaming is performed per-page, this determines the maximum number of resources in a page. |
offset |
int
Optional. An integer that specifies the current offset (that is, starting result) in search results. This field is only considered if |
disable_spell_check |
bool
Optional. This flag controls the spell-check feature. If |
order_by |
str
Optional. The criteria that determines how search results are sorted. Defaults is "relevance desc" if no value is specified. Supported options are: - "relevance desc": By descending relevance, as determined by the API algorithms. - "update_time desc": Sort by |
case_sensitive_sort |
bool
Optional. When sort by field is based on alphabetical order, sort values case sensitively (based on ASCII) when the value is set to true. Default value is case in-sensitive sort (false). |
histogram_queries |
list[Union[dict, HistogramQuery]]
Optional. A list of expressions specifies histogram requests against matching profiles for |
result_set_id |
str
Optional. An id that uniquely identifies the result set of a |
strict_keywords_search |
bool
Optional. This flag is used to indicate whether the service will attempt to understand synonyms and terms related to the search query or treat the query "as is" when it generates a set of results. By default this flag is set to false, thus allowing expanded results to also be returned. For example a search for "software engineer" might also return candidates who have experience in jobs similar to software engineer positions. By setting this flag to true, the service will only attempt to deliver candidates has software engineer in his/her global fields by treating "software engineer" as a keyword. It is recommended to provide a feature in the UI (such as a checkbox) to allow recruiters to set this flag to true if they intend to search for longer boolean strings. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
tenant_path
tenant_path(project, tenant)
Return a fully-qualified tenant string.
update_profile
update_profile(profile, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates the specified profile and returns the updated result.
.. rubric:: Example
from google.cloud import talent_v4beta1
client = talent_v4beta1.ProfileServiceClient()
TODO: Initialize
profile
:profile = {}
response = client.update_profile(profile)
Parameters | |
---|---|
Name | Description |
profile |
Union[dict, Profile]
Required. Profile to be updated. If a dict is provided, it must be of the same form as the protobuf message Profile |
update_mask |
Union[dict, FieldMask]
Optional. A field mask to specify the profile fields to update. A full update is performed if it is unset. Valid values are: - external_id - source - uri - is_hirable - create_time - update_time - resume - person_names - addresses - email_addresses - phone_numbers - personal_uris - additional_contact_info - employment_records - education_records - skills - projects - publications - patents - certifications - recruiting_notes - custom_attributes - group_id If a dict is provided, it must be of the same form as the protobuf message FieldMask |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |