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

feat!: adopt the new multi-pattern resource names #88

Merged
merged 7 commits into from Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions google-cloud-talent/clirr-ignored-differences.xml
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<!--TODO: To be removed-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add after 0.36.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/talent/v4beta1/*ServiceClient</className>
<method>* *(com.google.cloud.talent.v4beta1.TenantOrProjectName*)</method>
<to>* *(com.google.cloud.talent.v4beta1.ProjectName*)</to>
</difference>
</differences>
Expand Up @@ -45,9 +45,8 @@
* <pre>
* <code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
* Application application = Application.newBuilder().build();
* Application response = applicationServiceClient.createApplication(parent, application);
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -157,6 +156,102 @@ public ApplicationServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name);
* }
* </code></pre>
*
* @param name Required. The resource name of the application to be deleted.
* <p>The format is
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(ApplicationName name) {
DeleteApplicationRequest request =
DeleteApplicationRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteApplication(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name.toString());
* }
* </code></pre>
*
* @param name Required. The resource name of the application to be deleted.
* <p>The format is
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(String name) {
DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder().setName(name).build();
deleteApplication(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
* .setName(name.toString())
* .build();
* applicationServiceClient.deleteApplication(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(DeleteApplicationRequest request) {
deleteApplicationCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = applicationServiceClient.deleteApplicationCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteApplicationRequest, Empty> deleteApplicationCallable() {
return stub.deleteApplicationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new application entity.
Expand Down Expand Up @@ -423,102 +518,6 @@ public final UnaryCallable<UpdateApplicationRequest, Application> updateApplicat
return stub.updateApplicationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name);
* }
* </code></pre>
*
* @param name Required. The resource name of the application to be deleted.
* <p>The format is
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(ApplicationName name) {
DeleteApplicationRequest request =
DeleteApplicationRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteApplication(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name.toString());
* }
* </code></pre>
*
* @param name Required. The resource name of the application to be deleted.
* <p>The format is
* "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}".
* For example, "projects/foo/tenants/bar/profiles/baz/applications/qux".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(String name) {
DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder().setName(name).build();
deleteApplication(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
* .setName(name.toString())
* .build();
* applicationServiceClient.deleteApplication(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteApplication(DeleteApplicationRequest request) {
deleteApplicationCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes specified application.
*
* <p>Sample code:
*
* <pre><code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = applicationServiceClient.deleteApplicationCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteApplicationRequest, Empty> deleteApplicationCallable() {
return stub.deleteApplicationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all applications associated with the profile.
Expand Down
Expand Up @@ -49,16 +49,16 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of createApplication to 30 seconds:
* <p>For example, to set the total timeout of deleteApplication to 30 seconds:
*
* <pre>
* <code>
* ApplicationServiceSettings.Builder applicationServiceSettingsBuilder =
* ApplicationServiceSettings.newBuilder();
* applicationServiceSettingsBuilder
* .createApplicationSettings()
* .deleteApplicationSettings()
* .setRetrySettings(
* applicationServiceSettingsBuilder.createApplicationSettings().getRetrySettings().toBuilder()
* applicationServiceSettingsBuilder.deleteApplicationSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ApplicationServiceSettings applicationServiceSettings = applicationServiceSettingsBuilder.build();
Expand All @@ -68,6 +68,11 @@
@Generated("by gapic-generator")
@BetaApi
public class ApplicationServiceSettings extends ClientSettings<ApplicationServiceSettings> {
/** Returns the object with the settings used for calls to deleteApplication. */
public UnaryCallSettings<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
return ((ApplicationServiceStubSettings) getStubSettings()).deleteApplicationSettings();
}

/** Returns the object with the settings used for calls to createApplication. */
public UnaryCallSettings<CreateApplicationRequest, Application> createApplicationSettings() {
return ((ApplicationServiceStubSettings) getStubSettings()).createApplicationSettings();
Expand All @@ -83,11 +88,6 @@ public UnaryCallSettings<UpdateApplicationRequest, Application> updateApplicatio
return ((ApplicationServiceStubSettings) getStubSettings()).updateApplicationSettings();
}

/** Returns the object with the settings used for calls to deleteApplication. */
public UnaryCallSettings<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
return ((ApplicationServiceStubSettings) getStubSettings()).deleteApplicationSettings();
}

/** Returns the object with the settings used for calls to listApplications. */
public PagedCallSettings<
ListApplicationsRequest, ListApplicationsResponse, ListApplicationsPagedResponse>
Expand Down Expand Up @@ -192,6 +192,11 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to deleteApplication. */
public UnaryCallSettings.Builder<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
return getStubSettingsBuilder().deleteApplicationSettings();
}

/** Returns the builder for the settings used for calls to createApplication. */
public UnaryCallSettings.Builder<CreateApplicationRequest, Application>
createApplicationSettings() {
Expand All @@ -209,11 +214,6 @@ public UnaryCallSettings.Builder<GetApplicationRequest, Application> getApplicat
return getStubSettingsBuilder().updateApplicationSettings();
}

/** Returns the builder for the settings used for calls to deleteApplication. */
public UnaryCallSettings.Builder<DeleteApplicationRequest, Empty> deleteApplicationSettings() {
return getStubSettingsBuilder().deleteApplicationSettings();
}

/** Returns the builder for the settings used for calls to listApplications. */
public PagedCallSettings.Builder<
ListApplicationsRequest, ListApplicationsResponse, ListApplicationsPagedResponse>
Expand Down