nodes: 0, module; 1, function_definition; 2, function_name:search_profiles; 3, parameters; 4, block; 5, identifier:self; 6, identifier:parent; 7, identifier:request_metadata; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, expression_statement; 19, comment:# Wrap the transport method to add retry and timeout logic.; 20, if_statement; 21, expression_statement; 22, expression_statement; 23, return_statement; 24, identifier:profile_query; 25, None; 26, identifier:page_size; 27, None; 28, identifier:offset; 29, None; 30, identifier:disable_spell_check; 31, None; 32, identifier:order_by; 33, None; 34, identifier:case_sensitive_sort; 35, None; 36, identifier:histogram_queries; 37, None; 38, identifier:retry; 39, attribute; 40, identifier:timeout; 41, attribute; 42, identifier:metadata; 43, None; 44, comment:"""
          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.
  
          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
  
          Args:
              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, ~google.cloud.talent_v4beta1.types.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 :class:`~google.cloud.talent_v4beta1.types.RequestMetadata`
              profile_query (Union[dict, ~google.cloud.talent_v4beta1.types.ProfileQuery]): Optional.
  
                  Search query to execute. See ``ProfileQuery`` for more details.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.talent_v4beta1.types.ProfileQuery`
              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 ``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 (bool): Optional.
  
                  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 (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\_date desc": Sort by ``Profile.update_date`` in descending
                     order (recently updated profiles first).
                  -  "create\_date desc": Sort by ``Profile.create_date`` in descending
                     order (recently created profiles first).
                  -  "first\_name": Sort by ``PersonStrcuturedName.given_name`` in
                     ascending order.
                  -  "first\_name desc": Sort by ``PersonStrcuturedName.given_name`` in
                     descending order.
                  -  "last\_name": Sort by ``PersonStrcuturedName.family_name`` in
                     ascending order.
                  -  "last\_name desc": Sort by ``PersonStrcuturedName.family_name`` in
                     ascending order.
              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, ~google.cloud.talent_v4beta1.types.HistogramQuery]]): Optional.
  
                  A list of expressions specifies histogram requests against matching
                  profiles for ``SearchProfilesRequest``.
  
                  The expression syntax looks like a function definition with optional
                  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 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\_reason: The application outcome reason
                     specifies the outcome reasons of job application. See
                     ``ApplicationOutcomeReasonFilter`` for more details.
                  -  application\_last\_stage: The application last stage specifies the
                     last stage of job application. See ``ApplicationLastStageFilter`` for
                     more details.
                  -  application\_job\_title: The application job title specifies the job
                     applied for in the application. See ``ApplicationJobFilter`` for more
                     details.
                  -  application\_status: The application status specifies the status of
                     job application. See ``ApplicationStatusFilter`` 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")])
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.talent_v4beta1.types.HistogramQuery`
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.talent_v4beta1.types.HistogramQueryResult` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              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.
          """; 45, comparison_operator:"search_profiles" not in self._inner_api_calls; 46, block; 47, assignment; 48, assignment; 49, identifier:iterator; 50, attribute; 51, identifier:DEFAULT; 52, attribute; 53, identifier:DEFAULT; 54, string:"search_profiles"; 55, attribute; 56, expression_statement; 57, identifier:request; 58, call; 59, identifier:iterator; 60, call; 61, attribute; 62, identifier:method; 63, attribute; 64, identifier:method; 65, identifier:self; 66, identifier:_inner_api_calls; 67, assignment; 68, attribute; 69, argument_list; 70, attribute; 71, argument_list; 72, attribute; 73, identifier:gapic_v1; 74, attribute; 75, identifier:gapic_v1; 76, subscript; 77, call; 78, identifier:profile_service_pb2; 79, identifier:SearchProfilesRequest; 80, keyword_argument; 81, keyword_argument; 82, keyword_argument; 83, keyword_argument; 84, keyword_argument; 85, keyword_argument; 86, keyword_argument; 87, keyword_argument; 88, keyword_argument; 89, attribute; 90, identifier:GRPCIterator; 91, keyword_argument; 92, keyword_argument; 93, keyword_argument; 94, keyword_argument; 95, keyword_argument; 96, keyword_argument; 97, identifier:google; 98, identifier:api_core; 99, identifier:google; 100, identifier:api_core; 101, attribute; 102, string:"search_profiles"; 103, attribute; 104, argument_list; 105, identifier:parent; 106, identifier:parent; 107, identifier:request_metadata; 108, identifier:request_metadata; 109, identifier:profile_query; 110, identifier:profile_query; 111, identifier:page_size; 112, identifier:page_size; 113, identifier:offset; 114, identifier:offset; 115, identifier:disable_spell_check; 116, identifier:disable_spell_check; 117, identifier:order_by; 118, identifier:order_by; 119, identifier:case_sensitive_sort; 120, identifier:case_sensitive_sort; 121, identifier:histogram_queries; 122, identifier:histogram_queries; 123, attribute; 124, identifier:page_iterator; 125, identifier:client; 126, None; 127, identifier:method; 128, call; 129, identifier:request; 130, identifier:request; 131, identifier:items_field; 132, string:"histogram_query_results"; 133, identifier:request_token_field; 134, string:"page_token"; 135, identifier:response_token_field; 136, string:"next_page_token"; 137, identifier:self; 138, identifier:_inner_api_calls; 139, attribute; 140, identifier:wrap_method; 141, attribute; 142, keyword_argument; 143, keyword_argument; 144, keyword_argument; 145, identifier:google; 146, identifier:api_core; 147, attribute; 148, argument_list; 149, attribute; 150, identifier:method; 151, attribute; 152, identifier:search_profiles; 153, identifier:default_retry; 154, attribute; 155, identifier:default_timeout; 156, attribute; 157, identifier:client_info; 158, attribute; 159, identifier:functools; 160, identifier:partial; 161, subscript; 162, keyword_argument; 163, keyword_argument; 164, keyword_argument; 165, attribute; 166, identifier:gapic_v1; 167, identifier:self; 168, identifier:transport; 169, subscript; 170, identifier:retry; 171, subscript; 172, identifier:timeout; 173, identifier:self; 174, identifier:_client_info; 175, attribute; 176, string:"search_profiles"; 177, identifier:retry; 178, identifier:retry; 179, identifier:timeout; 180, identifier:timeout; 181, identifier:metadata; 182, identifier:metadata; 183, identifier:google; 184, identifier:api_core; 185, attribute; 186, string:"SearchProfiles"; 187, attribute; 188, string:"SearchProfiles"; 189, identifier:self; 190, identifier:_inner_api_calls; 191, identifier:self; 192, identifier:_method_configs; 193, identifier:self; 194, identifier:_method_configs
code: def search_profiles(
          self,
          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,
          retry=google.api_core.gapic_v1.method.DEFAULT,
          timeout=google.api_core.gapic_v1.method.DEFAULT,
          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.
  
          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
  
          Args:
              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, ~google.cloud.talent_v4beta1.types.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 :class:`~google.cloud.talent_v4beta1.types.RequestMetadata`
              profile_query (Union[dict, ~google.cloud.talent_v4beta1.types.ProfileQuery]): Optional.
  
                  Search query to execute. See ``ProfileQuery`` for more details.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.talent_v4beta1.types.ProfileQuery`
              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 ``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 (bool): Optional.
  
                  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 (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\_date desc": Sort by ``Profile.update_date`` in descending
                     order (recently updated profiles first).
                  -  "create\_date desc": Sort by ``Profile.create_date`` in descending
                     order (recently created profiles first).
                  -  "first\_name": Sort by ``PersonStrcuturedName.given_name`` in
                     ascending order.
                  -  "first\_name desc": Sort by ``PersonStrcuturedName.given_name`` in
                     descending order.
                  -  "last\_name": Sort by ``PersonStrcuturedName.family_name`` in
                     ascending order.
                  -  "last\_name desc": Sort by ``PersonStrcuturedName.family_name`` in
                     ascending order.
              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, ~google.cloud.talent_v4beta1.types.HistogramQuery]]): Optional.
  
                  A list of expressions specifies histogram requests against matching
                  profiles for ``SearchProfilesRequest``.
  
                  The expression syntax looks like a function definition with optional
                  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 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\_reason: The application outcome reason
                     specifies the outcome reasons of job application. See
                     ``ApplicationOutcomeReasonFilter`` for more details.
                  -  application\_last\_stage: The application last stage specifies the
                     last stage of job application. See ``ApplicationLastStageFilter`` for
                     more details.
                  -  application\_job\_title: The application job title specifies the job
                     applied for in the application. See ``ApplicationJobFilter`` for more
                     details.
                  -  application\_status: The application status specifies the status of
                     job application. See ``ApplicationStatusFilter`` 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")])
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.talent_v4beta1.types.HistogramQuery`
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.talent_v4beta1.types.HistogramQueryResult` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              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.
          """
          # Wrap the transport method to add retry and timeout logic.
          if "search_profiles" not in self._inner_api_calls:
              self._inner_api_calls[
                  "search_profiles"
              ] = google.api_core.gapic_v1.method.wrap_method(
                  self.transport.search_profiles,
                  default_retry=self._method_configs["SearchProfiles"].retry,
                  default_timeout=self._method_configs["SearchProfiles"].timeout,
                  client_info=self._client_info,
              )
  
          request = profile_service_pb2.SearchProfilesRequest(
              parent=parent,
              request_metadata=request_metadata,
              profile_query=profile_query,
              page_size=page_size,
              offset=offset,
              disable_spell_check=disable_spell_check,
              order_by=order_by,
              case_sensitive_sort=case_sensitive_sort,
              histogram_queries=histogram_queries,
          )
          iterator = google.api_core.page_iterator.GRPCIterator(
              client=None,
              method=functools.partial(
                  self._inner_api_calls["search_profiles"],
                  retry=retry,
                  timeout=timeout,
                  metadata=metadata,
              ),
              request=request,
              items_field="histogram_query_results",
              request_token_field="page_token",
              response_token_field="next_page_token",
          )
          return iterator