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

fix: restore GAPIC v2 retry configs #134

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading