Skip to content

Commit 782d884

Browse files
munkhuushmglanguillanneuf
authored andcommitted
chores: removed extra client settings for automl (#346)
1 parent bf1ba3a commit 782d884

File tree

3 files changed

+3
-42
lines changed

3 files changed

+3
-42
lines changed

automl/snippets/src/main/java/com/beta/automl/ListDatasets.java

+1-14
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,7 @@ static void listDatasets(String projectId) throws IOException {
4040
// Initialize client that will be used to send requests. This client only needs to be created
4141
// once, and can be reused for multiple requests. After completing all of your requests, call
4242
// the "close" method on the client to safely clean up any remaining background resources.
43-
AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder();
44-
45-
autoMlSettingsBuilder
46-
.listDatasetsSettings()
47-
.setRetrySettings(
48-
autoMlSettingsBuilder
49-
.listDatasetsSettings()
50-
.getRetrySettings()
51-
.toBuilder()
52-
.setTotalTimeout(Duration.ofSeconds(15))
53-
.build());
54-
AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build();
55-
56-
try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) {
43+
try (AutoMlClient client = AutoMlClient.create()) {
5744
// A resource that represents Google Cloud Platform location.
5845
LocationName projectLocation = LocationName.of(projectId, "us-central1");
5946
ListDatasetsRequest request =

automl/snippets/src/main/java/com/beta/automl/ListModels.java

+1-14
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,7 @@ static void listModels(String projectId) throws IOException {
3939
// Initialize client that will be used to send requests. This client only needs to be created
4040
// once, and can be reused for multiple requests. After completing all of your requests, call
4141
// the "close" method on the client to safely clean up any remaining background resources.
42-
AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder();
43-
44-
autoMlSettingsBuilder
45-
.listModelsSettings()
46-
.setRetrySettings(
47-
autoMlSettingsBuilder
48-
.listModelsSettings()
49-
.getRetrySettings()
50-
.toBuilder()
51-
.setTotalTimeout(Duration.ofSeconds(30))
52-
.build());
53-
AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build();
54-
55-
try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) {
42+
try (AutoMlClient client = AutoMlClient.create()) {
5643
// A resource that represents Google Cloud Platform location.
5744
LocationName projectLocation = LocationName.of(projectId, "us-central1");
5845

automl/snippets/src/main/java/com/example/automl/ListModels.java

+1-14
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,7 @@ static void listModels(String projectId) throws IOException {
3838
// Initialize client that will be used to send requests. This client only needs to be created
3939
// once, and can be reused for multiple requests. After completing all of your requests, call
4040
// the "close" method on the client to safely clean up any remaining background resources.
41-
AutoMlSettings.Builder autoMlSettingsBuilder = AutoMlSettings.newBuilder();
42-
43-
autoMlSettingsBuilder
44-
.listModelsSettings()
45-
.setRetrySettings(
46-
autoMlSettingsBuilder
47-
.listModelsSettings()
48-
.getRetrySettings()
49-
.toBuilder()
50-
.setTotalTimeout(Duration.ofSeconds(20))
51-
.build());
52-
AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build();
53-
54-
try (AutoMlClient client = AutoMlClient.create(autoMlSettings)) {
41+
try (AutoMlClient client = AutoMlClient.create()) {
5542
// A resource that represents Google Cloud Platform location.
5643
LocationName projectLocation = LocationName.of(projectId, "us-central1");
5744

0 commit comments

Comments
 (0)