From d2fa8cb7abf84da55d76e844ab919446a482fe87 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Tue, 10 Sep 2024 19:35:00 +0000 Subject: [PATCH] chore: generate libraries at Tue Sep 10 19:32:36 UTC 2024 --- .../cloud/logging/v2/ConfigSettings.java | 42 ++++++++++++- .../cloud/logging/v2/LoggingSettings.java | 17 ++++- .../cloud/logging/v2/MetricsSettings.java | 17 ++++- .../v2/stub/ConfigServiceV2StubSettings.java | 63 ++++++++++++++----- .../v2/stub/LoggingServiceV2StubSettings.java | 29 +++++---- .../v2/stub/MetricsServiceV2StubSettings.java | 21 +++++-- 6 files changed, 150 insertions(+), 39 deletions(-) diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java index cbc81947b..4eb0e52de 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java @@ -101,7 +101,9 @@ *

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 getBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -117,10 +119,46 @@
  *             .getBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * ConfigSettings configSettings = configSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createBucketAsync: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class ConfigSettings extends ClientSettings { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java index f1763bf80..a7bc78d67 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java @@ -64,7 +64,9 @@ *

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 deleteLog to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -80,10 +82,21 @@
  *             .deleteLogSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * LoggingSettings loggingSettings = loggingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LoggingSettings extends ClientSettings { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java index bb3afbcc6..7e4ac8fa3 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java @@ -56,7 +56,9 @@ *

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 getLogMetric to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -72,10 +74,21 @@
  *             .getLogMetricSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * MetricsSettings metricsSettings = metricsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class MetricsSettings extends ClientSettings { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index bbe4525d8..34aa5816b 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -120,7 +120,9 @@ *

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 getBucket to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -137,10 +139,47 @@
  *             .getBucketSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createBucketAsync: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigServiceV2StubSettings.Builder configSettingsBuilder =
+ *     ConfigServiceV2StubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class ConfigServiceV2StubSettings extends StubSettings { @@ -234,9 +273,7 @@ public String extractNextToken(ListBucketsResponse payload) { @Override public Iterable extractResources(ListBucketsResponse payload) { - return payload.getBucketsList() == null - ? ImmutableList.of() - : payload.getBucketsList(); + return payload.getBucketsList(); } }; @@ -270,9 +307,7 @@ public String extractNextToken(ListViewsResponse payload) { @Override public Iterable extractResources(ListViewsResponse payload) { - return payload.getViewsList() == null - ? ImmutableList.of() - : payload.getViewsList(); + return payload.getViewsList(); } }; @@ -306,9 +341,7 @@ public String extractNextToken(ListSinksResponse payload) { @Override public Iterable extractResources(ListSinksResponse payload) { - return payload.getSinksList() == null - ? ImmutableList.of() - : payload.getSinksList(); + return payload.getSinksList(); } }; @@ -342,9 +375,7 @@ public String extractNextToken(ListLinksResponse payload) { @Override public Iterable extractResources(ListLinksResponse payload) { - return payload.getLinksList() == null - ? ImmutableList.of() - : payload.getLinksList(); + return payload.getLinksList(); } }; @@ -380,9 +411,7 @@ public String extractNextToken(ListExclusionsResponse payload) { @Override public Iterable extractResources(ListExclusionsResponse payload) { - return payload.getExclusionsList() == null - ? ImmutableList.of() - : payload.getExclusionsList(); + return payload.getExclusionsList(); } }; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index d4f3c30bd..ebeeb21e1 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -90,7 +90,9 @@ *

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 deleteLog to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -107,10 +109,21 @@
  *             .deleteLogSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class LoggingServiceV2StubSettings extends StubSettings { @@ -171,9 +184,7 @@ public String extractNextToken(ListLogEntriesResponse payload) { @Override public Iterable extractResources(ListLogEntriesResponse payload) { - return payload.getEntriesList() == null - ? ImmutableList.of() - : payload.getEntriesList(); + return payload.getEntriesList(); } }; @@ -220,9 +231,7 @@ public String extractNextToken(ListMonitoredResourceDescriptorsResponse payload) @Override public Iterable extractResources( ListMonitoredResourceDescriptorsResponse payload) { - return payload.getResourceDescriptorsList() == null - ? ImmutableList.of() - : payload.getResourceDescriptorsList(); + return payload.getResourceDescriptorsList(); } }; @@ -256,9 +265,7 @@ public String extractNextToken(ListLogsResponse payload) { @Override public Iterable extractResources(ListLogsResponse payload) { - return payload.getLogNamesList() == null - ? ImmutableList.of() - : payload.getLogNamesList(); + return payload.getLogNamesList(); } }; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 84eecd198..b7a7599f6 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -72,7 +72,9 @@ *

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 getLogMetric to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -89,10 +91,21 @@
  *             .getLogMetricSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class MetricsServiceV2StubSettings extends StubSettings { @@ -145,9 +158,7 @@ public String extractNextToken(ListLogMetricsResponse payload) { @Override public Iterable extractResources(ListLogMetricsResponse payload) { - return payload.getMetricsList() == null - ? ImmutableList.of() - : payload.getMetricsList(); + return payload.getMetricsList(); } };