From 7998b5172e456854563cfe52c15d33ef1c88d43c Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Mon, 19 Oct 2020 15:53:07 -0700 Subject: [PATCH] chores: removed extra client settings for automl (#346) --- .../main/java/com/beta/automl/ListDatasets.java | 15 +-------------- .../src/main/java/com/beta/automl/ListModels.java | 15 +-------------- .../main/java/com/example/automl/ListModels.java | 15 +-------------- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/automl/snippets/src/main/java/com/beta/automl/ListDatasets.java b/automl/snippets/src/main/java/com/beta/automl/ListDatasets.java index cc36b61db3d..12cca0ce122 100644 --- a/automl/snippets/src/main/java/com/beta/automl/ListDatasets.java +++ b/automl/snippets/src/main/java/com/beta/automl/ListDatasets.java @@ -40,20 +40,7 @@ static void listDatasets(String projectId) throws IOException { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call // the "close" method on the client to safely clean up any remaining background resources. - AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder(); - - autoMlSettingsBuilder - .listDatasetsSettings() - .setRetrySettings( - autoMlSettingsBuilder - .listDatasetsSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(15)) - .build()); - AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build(); - - try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) { + try (AutoMlClient client = AutoMlClient.create()) { // A resource that represents Google Cloud Platform location. LocationName projectLocation = LocationName.of(projectId, "us-central1"); ListDatasetsRequest request = diff --git a/automl/snippets/src/main/java/com/beta/automl/ListModels.java b/automl/snippets/src/main/java/com/beta/automl/ListModels.java index a96472b7204..589594d41c7 100644 --- a/automl/snippets/src/main/java/com/beta/automl/ListModels.java +++ b/automl/snippets/src/main/java/com/beta/automl/ListModels.java @@ -39,20 +39,7 @@ static void listModels(String projectId) throws IOException { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call // the "close" method on the client to safely clean up any remaining background resources. - AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder(); - - autoMlSettingsBuilder - .listModelsSettings() - .setRetrySettings( - autoMlSettingsBuilder - .listModelsSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build(); - - try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) { + try (AutoMlClient client = AutoMlClient.create()) { // A resource that represents Google Cloud Platform location. LocationName projectLocation = LocationName.of(projectId, "us-central1"); diff --git a/automl/snippets/src/main/java/com/example/automl/ListModels.java b/automl/snippets/src/main/java/com/example/automl/ListModels.java index 9b2e5427c3b..ffb6ad9d150 100644 --- a/automl/snippets/src/main/java/com/example/automl/ListModels.java +++ b/automl/snippets/src/main/java/com/example/automl/ListModels.java @@ -38,20 +38,7 @@ static void listModels(String projectId) throws IOException { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call // the "close" method on the client to safely clean up any remaining background resources. - AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder(); - - autoMlSettingsBuilder - .listModelsSettings() - .setRetrySettings( - autoMlSettingsBuilder - .listModelsSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(20)) - .build()); - AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build(); - - try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) { + try (AutoMlClient client = AutoMlClient.create()) { // A resource that represents Google Cloud Platform location. LocationName projectLocation = LocationName.of(projectId, "us-central1");