Skip to content

Commit 70197f3

Browse files
authored
resolving the following issue: GoogleCloudPlatform#2549 (GoogleCloudPlatform#2634)
1 parent bbe8ff7 commit 70197f3

14 files changed

+14
-31
lines changed

jobs/v4/src/main/java/com/example/jobs/CommuteSearchJobs.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.google.cloud.talent.v4beta1.SearchJobsRequest;
2828
import com.google.cloud.talent.v4beta1.SearchJobsResponse;
2929
import com.google.cloud.talent.v4beta1.TenantName;
30-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
3130
import com.google.protobuf.Duration;
3231
import com.google.type.LatLng;
3332
import java.io.IOException;
@@ -44,7 +43,7 @@ public static void searchJobs() throws IOException {
4443
// Search Jobs with histogram queries.
4544
public static void searchJobs(String projectId, String tenantId) throws IOException {
4645
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
47-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
46+
TenantName parent = TenantName.of(projectId, tenantId);
4847
String domain = "www.example.com";
4948
String sessionId = "Hashed session identifier";
5049
String userId = "Hashed user identifier";

jobs/v4/src/main/java/com/example/jobs/CustomRankingSearchJobs.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818

1919
// [START job_search_custom_ranking_search]
2020

21-
import com.google.cloud.talent.v4beta1.HistogramQuery;
2221
import com.google.cloud.talent.v4beta1.Job;
2322
import com.google.cloud.talent.v4beta1.JobServiceClient;
2423
import com.google.cloud.talent.v4beta1.RequestMetadata;
2524
import com.google.cloud.talent.v4beta1.SearchJobsRequest;
2625
import com.google.cloud.talent.v4beta1.SearchJobsResponse;
2726
import com.google.cloud.talent.v4beta1.TenantName;
28-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2927
import java.io.IOException;
3028

3129
public class CustomRankingSearchJobs {
@@ -40,7 +38,7 @@ public static void searchCustomRankingJobs() throws IOException {
4038
// Search Jobs using custom rankings.
4139
public static void searchCustomRankingJobs(String projectId, String tenantId) throws IOException {
4240
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
43-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
41+
TenantName parent = TenantName.of(projectId, tenantId);
4442
String domain = "www.example.com";
4543
String sessionId = "Hashed session identifier";
4644
String userId = "Hashed user identifier";

jobs/v4/src/main/java/com/example/jobs/HistogramSearchJobs.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.cloud.talent.v4beta1.SearchJobsRequest;
2626
import com.google.cloud.talent.v4beta1.SearchJobsResponse;
2727
import com.google.cloud.talent.v4beta1.TenantName;
28-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2928
import java.io.IOException;
3029

3130
public class HistogramSearchJobs {
@@ -42,7 +41,7 @@ public static void searchJobs() throws IOException {
4241
public static void searchJobs(String projectId, String tenantId, String query)
4342
throws IOException {
4443
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
45-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
44+
TenantName parent = TenantName.of(projectId, tenantId);
4645

4746
String domain = "http://www.jobUrl.com";
4847
String sessionId = "Hashed session identifier";

jobs/v4/src/main/java/com/example/jobs/JobSearchAutoCompleteJobTitle.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.cloud.talent.v4beta1.CompleteQueryResponse;
2323
import com.google.cloud.talent.v4beta1.CompletionClient;
2424
import com.google.cloud.talent.v4beta1.TenantName;
25-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2625
import java.io.IOException;
2726

2827
public class JobSearchAutoCompleteJobTitle {
@@ -39,7 +38,7 @@ public static void completeQuery() throws IOException {
3938
public static void completeQuery(String projectId, String tenantId, String query)
4039
throws IOException {
4140
try (CompletionClient completionClient = CompletionClient.create()) {
42-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
41+
TenantName parent = TenantName.of(projectId, tenantId);
4342
CompleteQueryRequest request =
4443
CompleteQueryRequest.newBuilder()
4544
.setParent(parent.toString())

jobs/v4/src/main/java/com/example/jobs/JobSearchCreateClientEvent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.google.cloud.talent.v4beta1.EventServiceClient;
2424
import com.google.cloud.talent.v4beta1.JobEvent;
2525
import com.google.cloud.talent.v4beta1.TenantName;
26-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2726
import com.google.protobuf.Timestamp;
2827
import java.io.IOException;
2928
import java.util.Arrays;
@@ -44,7 +43,7 @@ public static void createClientEvent() throws IOException {
4443
public static void createClientEvent(
4544
String projectId, String tenantId, String requestId, String eventId) throws IOException {
4645
try (EventServiceClient eventServiceClient = EventServiceClient.create()) {
47-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
46+
TenantName parent = TenantName.of(projectId, tenantId);
4847

4948
// The timestamp of the event as seconds of UTC time since Unix epoch
5049
// For more information on how to create google.protobuf.Timestamps

jobs/v4/src/main/java/com/example/jobs/JobSearchCreateCompany.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
2323
import com.google.cloud.talent.v4beta1.CreateCompanyRequest;
2424
import com.google.cloud.talent.v4beta1.TenantName;
25-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2625
import java.io.IOException;
2726

2827
public class JobSearchCreateCompany {
@@ -40,7 +39,7 @@ public static void createCompany() throws IOException {
4039
public static void createCompany(
4140
String projectId, String tenantId, String displayName, String externalId) throws IOException {
4241
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
43-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
42+
TenantName parent = TenantName.of(projectId, tenantId);
4443
Company company =
4544
Company.newBuilder().setDisplayName(displayName).setExternalId(externalId).build();
4645

jobs/v4/src/main/java/com/example/jobs/JobSearchCreateJob.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.cloud.talent.v4beta1.Job;
2323
import com.google.cloud.talent.v4beta1.JobServiceClient;
2424
import com.google.cloud.talent.v4beta1.TenantName;
25-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2625
import java.io.IOException;
2726
import java.util.Arrays;
2827
import java.util.List;
@@ -48,7 +47,7 @@ public static void createJob(
4847
String jobApplicationUrl)
4948
throws IOException {
5049
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
51-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
50+
TenantName parent = TenantName.of(projectId, tenantId);
5251
Job.ApplicationInfo applicationInfo =
5352
Job.ApplicationInfo.newBuilder().addUris(jobApplicationUrl).build();
5453

jobs/v4/src/main/java/com/example/jobs/JobSearchCreateJobCustomAttributes.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
import com.google.cloud.talent.v4beta1.Job;
2424
import com.google.cloud.talent.v4beta1.JobServiceClient;
2525
import com.google.cloud.talent.v4beta1.TenantName;
26-
import com.google.cloud.talent.v4beta1.TenantOrProjectName;
2726
import java.io.IOException;
28-
import java.util.ArrayList;
29-
import java.util.Arrays;
3027

3128
public class JobSearchCreateJobCustomAttributes {
3229

@@ -47,7 +44,7 @@ public static void createJob(
4744
String requisitionId)
4845
throws IOException {
4946
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
50-
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
47+
TenantName parent = TenantName.of(projectId, tenantId);
5148

5249
// Custom attribute can be string or numeric value, and can be filtered in search queries.
5350
// https://cloud.google.com/talent-solution/job-search/docs/custom-attributes

jobs/v4/src/main/java/com/example/jobs/JobSearchDeleteCompany.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import com.google.cloud.talent.v4beta1.CompanyName;
2222
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
23-
import com.google.cloud.talent.v4beta1.CompanyWithTenantName;
2423
import com.google.cloud.talent.v4beta1.DeleteCompanyRequest;
2524
import java.io.IOException;
2625

@@ -38,7 +37,7 @@ public static void deleteCompany() throws IOException {
3837
public static void deleteCompany(String projectId, String tenantId, String companyId)
3938
throws IOException {
4039
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
41-
CompanyName name = CompanyWithTenantName.of(projectId, tenantId, companyId);
40+
CompanyName name = CompanyName.ofProjectTenantCompanyName(projectId, tenantId, companyId);
4241

4342
DeleteCompanyRequest request =
4443
DeleteCompanyRequest.newBuilder().setName(name.toString()).build();

jobs/v4/src/main/java/com/example/jobs/JobSearchDeleteJob.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.cloud.talent.v4beta1.DeleteJobRequest;
2222
import com.google.cloud.talent.v4beta1.JobName;
2323
import com.google.cloud.talent.v4beta1.JobServiceClient;
24-
import com.google.cloud.talent.v4beta1.JobWithTenantName;
2524
import java.io.IOException;
2625

2726
public class JobSearchDeleteJob {
@@ -37,7 +36,7 @@ public static void deleteJob() throws IOException {
3736
// Delete Job.
3837
public static void deleteJob(String projectId, String tenantId, String jobId) throws IOException {
3938
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
40-
JobName name = JobWithTenantName.of(projectId, tenantId, jobId);
39+
JobName name = JobName.ofProjectTenantJobName(projectId, tenantId, jobId);
4140

4241
DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
4342

0 commit comments

Comments
 (0)