Cloud Talent Solution V4beta1 API - Class Google::Cloud::Talent::V4beta1::ProfileService::Client (v0.4.6)

Reference documentation and code samples for the Cloud Talent Solution V4beta1 API class Google::Cloud::Talent::V4beta1::ProfileService::Client.

Client for the ProfileService service.

A service that handles profile management, including profile CRUD, enumeration and search.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the ProfileService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all ProfileService clients
::Google::Cloud::Talent::V4beta1::ProfileService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the ProfileService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_profile

def create_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
def create_profile(parent: nil, profile: nil) -> ::Google::Cloud::Talent::V4beta1::Profile

Creates and returns a new profile.

Overloads
def create_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to create_profile via a request object, either of type CreateProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::CreateProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_profile(parent: nil, profile: nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to create_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the tenant this profile belongs to.

    The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".

  • profile (::Google::Cloud::Talent::V4beta1::Profile, ::Hash) — Required. The profile to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::CreateProfileRequest.new

# Call the create_profile method.
result = client.create_profile request

# The returned object is of type Google::Cloud::Talent::V4beta1::Profile.
p result

#delete_profile

def delete_profile(request, options = nil) -> ::Google::Protobuf::Empty
def delete_profile(name: nil) -> ::Google::Protobuf::Empty

Deletes the specified profile. Prerequisite: The profile has no associated applications or assignments associated.

Overloads
def delete_profile(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_profile via a request object, either of type DeleteProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::DeleteProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_profile(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Resource name of the profile to be deleted.

    The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For example, "projects/foo/tenants/bar/profiles/baz".

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::DeleteProfileRequest.new

# Call the delete_profile method.
result = client.delete_profile request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_profile

def get_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
def get_profile(name: nil) -> ::Google::Cloud::Talent::V4beta1::Profile

Gets the specified profile.

Overloads
def get_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to get_profile via a request object, either of type GetProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::GetProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_profile(name: nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to get_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Resource name of the profile to get.

    The format is "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For example, "projects/foo/tenants/bar/profiles/baz".

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::GetProfileRequest.new

# Call the get_profile method.
result = client.get_profile request

# The returned object is of type Google::Cloud::Talent::V4beta1::Profile.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new ProfileService client object.

Yields
  • (config) — Configure the ProfileService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new do |config|
  config.timeout = 10.0
end

#list_profiles

def list_profiles(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Profile>
def list_profiles(parent: nil, filter: nil, page_token: nil, page_size: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Profile>

Lists profiles by filter. The order is unspecified.

Overloads
def list_profiles(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Profile>
Pass arguments to list_profiles via a request object, either of type ListProfilesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::ListProfilesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_profiles(parent: nil, filter: nil, page_token: nil, page_size: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Profile>
Pass arguments to list_profiles via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — 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/foo/tenants/bar".

  • filter (::String) —

    The filter string specifies the profiles to be enumerated.

    Supported operator: =, AND

    The field(s) eligible for filtering are:

    • externalId
    • groupId

    externalId and groupId cannot be specified at the same time. If both externalId and groupId are provided, the API will return a bad request error.

    Sample Query:

    • externalId = "externalId-1"
    • groupId = "groupId-1"
  • page_token (::String) — The token that specifies the current offset (that is, starting result).

    Please set the value to ListProfilesResponse.next_page_token to continue the list.

  • page_size (::Integer) — The maximum number of profiles to be returned, at most 100.

    Default is 100 unless a positive number smaller than 100 is specified.

  • read_mask (::Google::Protobuf::FieldMask, ::Hash) —

    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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::ListProfilesRequest.new

# Call the list_profiles method.
result = client.list_profiles request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Talent::V4beta1::Profile.
  p response
end

#search_profiles

def search_profiles(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::SearchProfilesResponse
def search_profiles(parent: nil, request_metadata: nil, profile_query: nil, page_size: nil, page_token: nil, offset: nil, disable_spell_check: nil, order_by: nil, case_sensitive_sort: nil, histogram_queries: nil, result_set_id: nil, strict_keywords_search: nil) -> ::Google::Cloud::Talent::V4beta1::SearchProfilesResponse

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.

Overloads
def search_profiles(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::SearchProfilesResponse
Pass arguments to search_profiles via a request object, either of type SearchProfilesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::SearchProfilesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def search_profiles(parent: nil, request_metadata: nil, profile_query: nil, page_size: nil, page_token: nil, offset: nil, disable_spell_check: nil, order_by: nil, case_sensitive_sort: nil, histogram_queries: nil, result_set_id: nil, strict_keywords_search: nil) -> ::Google::Cloud::Talent::V4beta1::SearchProfilesResponse
Pass arguments to search_profiles via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the tenant to search within.

    The format is "projects/{project_id}/tenants/{tenant_id}". For example, "projects/foo/tenants/bar".

  • request_metadata (::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash) — 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.
  • profile_query (::Google::Cloud::Talent::V4beta1::ProfileQuery, ::Hash) — Search query to execute. See ProfileQuery for more details.
  • page_size (::Integer) — A limit on the number of profiles returned in the search results. A value above the default value 10 can increase search response time.

    The maximum value allowed is 100. Otherwise an error is thrown.

  • page_token (::String) — The pageToken, similar to offset enables users of the API to paginate through the search results. To retrieve the first page of results, set the pageToken to empty. The search response includes a nextPageToken field that can be used to populate the pageToken field for the next page of results. Using pageToken instead of offset increases the performance of the API, especially compared to larger offset values.
  • offset (::Integer) — An integer that specifies the current offset (that is, starting result) in search results. This field is only considered if page_token is unset.

    The maximum allowed value is 5000. Otherwise an error is thrown.

    For example, 0 means to search from the first profile, and 10 means to search from the 11th profile. This can be used for pagination, for example pageSize = 10 and offset = 10 means to search from the second page.

  • disable_spell_check (::Boolean) — This flag controls the spell-check feature. If false, the service attempts to correct a misspelled query.

    For example, "enginee" is corrected to "engineer".

  • order_by (::String) —

    The criteria that determines how search results are sorted. Defaults is "relevance desc" if no value is specified.

    Supported options are:

  • case_sensitive_sort (::Boolean) — 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 (::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>) —

    A list of expressions specifies histogram requests against matching profiles for SearchProfilesRequest.

    The expression syntax looks like a function definition with parameters.

    Function syntax: function_name(histogram_facet[, list of buckets])

    Data types:

    • Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
    • String: string like "any string with backslash escape for quote(\")."
    • Number: whole number and floating point number like 10, -1 and -0.01.
    • List: list of elements with comma(,) separator surrounded by square brackets. For example, [1, 2, 3] and ["one", "two", "three"].

    Built-in constants:

    • MIN (minimum number similar to java Double.MIN_VALUE)
    • MAX (maximum number similar to java Double.MAX_VALUE)

    Built-in functions:

    • bucket(start, end[, label]) Bucket build-in function creates a bucket with range of [start, end). Note that the end is exclusive. For example, bucket(1, MAX, "positive number") or bucket(1, 10).

    Histogram Facets:

    • admin1: Admin1 is a global placeholder for referring to state, province, or the particular term a country uses to define the geographic structure below the country level. Examples include states codes such as "CA", "IL", "NY", and provinces, such as "BC".
    • locality: Locality is a global placeholder for referring to city, town, or the particular term a country uses to define the geographic structure below the admin1 level. Examples include city names such as "Mountain View" and "New York".
    • extended_locality: Extended locality is concatenated version of admin1 and locality with comma separator. For example, "Mountain View, CA" and "New York, NY".
    • postal_code: Postal code of profile which follows locale code.
    • country: Country code (ISO-3166-1 alpha-2 code) of profile, such as US, JP, GB.
    • job_title: Normalized job titles specified in EmploymentHistory.
    • company_name: Normalized company name of profiles to match on.
    • institution: The school name. For example, "MIT", "University of California, Berkeley"
    • degree: Highest education degree in ISCED code. Each value in degree covers a specific level of education, without any expansion to upper nor lower levels of education degree.
    • experience_in_months: experience in months. 0 means 0 month to 1 month (exclusive).
    • application_date: The application date specifies application start dates. See ApplicationDateFilter for more details.
    • application_outcome_notes: The application outcome reason specifies the reasons behind the outcome of the job application. See ApplicationOutcomeNotesFilter for more details.
    • application_job_title: The application job title specifies the job applied for in the application. See ApplicationJobFilter for more details.
    • hirable_status: Hirable status specifies the profile's hirable status.
    • string_custom_attribute: String custom attributes. Values can be accessed via square bracket notation like string_custom_attribute["key1"].
    • numeric_custom_attribute: Numeric custom attributes. Values can be accessed via square bracket notation like numeric_custom_attribute["key1"].

    Example expressions:

    • count(admin1)
    • count(experience_in_months, [bucket(0, 12, "1 year"), bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ years")])
    • count(string_custom_attribute["assigned_recruiter"])
    • count(numeric_custom_attribute["favorite_number"], [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])
  • result_set_id (::String) — An id that uniquely identifies the result set of a SearchProfiles call. The id should be retrieved from the SearchProfilesResponse message returned from a previous invocation of SearchProfiles.

    A result set is an ordered list of search results.

    If this field is not set, a new result set is computed based on the profile_query. A new result_set_id is returned as a handle to access this result set.

    If this field is set, the service will ignore the resource and profile_query values, and simply retrieve a page of results from the corresponding result set. In this case, one and only one of page_token or offset must be set.

    A typical use case is to invoke SearchProfilesRequest without this field, then use the resulting result_set_id in SearchProfilesResponse to page through the results.

  • strict_keywords_search (::Boolean) — 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.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::SearchProfilesRequest.new

# Call the search_profiles method.
result = client.search_profiles request

# The returned object is of type Google::Cloud::Talent::V4beta1::SearchProfilesResponse.
p result

#update_profile

def update_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
def update_profile(profile: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Profile

Updates the specified profile and returns the updated result.

Overloads
def update_profile(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to update_profile via a request object, either of type UpdateProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::UpdateProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_profile(profile: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Profile
Pass arguments to update_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::ProfileService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::UpdateProfileRequest.new

# Call the update_profile method.
result = client.update_profile request

# The returned object is of type Google::Cloud::Talent::V4beta1::Profile.
p result