diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java index 24fb10a2..e512334a 100644 --- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java @@ -47,9 +47,8 @@ *
  * 
  * 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);
  * }
  * 
  * 
@@ -161,194 +160,194 @@ public WebSecurityScannerStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new ScanConfig. + * Deletes an existing ScanConfig and its child resources. * *

Sample 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);
    * }
    * 
* - * @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. * *

Sample 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());
    * }
    * 
* - * @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. * *

Sample 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);
    * }
    * 
* * @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. * *

Sample 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<ScanConfig> future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
+   *   ApiFuture<Void> future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
    *   // Do something
-   *   ScanConfig response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable createScanConfigCallable() { - return stub.createScanConfigCallable(); + public final UnaryCallable deleteScanConfigCallable() { + return stub.deleteScanConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing ScanConfig and its child resources. + * Creates a new ScanConfig. * *

Sample 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);
    * }
    * 
* - * @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. * *

Sample 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);
    * }
    * 
* - * @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. * *

Sample 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);
    * }
    * 
* * @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. * *

Sample 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<Void> future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
+   *   ApiFuture<ScanConfig> future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   ScanConfig response = future.get();
    * }
    * 
*/ - public final UnaryCallable deleteScanConfigCallable() { - return stub.deleteScanConfigCallable(); + public final UnaryCallable createScanConfigCallable() { + return stub.createScanConfigCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerSettings.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerSettings.java index 88829e39..d397be3c 100644 --- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerSettings.java +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerSettings.java @@ -53,16 +53,16 @@ *

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. * - *

For example, to set the total timeout of createScanConfig to 30 seconds: + *

For example, to set the total timeout of deleteScanConfig to 30 seconds: * *

  * 
  * 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 {
-  /** Returns the object with the settings used for calls to createScanConfig. */
-  public UnaryCallSettings createScanConfigSettings() {
-    return ((WebSecurityScannerStubSettings) getStubSettings()).createScanConfigSettings();
-  }
-
   /** Returns the object with the settings used for calls to deleteScanConfig. */
   public UnaryCallSettings deleteScanConfigSettings() {
     return ((WebSecurityScannerStubSettings) getStubSettings()).deleteScanConfigSettings();
   }
 
+  /** Returns the object with the settings used for calls to createScanConfig. */
+  public UnaryCallSettings createScanConfigSettings() {
+    return ((WebSecurityScannerStubSettings) getStubSettings()).createScanConfigSettings();
+  }
+
   /** Returns the object with the settings used for calls to getScanConfig. */
   public UnaryCallSettings 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 deleteScanConfigSettings() {
+      return getStubSettingsBuilder().deleteScanConfigSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createScanConfig. */
     public UnaryCallSettings.Builder
         createScanConfigSettings() {
       return getStubSettingsBuilder().createScanConfigSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteScanConfig. */
-    public UnaryCallSettings.Builder deleteScanConfigSettings() {
-      return getStubSettingsBuilder().deleteScanConfigSettings();
-    }
-
     /** Returns the builder for the settings used for calls to getScanConfig. */
     public UnaryCallSettings.Builder getScanConfigSettings() {
       return getStubSettingsBuilder().getScanConfigSettings();
diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/package-info.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/package-info.java
index 9f8f33fc..ec735fe9 100644
--- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/package-info.java
+++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/package-info.java
@@ -30,9 +30,8 @@
  * 
  * 
  * 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);
  * }
  * 
  * 
diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/GrpcWebSecurityScannerStub.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/GrpcWebSecurityScannerStub.java index 260415df..6b079629 100644 --- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/GrpcWebSecurityScannerStub.java +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/GrpcWebSecurityScannerStub.java @@ -68,16 +68,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcWebSecurityScannerStub extends WebSecurityScannerStub { - private static final MethodDescriptor - createScanConfigMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateScanConfigRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) - .build(); private static final MethodDescriptor deleteScanConfigMethodDescriptor = MethodDescriptor.newBuilder() @@ -88,6 +78,16 @@ public class GrpcWebSecurityScannerStub extends WebSecurityScannerStub { ProtoUtils.marshaller(DeleteScanConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor + createScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); private static final MethodDescriptor getScanConfigMethodDescriptor = MethodDescriptor.newBuilder() @@ -194,8 +194,8 @@ public class GrpcWebSecurityScannerStub extends WebSecurityScannerStub { private final BackgroundResource backgroundResources; - private final UnaryCallable createScanConfigCallable; private final UnaryCallable deleteScanConfigCallable; + private final UnaryCallable createScanConfigCallable; private final UnaryCallable getScanConfigCallable; private final UnaryCallable listScanConfigsCallable; @@ -260,28 +260,28 @@ protected GrpcWebSecurityScannerStub( throws IOException { this.callableFactory = callableFactory; - GrpcCallSettings createScanConfigTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createScanConfigMethodDescriptor) + GrpcCallSettings deleteScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteScanConfigMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(CreateScanConfigRequest request) { + public Map extract(DeleteScanConfigRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); + params.put("name", String.valueOf(request.getName())); return params.build(); } }) .build(); - GrpcCallSettings deleteScanConfigTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteScanConfigMethodDescriptor) + GrpcCallSettings createScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createScanConfigMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(DeleteScanConfigRequest request) { + public Map extract(CreateScanConfigRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); + params.put("parent", String.valueOf(request.getParent())); return params.build(); } }) @@ -434,12 +434,12 @@ public Map extract(ListFindingTypeStatsRequest request) { }) .build(); - this.createScanConfigCallable = - callableFactory.createUnaryCallable( - createScanConfigTransportSettings, settings.createScanConfigSettings(), clientContext); this.deleteScanConfigCallable = callableFactory.createUnaryCallable( deleteScanConfigTransportSettings, settings.deleteScanConfigSettings(), clientContext); + this.createScanConfigCallable = + callableFactory.createUnaryCallable( + createScanConfigTransportSettings, settings.createScanConfigSettings(), clientContext); this.getScanConfigCallable = callableFactory.createUnaryCallable( getScanConfigTransportSettings, settings.getScanConfigSettings(), clientContext); @@ -491,14 +491,14 @@ public Map extract(ListFindingTypeStatsRequest request) { backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable createScanConfigCallable() { - return createScanConfigCallable; - } - public UnaryCallable deleteScanConfigCallable() { return deleteScanConfigCallable; } + public UnaryCallable createScanConfigCallable() { + return createScanConfigCallable; + } + public UnaryCallable getScanConfigCallable() { return getScanConfigCallable; } diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStub.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStub.java index 260bc44b..032d9907 100644 --- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStub.java +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStub.java @@ -57,14 +57,14 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class WebSecurityScannerStub implements BackgroundResource { - public UnaryCallable createScanConfigCallable() { - throw new UnsupportedOperationException("Not implemented: createScanConfigCallable()"); - } - public UnaryCallable deleteScanConfigCallable() { throw new UnsupportedOperationException("Not implemented: deleteScanConfigCallable()"); } + public UnaryCallable createScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createScanConfigCallable()"); + } + public UnaryCallable getScanConfigCallable() { throw new UnsupportedOperationException("Not implemented: getScanConfigCallable()"); } diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStubSettings.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStubSettings.java index 0275457f..b0b8e5cf 100644 --- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStubSettings.java +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/stub/WebSecurityScannerStubSettings.java @@ -90,16 +90,16 @@ *

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. * - *

For example, to set the total timeout of createScanConfig to 30 seconds: + *

For example, to set the total timeout of deleteScanConfig to 30 seconds: * *

  * 
  * WebSecurityScannerStubSettings.Builder webSecurityScannerSettingsBuilder =
  *     WebSecurityScannerStubSettings.newBuilder();
  * webSecurityScannerSettingsBuilder
- *     .createScanConfigSettings()
+ *     .deleteScanConfigSettings()
  *     .setRetrySettings(
- *         webSecurityScannerSettingsBuilder.createScanConfigSettings().getRetrySettings().toBuilder()
+ *         webSecurityScannerSettingsBuilder.deleteScanConfigSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WebSecurityScannerStubSettings webSecurityScannerSettings = webSecurityScannerSettingsBuilder.build();
@@ -113,8 +113,8 @@ public class WebSecurityScannerStubSettings extends StubSettings DEFAULT_SERVICE_SCOPES =
       ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
 
-  private final UnaryCallSettings createScanConfigSettings;
   private final UnaryCallSettings deleteScanConfigSettings;
+  private final UnaryCallSettings createScanConfigSettings;
   private final UnaryCallSettings getScanConfigSettings;
   private final PagedCallSettings<
           ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse>
@@ -136,16 +136,16 @@ public class WebSecurityScannerStubSettings extends StubSettings
       listFindingTypeStatsSettings;
 
-  /** Returns the object with the settings used for calls to createScanConfig. */
-  public UnaryCallSettings createScanConfigSettings() {
-    return createScanConfigSettings;
-  }
-
   /** Returns the object with the settings used for calls to deleteScanConfig. */
   public UnaryCallSettings deleteScanConfigSettings() {
     return deleteScanConfigSettings;
   }
 
+  /** Returns the object with the settings used for calls to createScanConfig. */
+  public UnaryCallSettings createScanConfigSettings() {
+    return createScanConfigSettings;
+  }
+
   /** Returns the object with the settings used for calls to getScanConfig. */
   public UnaryCallSettings getScanConfigSettings() {
     return getScanConfigSettings;
@@ -277,8 +277,8 @@ public Builder toBuilder() {
   protected WebSecurityScannerStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
-    createScanConfigSettings = settingsBuilder.createScanConfigSettings().build();
     deleteScanConfigSettings = settingsBuilder.deleteScanConfigSettings().build();
+    createScanConfigSettings = settingsBuilder.createScanConfigSettings().build();
     getScanConfigSettings = settingsBuilder.getScanConfigSettings().build();
     listScanConfigsSettings = settingsBuilder.listScanConfigsSettings().build();
     updateScanConfigSettings = settingsBuilder.updateScanConfigSettings().build();
@@ -515,10 +515,10 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
-    private final UnaryCallSettings.Builder
-        createScanConfigSettings;
     private final UnaryCallSettings.Builder
         deleteScanConfigSettings;
+    private final UnaryCallSettings.Builder
+        createScanConfigSettings;
     private final UnaryCallSettings.Builder getScanConfigSettings;
     private final PagedCallSettings.Builder<
             ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse>
@@ -583,10 +583,10 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
-      createScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       deleteScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      createScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       listScanConfigsSettings = PagedCallSettings.newBuilder(LIST_SCAN_CONFIGS_PAGE_STR_FACT);
@@ -611,8 +611,8 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              createScanConfigSettings,
               deleteScanConfigSettings,
+              createScanConfigSettings,
               getScanConfigSettings,
               listScanConfigsSettings,
               updateScanConfigSettings,
@@ -640,12 +640,12 @@ private static Builder createDefault() {
     private static Builder initDefaults(Builder builder) {
 
       builder
-          .createScanConfigSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .deleteScanConfigSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .deleteScanConfigSettings()
+          .createScanConfigSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
@@ -710,8 +710,8 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(WebSecurityScannerStubSettings settings) {
       super(settings);
 
-      createScanConfigSettings = settings.createScanConfigSettings.toBuilder();
       deleteScanConfigSettings = settings.deleteScanConfigSettings.toBuilder();
+      createScanConfigSettings = settings.createScanConfigSettings.toBuilder();
       getScanConfigSettings = settings.getScanConfigSettings.toBuilder();
       listScanConfigsSettings = settings.listScanConfigsSettings.toBuilder();
       updateScanConfigSettings = settings.updateScanConfigSettings.toBuilder();
@@ -726,8 +726,8 @@ protected Builder(WebSecurityScannerStubSettings settings) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
-              createScanConfigSettings,
               deleteScanConfigSettings,
+              createScanConfigSettings,
               getScanConfigSettings,
               listScanConfigsSettings,
               updateScanConfigSettings,
@@ -757,17 +757,17 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteScanConfig. */
+    public UnaryCallSettings.Builder deleteScanConfigSettings() {
+      return deleteScanConfigSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createScanConfig. */
     public UnaryCallSettings.Builder
         createScanConfigSettings() {
       return createScanConfigSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteScanConfig. */
-    public UnaryCallSettings.Builder deleteScanConfigSettings() {
-      return deleteScanConfigSettings;
-    }
-
     /** Returns the builder for the settings used for calls to getScanConfig. */
     public UnaryCallSettings.Builder getScanConfigSettings() {
       return getScanConfigSettings;
diff --git a/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClientTest.java b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClientTest.java
index c1fcc914..2e33f82a 100644
--- a/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClientTest.java
+++ b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClientTest.java
@@ -84,30 +84,19 @@ public void tearDown() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void createScanConfigTest() {
-    ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
-    String displayName = "displayName1615086568";
-    int maxQps = 844445913;
-    ScanConfig expectedResponse =
-        ScanConfig.newBuilder()
-            .setName(name.toString())
-            .setDisplayName(displayName)
-            .setMaxQps(maxQps)
-            .build();
+  public void deleteScanConfigTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
     mockWebSecurityScanner.addResponse(expectedResponse);
 
-    ProjectName parent = ProjectName.of("[PROJECT]");
-    ScanConfig scanConfig = ScanConfig.newBuilder().build();
+    ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
 
-    ScanConfig actualResponse = client.createScanConfig(parent, scanConfig);
-    Assert.assertEquals(expectedResponse, actualResponse);
+    client.deleteScanConfig(name);
 
     List actualRequests = mockWebSecurityScanner.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    CreateScanConfigRequest actualRequest = (CreateScanConfigRequest) actualRequests.get(0);
+    DeleteScanConfigRequest actualRequest = (DeleteScanConfigRequest) actualRequests.get(0);
 
-    Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
-    Assert.assertEquals(scanConfig, actualRequest.getScanConfig());
+    Assert.assertEquals(name, ScanConfigName.parse(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -116,15 +105,14 @@ public void createScanConfigTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void createScanConfigExceptionTest() throws Exception {
+  public void deleteScanConfigExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockWebSecurityScanner.addException(exception);
 
     try {
-      ProjectName parent = ProjectName.of("[PROJECT]");
-      ScanConfig scanConfig = ScanConfig.newBuilder().build();
+      ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
 
-      client.createScanConfig(parent, scanConfig);
+      client.deleteScanConfig(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -133,19 +121,30 @@ public void createScanConfigExceptionTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void deleteScanConfigTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
+  public void createScanConfigTest() {
+    ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+    String displayName = "displayName1615086568";
+    int maxQps = 844445913;
+    ScanConfig expectedResponse =
+        ScanConfig.newBuilder()
+            .setName(name.toString())
+            .setDisplayName(displayName)
+            .setMaxQps(maxQps)
+            .build();
     mockWebSecurityScanner.addResponse(expectedResponse);
 
-    ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+    ProjectName parent = ProjectName.of("[PROJECT]");
+    ScanConfig scanConfig = ScanConfig.newBuilder().build();
 
-    client.deleteScanConfig(name);
+    ScanConfig actualResponse = client.createScanConfig(parent, scanConfig);
+    Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockWebSecurityScanner.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    DeleteScanConfigRequest actualRequest = (DeleteScanConfigRequest) actualRequests.get(0);
+    CreateScanConfigRequest actualRequest = (CreateScanConfigRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ScanConfigName.parse(actualRequest.getName()));
+    Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
+    Assert.assertEquals(scanConfig, actualRequest.getScanConfig());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -154,14 +153,15 @@ public void deleteScanConfigTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void deleteScanConfigExceptionTest() throws Exception {
+  public void createScanConfigExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockWebSecurityScanner.addException(exception);
 
     try {
-      ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+      ProjectName parent = ProjectName.of("[PROJECT]");
+      ScanConfig scanConfig = ScanConfig.newBuilder().build();
 
-      client.deleteScanConfig(name);
+      client.createScanConfig(parent, scanConfig);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
diff --git a/synth.metadata b/synth.metadata
index 69d56e65..4370dd04 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -11,16 +11,16 @@
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7",
-        "internalRef": "310660461"
+        "sha": "5a90d467aa65e7f038f87585e8fbb45d74475e7c",
+        "internalRef": "312088359"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7",
-        "internalRef": "310660461"
+        "sha": "5a90d467aa65e7f038f87585e8fbb45d74475e7c",
+        "internalRef": "312088359"
       }
     },
     {