Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 0a8a4c9

Browse files
authored
feat!: adopt the new multi-pattern resource names (#88)
- Delete `TenantOrProjectName`. - Generate overloads that take `TenantName` and `ProjectName` respectively where `TenantOrProjectName` was originally used. - Delete per-pattern resource name helper classes: `CompanyWithTenantName`, `CompanyWithoutTenantName`, `JobWithTenantName`, `JobWithoutTenantName`, `CompanyOldName`, `CompanyNewName`, `JobOldName`, `JobNewName`. - Delete resource name factory classes `JobNames`, `CompanyNames`, `TenantOrProjectNames` and untyped resource name classes `UntypedJobName`, `UntypedTenantName` and `UntypedTenantOrProjectName`.
1 parent b20fbf8 commit 0a8a4c9

File tree

58 files changed

+3359
-4387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3359
-4387
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
3+
<differences>
4+
<!--TODO: To be removed after 0.36.0-->
5+
<difference>
6+
<differenceType>7005</differenceType>
7+
<className>com/google/cloud/talent/v4beta1/*ServiceClient</className>
8+
<method>* *(com.google.cloud.talent.v4beta1.TenantOrProjectName*)</method>
9+
<to>* *(com.google.cloud.talent.v4beta1.ProjectName*)</to>
10+
</difference>
11+
</differences>

google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceClient.java

Lines changed: 98 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@
4545
* <pre>
4646
* <code>
4747
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
48-
* ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
49-
* Application application = Application.newBuilder().build();
50-
* Application response = applicationServiceClient.createApplication(parent, application);
48+
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
49+
* applicationServiceClient.deleteApplication(name);
5150
* }
5251
* </code>
5352
* </pre>
@@ -157,6 +156,102 @@ public ApplicationServiceStub getStub() {
157156
return stub;
158157
}
159158

159+
// AUTO-GENERATED DOCUMENTATION AND METHOD
160+
/**
161+
* Deletes specified application.
162+
*
163+
* <p>Sample code:
164+
*
165+
* <pre><code>
166+
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
167+
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
168+
* applicationServiceClient.deleteApplication(name);
169+
* }
170+
* </code></pre>
171+
*
172+
* @param name Required. The resource name of the application to be deleted.
173+
* <p>The format is
174+
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
175+
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
176+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
177+
*/
178+
public final void deleteApplication(ApplicationName name) {
179+
DeleteApplicationRequest request =
180+
DeleteApplicationRequest.newBuilder()
181+
.setName(name == null ? null : name.toString())
182+
.build();
183+
deleteApplication(request);
184+
}
185+
186+
// AUTO-GENERATED DOCUMENTATION AND METHOD
187+
/**
188+
* Deletes specified application.
189+
*
190+
* <p>Sample code:
191+
*
192+
* <pre><code>
193+
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
194+
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
195+
* applicationServiceClient.deleteApplication(name.toString());
196+
* }
197+
* </code></pre>
198+
*
199+
* @param name Required. The resource name of the application to be deleted.
200+
* <p>The format is
201+
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
202+
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
203+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
204+
*/
205+
public final void deleteApplication(String name) {
206+
DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder().setName(name).build();
207+
deleteApplication(request);
208+
}
209+
210+
// AUTO-GENERATED DOCUMENTATION AND METHOD
211+
/**
212+
* Deletes specified application.
213+
*
214+
* <p>Sample code:
215+
*
216+
* <pre><code>
217+
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
218+
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
219+
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
220+
* .setName(name.toString())
221+
* .build();
222+
* applicationServiceClient.deleteApplication(request);
223+
* }
224+
* </code></pre>
225+
*
226+
* @param request The request object containing all of the parameters for the API call.
227+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
228+
*/
229+
public final void deleteApplication(DeleteApplicationRequest request) {
230+
deleteApplicationCallable().call(request);
231+
}
232+
233+
// AUTO-GENERATED DOCUMENTATION AND METHOD
234+
/**
235+
* Deletes specified application.
236+
*
237+
* <p>Sample code:
238+
*
239+
* <pre><code>
240+
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
241+
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
242+
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
243+
* .setName(name.toString())
244+
* .build();
245+
* ApiFuture&lt;Void&gt; future = applicationServiceClient.deleteApplicationCallable().futureCall(request);
246+
* // Do something
247+
* future.get();
248+
* }
249+
* </code></pre>
250+
*/
251+
public final UnaryCallable<DeleteApplicationRequest, Empty> deleteApplicationCallable() {
252+
return stub.deleteApplicationCallable();
253+
}
254+
160255
// AUTO-GENERATED DOCUMENTATION AND METHOD
161256
/**
162257
* Creates a new application entity.
@@ -423,102 +518,6 @@ public final UnaryCallable<UpdateApplicationRequest, Application> updateApplicat
423518
return stub.updateApplicationCallable();
424519
}
425520

426-
// AUTO-GENERATED DOCUMENTATION AND METHOD
427-
/**
428-
* Deletes specified application.
429-
*
430-
* <p>Sample code:
431-
*
432-
* <pre><code>
433-
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
434-
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
435-
* applicationServiceClient.deleteApplication(name);
436-
* }
437-
* </code></pre>
438-
*
439-
* @param name Required. The resource name of the application to be deleted.
440-
* <p>The format is
441-
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
442-
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
443-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
444-
*/
445-
public final void deleteApplication(ApplicationName name) {
446-
DeleteApplicationRequest request =
447-
DeleteApplicationRequest.newBuilder()
448-
.setName(name == null ? null : name.toString())
449-
.build();
450-
deleteApplication(request);
451-
}
452-
453-
// AUTO-GENERATED DOCUMENTATION AND METHOD
454-
/**
455-
* Deletes specified application.
456-
*
457-
* <p>Sample code:
458-
*
459-
* <pre><code>
460-
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
461-
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
462-
* applicationServiceClient.deleteApplication(name.toString());
463-
* }
464-
* </code></pre>
465-
*
466-
* @param name Required. The resource name of the application to be deleted.
467-
* <p>The format is
468-
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
469-
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
470-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
471-
*/
472-
public final void deleteApplication(String name) {
473-
DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder().setName(name).build();
474-
deleteApplication(request);
475-
}
476-
477-
// AUTO-GENERATED DOCUMENTATION AND METHOD
478-
/**
479-
* Deletes specified application.
480-
*
481-
* <p>Sample code:
482-
*
483-
* <pre><code>
484-
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
485-
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
486-
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
487-
* .setName(name.toString())
488-
* .build();
489-
* applicationServiceClient.deleteApplication(request);
490-
* }
491-
* </code></pre>
492-
*
493-
* @param request The request object containing all of the parameters for the API call.
494-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
495-
*/
496-
public final void deleteApplication(DeleteApplicationRequest request) {
497-
deleteApplicationCallable().call(request);
498-
}
499-
500-
// AUTO-GENERATED DOCUMENTATION AND METHOD
501-
/**
502-
* Deletes specified application.
503-
*
504-
* <p>Sample code:
505-
*
506-
* <pre><code>
507-
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
508-
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
509-
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
510-
* .setName(name.toString())
511-
* .build();
512-
* ApiFuture&lt;Void&gt; future = applicationServiceClient.deleteApplicationCallable().futureCall(request);
513-
* // Do something
514-
* future.get();
515-
* }
516-
* </code></pre>
517-
*/
518-
public final UnaryCallable<DeleteApplicationRequest, Empty> deleteApplicationCallable() {
519-
return stub.deleteApplicationCallable();
520-
}
521-
522521
// AUTO-GENERATED DOCUMENTATION AND METHOD
523522
/**
524523
* Lists all applications associated with the profile.

google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceSettings.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
5050
* build() is called, the tree of builders is called to create the complete settings object.
5151
*
52-
* <p>For example, to set the total timeout of createApplication to 30 seconds:
52+
* <p>For example, to set the total timeout of deleteApplication to 30 seconds:
5353
*
5454
* <pre>
5555
* <code>
5656
* ApplicationServiceSettings.Builder applicationServiceSettingsBuilder =
5757
* ApplicationServiceSettings.newBuilder();
5858
* applicationServiceSettingsBuilder
59-
* .createApplicationSettings()
59+
* .deleteApplicationSettings()
6060
* .setRetrySettings(
61-
* applicationServiceSettingsBuilder.createApplicationSettings().getRetrySettings().toBuilder()
61+
* applicationServiceSettingsBuilder.deleteApplicationSettings().getRetrySettings().toBuilder()
6262
* .setTotalTimeout(Duration.ofSeconds(30))
6363
* .build());
6464
* ApplicationServiceSettings applicationServiceSettings = applicationServiceSettingsBuilder.build();
@@ -68,6 +68,11 @@
6868
@Generated("by gapic-generator")
6969
@BetaApi
7070
public class ApplicationServiceSettings extends ClientSettings<ApplicationServiceSettings> {
71+
/** Returns the object with the settings used for calls to deleteApplication. */
72+
public UnaryCallSettings<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
73+
return ((ApplicationServiceStubSettings) getStubSettings()).deleteApplicationSettings();
74+
}
75+
7176
/** Returns the object with the settings used for calls to createApplication. */
7277
public UnaryCallSettings<CreateApplicationRequest, Application> createApplicationSettings() {
7378
return ((ApplicationServiceStubSettings) getStubSettings()).createApplicationSettings();
@@ -83,11 +88,6 @@ public UnaryCallSettings<UpdateApplicationRequest, Application> updateApplicatio
8388
return ((ApplicationServiceStubSettings) getStubSettings()).updateApplicationSettings();
8489
}
8590

86-
/** Returns the object with the settings used for calls to deleteApplication. */
87-
public UnaryCallSettings<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
88-
return ((ApplicationServiceStubSettings) getStubSettings()).deleteApplicationSettings();
89-
}
90-
9191
/** Returns the object with the settings used for calls to listApplications. */
9292
public PagedCallSettings<
9393
ListApplicationsRequest, ListApplicationsResponse, ListApplicationsPagedResponse>
@@ -192,6 +192,11 @@ public Builder applyToAllUnaryMethods(
192192
return this;
193193
}
194194

195+
/** Returns the builder for the settings used for calls to deleteApplication. */
196+
public UnaryCallSettings.Builder<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
197+
return getStubSettingsBuilder().deleteApplicationSettings();
198+
}
199+
195200
/** Returns the builder for the settings used for calls to createApplication. */
196201
public UnaryCallSettings.Builder<CreateApplicationRequest, Application>
197202
createApplicationSettings() {
@@ -209,11 +214,6 @@ public UnaryCallSettings.Builder<GetApplicationRequest, Application> getApplicat
209214
return getStubSettingsBuilder().updateApplicationSettings();
210215
}
211216

212-
/** Returns the builder for the settings used for calls to deleteApplication. */
213-
public UnaryCallSettings.Builder<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
214-
return getStubSettingsBuilder().deleteApplicationSettings();
215-
}
216-
217217
/** Returns the builder for the settings used for calls to listApplications. */
218218
public PagedCallSettings.Builder<
219219
ListApplicationsRequest, ListApplicationsResponse, ListApplicationsPagedResponse>

0 commit comments

Comments
 (0)