From bd706b1c7d311b74589eed92960849036395b62d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:17:11 -0800 Subject: [PATCH] feat: A new enum `RelevanceThreshold` is added (#7984) feat: A new field `relevance_threshold` is added to message `.google.cloud.talent.v4.SearchJobsRequest` docs: multiple fixes for links in documentation PiperOrigin-RevId: 711534942 Source-Link: https://github.com/googleapis/googleapis/commit/c72d7385435589176aa6e44563fcfbc795b9a476 Source-Link: https://github.com/googleapis/googleapis-gen/commit/19d73c381f877aa86064ba3f9b64a26dc3a30cac Copy-Tag: eyJwIjoiVGFsZW50Ly5Pd2xCb3QueWFtbCIsImgiOiIxOWQ3M2MzODFmODc3YWE4NjA2NGJhM2Y5YjY0YTI2ZGMzYTMwY2FjIn0= --- Talent/metadata/V4/JobService.php | Bin 7638 -> 7836 bytes Talent/src/V4/BatchUpdateJobsRequest.php | 8 +- Talent/src/V4/Job.php | 104 ++++++++++-------- Talent/src/V4/LocationFilter.php | 12 +- Talent/src/V4/SearchJobsRequest.php | 46 ++++++++ .../SearchJobsRequest/RelevanceThreshold.php | 79 +++++++++++++ 6 files changed, 197 insertions(+), 52 deletions(-) create mode 100644 Talent/src/V4/SearchJobsRequest/RelevanceThreshold.php diff --git a/Talent/metadata/V4/JobService.php b/Talent/metadata/V4/JobService.php index 2f168ffe6f60ecd1c4a9ea54c609e730049880d8..acd7d37b4889a6b464debf07154adde7ad7d3edd 100644 GIT binary patch delta 214 zcmca+J;!##Ll%}#MqC<`7qW_P{=<^W!ZnwdOE5S!u_!rXvI2+g<`tZ`nB;}xxP*&R zb5hF^^O95JOEQX5i!<_bQY3^G7&Z8eY$g{E`L`BETTT#l`01AMP3)BETrb k&czI53owBMeO+BVLwyC9g*doaJUrb!1Xwm(^Uvl306ZiMS`~+nL3fBt?5mRMha${(dAP7CPs0rEvv*HZ8 J0repeated string addresses = 6; @@ -300,10 +303,11 @@ class Job extends \Google\Protobuf\Internal\Message * [posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] * must be set before * [posting_expire_time][google.cloud.talent.v4.Job.posting_expire_time]. The - * purpose of this feature is to allow other objects, such as [Application][], - * to refer a job that didn't exist in the system prior to becoming expired. - * If you want to modify a job that was expired on creation, delete it and - * create a new one. + * purpose of this feature is to allow other objects, such as + * [ApplicationInfo][google.cloud.talent.v4.Job.ApplicationInfo], to refer a + * job that didn't exist in the system prior to becoming expired. If you want + * to modify a job that was expired on creation, delete it and create a new + * one. * If this value isn't provided at the time of job creation or is invalid, * the job posting expires after 30 days from the job's creation time. For * example, if the job was created on 2017/01/01 13:00AM UTC with an @@ -412,13 +416,16 @@ class Job extends \Google\Protobuf\Internal\Message * to group the locations that close to each other in the same job for better * search experience. * Jobs with multiple addresses must have their addresses with the same - * [LocationType][] to allow location filtering to work properly. (For - * example, a Job with addresses "1600 Amphitheatre Parkway, Mountain View, - * CA, USA" and "London, UK" may not have location filters applied correctly - * at search time since the first is a [LocationType.STREET_ADDRESS][] and the - * second is a [LocationType.LOCALITY][].) If a job needs to have multiple - * addresses, it is suggested to split it into multiple jobs with same - * LocationTypes. + * [LocationType][google.cloud.talent.v4.Location.LocationType] to allow + * location filtering to work properly. (For example, a Job with addresses + * "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may + * not have location filters applied correctly at search time since the first + * is a + * [LocationType.STREET_ADDRESS][google.cloud.talent.v4.Location.LocationType.STREET_ADDRESS] + * and the second is a + * [LocationType.LOCALITY][google.cloud.talent.v4.Location.LocationType.LOCALITY].) + * If a job needs to have multiple addresses, it is suggested to split it into + * multiple jobs with same LocationTypes. * The maximum number of allowed characters is 500. * @type \Google\Cloud\Talent\V4\Job\ApplicationInfo $application_info * Job application information. @@ -542,10 +549,11 @@ class Job extends \Google\Protobuf\Internal\Message * [posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] * must be set before * [posting_expire_time][google.cloud.talent.v4.Job.posting_expire_time]. The - * purpose of this feature is to allow other objects, such as [Application][], - * to refer a job that didn't exist in the system prior to becoming expired. - * If you want to modify a job that was expired on creation, delete it and - * create a new one. + * purpose of this feature is to allow other objects, such as + * [ApplicationInfo][google.cloud.talent.v4.Job.ApplicationInfo], to refer a + * job that didn't exist in the system prior to becoming expired. If you want + * to modify a job that was expired on creation, delete it and create a new + * one. * If this value isn't provided at the time of job creation or is invalid, * the job posting expires after 30 days from the job's creation time. For * example, if the job was created on 2017/01/01 13:00AM UTC with an @@ -777,13 +785,16 @@ public function setDescription($var) * to group the locations that close to each other in the same job for better * search experience. * Jobs with multiple addresses must have their addresses with the same - * [LocationType][] to allow location filtering to work properly. (For - * example, a Job with addresses "1600 Amphitheatre Parkway, Mountain View, - * CA, USA" and "London, UK" may not have location filters applied correctly - * at search time since the first is a [LocationType.STREET_ADDRESS][] and the - * second is a [LocationType.LOCALITY][].) If a job needs to have multiple - * addresses, it is suggested to split it into multiple jobs with same - * LocationTypes. + * [LocationType][google.cloud.talent.v4.Location.LocationType] to allow + * location filtering to work properly. (For example, a Job with addresses + * "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may + * not have location filters applied correctly at search time since the first + * is a + * [LocationType.STREET_ADDRESS][google.cloud.talent.v4.Location.LocationType.STREET_ADDRESS] + * and the second is a + * [LocationType.LOCALITY][google.cloud.talent.v4.Location.LocationType.LOCALITY].) + * If a job needs to have multiple addresses, it is suggested to split it into + * multiple jobs with same LocationTypes. * The maximum number of allowed characters is 500. * * Generated from protobuf field repeated string addresses = 6; @@ -812,13 +823,16 @@ public function getAddresses() * to group the locations that close to each other in the same job for better * search experience. * Jobs with multiple addresses must have their addresses with the same - * [LocationType][] to allow location filtering to work properly. (For - * example, a Job with addresses "1600 Amphitheatre Parkway, Mountain View, - * CA, USA" and "London, UK" may not have location filters applied correctly - * at search time since the first is a [LocationType.STREET_ADDRESS][] and the - * second is a [LocationType.LOCALITY][].) If a job needs to have multiple - * addresses, it is suggested to split it into multiple jobs with same - * LocationTypes. + * [LocationType][google.cloud.talent.v4.Location.LocationType] to allow + * location filtering to work properly. (For example, a Job with addresses + * "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may + * not have location filters applied correctly at search time since the first + * is a + * [LocationType.STREET_ADDRESS][google.cloud.talent.v4.Location.LocationType.STREET_ADDRESS] + * and the second is a + * [LocationType.LOCALITY][google.cloud.talent.v4.Location.LocationType.LOCALITY].) + * If a job needs to have multiple addresses, it is suggested to split it into + * multiple jobs with same LocationTypes. * The maximum number of allowed characters is 500. * * Generated from protobuf field repeated string addresses = 6; @@ -1499,10 +1513,11 @@ public function setPostingPublishTime($var) * [posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] * must be set before * [posting_expire_time][google.cloud.talent.v4.Job.posting_expire_time]. The - * purpose of this feature is to allow other objects, such as [Application][], - * to refer a job that didn't exist in the system prior to becoming expired. - * If you want to modify a job that was expired on creation, delete it and - * create a new one. + * purpose of this feature is to allow other objects, such as + * [ApplicationInfo][google.cloud.talent.v4.Job.ApplicationInfo], to refer a + * job that didn't exist in the system prior to becoming expired. If you want + * to modify a job that was expired on creation, delete it and create a new + * one. * If this value isn't provided at the time of job creation or is invalid, * the job posting expires after 30 days from the job's creation time. For * example, if the job was created on 2017/01/01 13:00AM UTC with an @@ -1562,10 +1577,11 @@ public function clearPostingExpireTime() * [posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] * must be set before * [posting_expire_time][google.cloud.talent.v4.Job.posting_expire_time]. The - * purpose of this feature is to allow other objects, such as [Application][], - * to refer a job that didn't exist in the system prior to becoming expired. - * If you want to modify a job that was expired on creation, delete it and - * create a new one. + * purpose of this feature is to allow other objects, such as + * [ApplicationInfo][google.cloud.talent.v4.Job.ApplicationInfo], to refer a + * job that didn't exist in the system prior to becoming expired. If you want + * to modify a job that was expired on creation, delete it and create a new + * one. * If this value isn't provided at the time of job creation or is invalid, * the job posting expires after 30 days from the job's creation time. For * example, if the job was created on 2017/01/01 13:00AM UTC with an diff --git a/Talent/src/V4/LocationFilter.php b/Talent/src/V4/LocationFilter.php index 89caf8af7ac9..0b1a16ae3e59 100644 --- a/Talent/src/V4/LocationFilter.php +++ b/Talent/src/V4/LocationFilter.php @@ -69,7 +69,8 @@ class LocationFilter extends \Google\Protobuf\Internal\Message * [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][]. + * [address][google.cloud.talent.v4.LocationFilter.address] or + * [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -126,7 +127,8 @@ class LocationFilter extends \Google\Protobuf\Internal\Message * [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][]. + * [address][google.cloud.talent.v4.LocationFilter.address] or + * [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -299,7 +301,8 @@ public function setDistanceInMiles($var) * [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][]. + * [address][google.cloud.talent.v4.LocationFilter.address] or + * [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, @@ -332,7 +335,8 @@ public function getTelecommutePreference() * [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][]. + * [address][google.cloud.talent.v4.LocationFilter.address] or + * [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng]. * This filter can be used by itself to search exclusively for telecommuting * jobs, or it can be combined with another location * filter to search for a combination of job locations, diff --git a/Talent/src/V4/SearchJobsRequest.php b/Talent/src/V4/SearchJobsRequest.php index 640d9d634c4a..67fc3653ac94 100644 --- a/Talent/src/V4/SearchJobsRequest.php +++ b/Talent/src/V4/SearchJobsRequest.php @@ -321,6 +321,15 @@ class SearchJobsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode keyword_match_mode = 18; */ protected $keyword_match_mode = 0; + /** + * Optional. The relevance threshold of the search results. + * Default to Google defined threshold, leveraging a balance of + * precision and recall to deliver both highly accurate results and + * comprehensive coverage of relevant information. + * + * Generated from protobuf field .google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold relevance_threshold = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $relevance_threshold = 0; /** * Constructor. @@ -573,6 +582,11 @@ class SearchJobsRequest extends \Google\Protobuf\Internal\Message * Defaults to * [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] * if no value is specified. + * @type int $relevance_threshold + * Optional. The relevance threshold of the search results. + * Default to Google defined threshold, leveraging a balance of + * precision and recall to deliver both highly accurate results and + * comprehensive coverage of relevant information. * } */ public function __construct($data = NULL) { @@ -1434,5 +1448,37 @@ public function setKeywordMatchMode($var) return $this; } + /** + * Optional. The relevance threshold of the search results. + * Default to Google defined threshold, leveraging a balance of + * precision and recall to deliver both highly accurate results and + * comprehensive coverage of relevant information. + * + * Generated from protobuf field .google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold relevance_threshold = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRelevanceThreshold() + { + return $this->relevance_threshold; + } + + /** + * Optional. The relevance threshold of the search results. + * Default to Google defined threshold, leveraging a balance of + * precision and recall to deliver both highly accurate results and + * comprehensive coverage of relevant information. + * + * Generated from protobuf field .google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold relevance_threshold = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRelevanceThreshold($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4\SearchJobsRequest\RelevanceThreshold::class); + $this->relevance_threshold = $var; + + return $this; + } + } diff --git a/Talent/src/V4/SearchJobsRequest/RelevanceThreshold.php b/Talent/src/V4/SearchJobsRequest/RelevanceThreshold.php new file mode 100644 index 000000000000..cd1da60ed4ca --- /dev/null +++ b/Talent/src/V4/SearchJobsRequest/RelevanceThreshold.php @@ -0,0 +1,79 @@ +google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold + */ +class RelevanceThreshold +{ + /** + * Default value. In this case, server behavior defaults to Google defined + * threshold. + * + * Generated from protobuf enum RELEVANCE_THRESHOLD_UNSPECIFIED = 0; + */ + const RELEVANCE_THRESHOLD_UNSPECIFIED = 0; + /** + * Lowest relevance threshold. + * + * Generated from protobuf enum LOWEST = 1; + */ + const LOWEST = 1; + /** + * Low relevance threshold. + * + * Generated from protobuf enum LOW = 2; + */ + const LOW = 2; + /** + * Medium relevance threshold. + * + * Generated from protobuf enum MEDIUM = 3; + */ + const MEDIUM = 3; + /** + * High relevance threshold. + * + * Generated from protobuf enum HIGH = 4; + */ + const HIGH = 4; + + private static $valueToName = [ + self::RELEVANCE_THRESHOLD_UNSPECIFIED => 'RELEVANCE_THRESHOLD_UNSPECIFIED', + self::LOWEST => 'LOWEST', + self::LOW => 'LOW', + self::MEDIUM => 'MEDIUM', + self::HIGH => 'HIGH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +