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

Commit

Permalink
fix: migrate retry settings to grpc_service_config (#194)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/8090a8db-78af-43ce-903e-cbc4378c9d99/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 317110673
Source-Link: googleapis/googleapis@fa4d2ec
  • Loading branch information
yoshi-automation committed Jun 22, 2020
1 parent 0c4c8a5 commit dd16f4c
Show file tree
Hide file tree
Showing 35 changed files with 1,494 additions and 1,166 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>5.7.0</version>
<version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -45,8 +45,9 @@
* <pre>
* <code>
* try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
* ApplicationName name = ApplicationName.of("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]");
* applicationServiceClient.deleteApplication(name);
* ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
* Application application = Application.newBuilder().build();
* Application response = applicationServiceClient.createApplication(parent, application);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -156,102 +157,6 @@ 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 @@ -518,6 +423,102 @@ 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 deleteApplication to 30 seconds:
* <p>For example, to set the total timeout of createApplication to 30 seconds:
*
* <pre>
* <code>
* ApplicationServiceSettings.Builder applicationServiceSettingsBuilder =
* ApplicationServiceSettings.newBuilder();
* applicationServiceSettingsBuilder
* .deleteApplicationSettings()
* .createApplicationSettings()
* .setRetrySettings(
* applicationServiceSettingsBuilder.deleteApplicationSettings().getRetrySettings().toBuilder()
* applicationServiceSettingsBuilder.createApplicationSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ApplicationServiceSettings applicationServiceSettings = applicationServiceSettingsBuilder.build();
Expand All @@ -68,11 +68,6 @@
@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 @@ -88,6 +83,11 @@ 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,11 +192,6 @@ 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 @@ -214,6 +209,11 @@ 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

0 comments on commit dd16f4c

Please sign in to comment.