Skip to content
Permalink
Browse files
fix: restore GAPIC v2 retry configs (#134)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/b94bacd6-05ee-45c2-be4d-b0f667030fab/targets

PiperOrigin-RevId: 312088359
Source-Link: googleapis/googleapis@5a90d46
  • Loading branch information
yoshi-automation committed Jun 3, 2020
1 parent 6449124 commit 2bb7717a3544d39a317cca23c7da65e3595a7ae3
@@ -47,9 +47,8 @@
* <pre>
* <code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name);
* }
* </code>
* </pre>
@@ -161,194 +160,194 @@ public WebSecurityScannerStub getStub() {

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new ScanConfig.
* Deletes an existing ScanConfig and its child resources.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name);
* }
* </code></pre>
*
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ScanConfig createScanConfig(ProjectName parent, ScanConfig scanConfig) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setScanConfig(scanConfig)
.build();
return createScanConfig(request);
public final void deleteScanConfig(ScanConfigName name) {
DeleteScanConfigRequest request =
DeleteScanConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteScanConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new ScanConfig.
* Deletes an existing ScanConfig and its child resources.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent.toString(), scanConfig);
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name.toString());
* }
* </code></pre>
*
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder().setParent(parent).setScanConfig(scanConfig).build();
return createScanConfig(request);
public final void deleteScanConfig(String name) {
DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().setName(name).build();
deleteScanConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new ScanConfig.
* Deletes an existing ScanConfig and its child resources.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
* .setParent(parent.toString())
* .setScanConfig(scanConfig)
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
* .setName(name.toString())
* .build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(request);
* webSecurityScannerClient.deleteScanConfig(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 ScanConfig createScanConfig(CreateScanConfigRequest request) {
return createScanConfigCallable().call(request);
public final void deleteScanConfig(DeleteScanConfigRequest request) {
deleteScanConfigCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new ScanConfig.
* Deletes an existing ScanConfig and its child resources.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
* .setParent(parent.toString())
* .setScanConfig(scanConfig)
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;ScanConfig&gt; future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
* ApiFuture&lt;Void&gt; future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
* // Do something
* ScanConfig response = future.get();
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<CreateScanConfigRequest, ScanConfig> createScanConfigCallable() {
return stub.createScanConfigCallable();
public final UnaryCallable<DeleteScanConfigRequest, Empty> deleteScanConfigCallable() {
return stub.deleteScanConfigCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an existing ScanConfig and its child resources.
* Creates a new ScanConfig.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name);
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
* }
* </code></pre>
*
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteScanConfig(ScanConfigName name) {
DeleteScanConfigRequest request =
DeleteScanConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteScanConfig(request);
public final ScanConfig createScanConfig(ProjectName parent, ScanConfig scanConfig) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setScanConfig(scanConfig)
.build();
return createScanConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an existing ScanConfig and its child resources.
* Creates a new ScanConfig.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name.toString());
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent.toString(), scanConfig);
* }
* </code></pre>
*
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteScanConfig(String name) {
DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().setName(name).build();
deleteScanConfig(request);
public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder().setParent(parent).setScanConfig(scanConfig).build();
return createScanConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an existing ScanConfig and its child resources.
* Creates a new ScanConfig.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
* .setName(name.toString())
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
* .setParent(parent.toString())
* .setScanConfig(scanConfig)
* .build();
* webSecurityScannerClient.deleteScanConfig(request);
* ScanConfig response = webSecurityScannerClient.createScanConfig(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 deleteScanConfig(DeleteScanConfigRequest request) {
deleteScanConfigCallable().call(request);
public final ScanConfig createScanConfig(CreateScanConfigRequest request) {
return createScanConfigCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an existing ScanConfig and its child resources.
* Creates a new ScanConfig.
*
* <p>Sample code:
*
* <pre><code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder()
* .setName(name.toString())
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder()
* .setParent(parent.toString())
* .setScanConfig(scanConfig)
* .build();
* ApiFuture&lt;Void&gt; future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
* ApiFuture&lt;ScanConfig&gt; future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
* // Do something
* future.get();
* ScanConfig response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteScanConfigRequest, Empty> deleteScanConfigCallable() {
return stub.deleteScanConfigCallable();
public final UnaryCallable<CreateScanConfigRequest, ScanConfig> createScanConfigCallable() {
return stub.createScanConfigCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -53,16 +53,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 createScanConfig to 30 seconds:
* <p>For example, to set the total timeout of deleteScanConfig to 30 seconds:
*
* <pre>
* <code>
* WebSecurityScannerSettings.Builder webSecurityScannerSettingsBuilder =
* WebSecurityScannerSettings.newBuilder();
* webSecurityScannerSettingsBuilder
* .createScanConfigSettings()
* .deleteScanConfigSettings()
* .setRetrySettings(
* webSecurityScannerSettingsBuilder.createScanConfigSettings().getRetrySettings().toBuilder()
* webSecurityScannerSettingsBuilder.deleteScanConfigSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* WebSecurityScannerSettings webSecurityScannerSettings = webSecurityScannerSettingsBuilder.build();
@@ -72,16 +72,16 @@
@Generated("by gapic-generator")
@BetaApi
public class WebSecurityScannerSettings extends ClientSettings<WebSecurityScannerSettings> {
/** Returns the object with the settings used for calls to createScanConfig. */
public UnaryCallSettings<CreateScanConfigRequest, ScanConfig> createScanConfigSettings() {
return ((WebSecurityScannerStubSettings) getStubSettings()).createScanConfigSettings();
}

/** Returns the object with the settings used for calls to deleteScanConfig. */
public UnaryCallSettings<DeleteScanConfigRequest, Empty> deleteScanConfigSettings() {
return ((WebSecurityScannerStubSettings) getStubSettings()).deleteScanConfigSettings();
}

/** Returns the object with the settings used for calls to createScanConfig. */
public UnaryCallSettings<CreateScanConfigRequest, ScanConfig> createScanConfigSettings() {
return ((WebSecurityScannerStubSettings) getStubSettings()).createScanConfigSettings();
}

/** Returns the object with the settings used for calls to getScanConfig. */
public UnaryCallSettings<GetScanConfigRequest, ScanConfig> getScanConfigSettings() {
return ((WebSecurityScannerStubSettings) getStubSettings()).getScanConfigSettings();
@@ -241,17 +241,17 @@ public Builder applyToAllUnaryMethods(
return this;
}

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

/** Returns the builder for the settings used for calls to createScanConfig. */
public UnaryCallSettings.Builder<CreateScanConfigRequest, ScanConfig>
createScanConfigSettings() {
return getStubSettingsBuilder().createScanConfigSettings();
}

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

/** Returns the builder for the settings used for calls to getScanConfig. */
public UnaryCallSettings.Builder<GetScanConfigRequest, ScanConfig> getScanConfigSettings() {
return getStubSettingsBuilder().getScanConfigSettings();
@@ -30,9 +30,8 @@
* <pre>
* <code>
* try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ScanConfig scanConfig = ScanConfig.newBuilder().build();
* ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
* ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
* webSecurityScannerClient.deleteScanConfig(name);
* }
* </code>
* </pre>

0 comments on commit 2bb7717

Please sign in to comment.