Skip to content
Permalink
Browse files
fix!: reorder Company and Job resources in talent API to be consisten…
…t with old gapic config (#143)

BREAKING CHANGE: The default `of` methods of CompanyName and JobName have changed. This should not happen again, but to insulate yourself, please use the specific `of[Named Type]Name()`

* fix (breaking change): reorder Company and Job resources in talent API to be consistent with old gapic config.

committer: @hzyi-google
PiperOrigin-RevId: 305760190

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Apr 9 14:25:39 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: ac1f904979899bc598fb0567cf7a367f08b40b43
Source-Link: googleapis/googleapis@ac1f904

* chore: allow breaking changes

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Apr 20, 2020
1 parent 55c00bc commit e3005343192bdb7519af9ed179afbe43ecc26902
@@ -44,7 +44,7 @@
* <pre>
* <code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* companyServiceClient.deleteCompany(name);
* }
* </code>
@@ -162,7 +162,7 @@ public CompanyServiceStub getStub() {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* companyServiceClient.deleteCompany(name);
* }
* </code></pre>
@@ -188,7 +188,7 @@ public final void deleteCompany(CompanyName name) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* companyServiceClient.deleteCompany(name.toString());
* }
* </code></pre>
@@ -213,7 +213,7 @@ public final void deleteCompany(String name) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* DeleteCompanyRequest request = DeleteCompanyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -236,7 +236,7 @@ public final void deleteCompany(DeleteCompanyRequest request) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* DeleteCompanyRequest request = DeleteCompanyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -394,7 +394,7 @@ public final UnaryCallable<CreateCompanyRequest, Company> createCompanyCallable(
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* Company response = companyServiceClient.getCompany(name);
* }
* </code></pre>
@@ -420,7 +420,7 @@ public final Company getCompany(CompanyName name) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* Company response = companyServiceClient.getCompany(name.toString());
* }
* </code></pre>
@@ -445,7 +445,7 @@ public final Company getCompany(String name) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* GetCompanyRequest request = GetCompanyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -468,7 +468,7 @@ public final Company getCompany(GetCompanyRequest request) {
*
* <pre><code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* GetCompanyRequest request = GetCompanyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -49,7 +49,7 @@
* <pre>
* <code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* jobServiceClient.deleteJob(name);
* }
* </code>
@@ -180,7 +180,7 @@ public final OperationsClient getOperationsClient() {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* jobServiceClient.deleteJob(name);
* }
* </code></pre>
@@ -208,7 +208,7 @@ public final void deleteJob(JobName name) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* jobServiceClient.deleteJob(name.toString());
* }
* </code></pre>
@@ -235,7 +235,7 @@ public final void deleteJob(String name) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* DeleteJobRequest request = DeleteJobRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -260,7 +260,7 @@ public final void deleteJob(DeleteJobRequest request) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* DeleteJobRequest request = DeleteJobRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -601,7 +601,7 @@ public final UnaryCallable<BatchCreateJobsRequest, Operation> batchCreateJobsCal
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* Job response = jobServiceClient.getJob(name);
* }
* </code></pre>
@@ -627,7 +627,7 @@ public final Job getJob(JobName name) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* Job response = jobServiceClient.getJob(name.toString());
* }
* </code></pre>
@@ -652,7 +652,7 @@ public final Job getJob(String name) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* GetJobRequest request = GetJobRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -675,7 +675,7 @@ public final Job getJob(GetJobRequest request) {
*
* <pre><code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* GetJobRequest request = GetJobRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -45,7 +45,7 @@
* <pre>
* <code>
* try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
* CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
* CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
* companyServiceClient.deleteCompany(name);
* }
* </code>
@@ -99,7 +99,7 @@
* <pre>
* <code>
* try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
* JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
* JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
* jobServiceClient.deleteJob(name);
* }
* </code>
@@ -144,8 +144,9 @@ public void createApplicationTest() {
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
String externalId = "externalId-1153075697";
String profile = "profile-309425751";
JobName job = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName job = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String outcomeNotes = "outcomeNotes-355961964";
String jobTitleSnippet = "jobTitleSnippet-1100512972";
Application expectedResponse =
@@ -202,8 +203,9 @@ public void getApplicationTest() {
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
String externalId = "externalId-1153075697";
String profile = "profile-309425751";
JobName job = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName job = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String outcomeNotes = "outcomeNotes-355961964";
String jobTitleSnippet = "jobTitleSnippet-1100512972";
Application expectedResponse =
@@ -259,8 +261,9 @@ public void updateApplicationTest() {
ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
String externalId = "externalId-1153075697";
String profile = "profile-309425751";
JobName job = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName job = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String outcomeNotes = "outcomeNotes-355961964";
String jobTitleSnippet = "jobTitleSnippet-1100512972";
Application expectedResponse =
@@ -104,7 +104,7 @@ public void deleteCompanyTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockCompanyService.addResponse(expectedResponse);

CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");

client.deleteCompany(name);

@@ -126,7 +126,8 @@ public void deleteCompanyExceptionTest() throws Exception {
mockCompanyService.addException(exception);

try {
CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");

client.deleteCompany(name);
Assert.fail("No exception raised");
@@ -138,7 +139,7 @@ public void deleteCompanyExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void createCompanyTest() {
CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String displayName = "displayName1615086568";
String externalId = "externalId-1153075697";
String headquartersAddress = "headquartersAddress-1879520036";
@@ -201,7 +202,8 @@ public void createCompanyExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void getCompanyTest() {
CompanyName name2 = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name2 =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String displayName = "displayName1615086568";
String externalId = "externalId-1153075697";
String headquartersAddress = "headquartersAddress-1879520036";
@@ -226,7 +228,7 @@ public void getCompanyTest() {
.build();
mockCompanyService.addResponse(expectedResponse);

CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");

Company actualResponse = client.getCompany(name);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -249,7 +251,8 @@ public void getCompanyExceptionTest() throws Exception {
mockCompanyService.addException(exception);

try {
CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");

client.getCompany(name);
Assert.fail("No exception raised");
@@ -261,7 +264,7 @@ public void getCompanyExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void updateCompanyTest() {
CompanyName name = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
CompanyName name = CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String displayName = "displayName1615086568";
String externalId = "externalId-1153075697";
String headquartersAddress = "headquartersAddress-1879520036";
@@ -111,7 +111,7 @@ public void deleteJobTest() {
Empty expectedResponse = Empty.newBuilder().build();
mockJobService.addResponse(expectedResponse);

JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");

client.deleteJob(name);

@@ -133,7 +133,7 @@ public void deleteJobExceptionTest() throws Exception {
mockJobService.addException(exception);

try {
JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");

client.deleteJob(name);
Assert.fail("No exception raised");
@@ -145,8 +145,9 @@ public void deleteJobExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void createJobTest() {
JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String requisitionId = "requisitionId980224926";
String title = "title110371416";
String description = "description-1724546052";
@@ -261,8 +262,9 @@ public void batchCreateJobsExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void getJobTest() {
JobName name2 = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName name2 = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String requisitionId = "requisitionId980224926";
String title = "title110371416";
String description = "description-1724546052";
@@ -290,7 +292,7 @@ public void getJobTest() {
.build();
mockJobService.addResponse(expectedResponse);

JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");

Job actualResponse = client.getJob(name);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -313,7 +315,7 @@ public void getJobExceptionTest() throws Exception {
mockJobService.addException(exception);

try {
JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");

client.getJob(name);
Assert.fail("No exception raised");
@@ -325,8 +327,9 @@ public void getJobExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void updateJobTest() {
JobName name = JobName.ofProjectJobName("[PROJECT]", "[JOB]");
CompanyName company = CompanyName.ofProjectCompanyName("[PROJECT]", "[COMPANY]");
JobName name = JobName.ofProjectTenantJobName("[PROJECT]", "[TENANT]", "[JOB]");
CompanyName company =
CompanyName.ofProjectTenantCompanyName("[PROJECT]", "[TENANT]", "[COMPANY]");
String requisitionId = "requisitionId980224926";
String title = "title110371416";
String description = "description-1724546052";

0 comments on commit e300534

Please sign in to comment.