diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java index 1494d49d83c2..3c0148a7088c 100644 --- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java +++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceClient.java @@ -50,8 +50,11 @@ * calls that map to API methods. Sample code to get started: * *
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String traceId = "traceId-1067401920";
@@ -88,8 +91,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -100,8 +106,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * TraceServiceClient traceServiceClient = TraceServiceClient.create(traceServiceSettings);
@@ -111,8 +120,11 @@
  * the wire:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -179,8 +191,11 @@ public TraceServiceStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   String projectId = "projectId-894832108";
    *   for (Trace element : traceServiceClient.listTraces(projectId).iterateAll()) {
@@ -204,8 +219,11 @@ public final ListTracesPagedResponse listTraces(String projectId) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   ListTracesRequest request =
    *       ListTracesRequest.newBuilder()
@@ -237,8 +255,11 @@ public final ListTracesPagedResponse listTraces(ListTracesRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   ListTracesRequest request =
    *       ListTracesRequest.newBuilder()
@@ -269,8 +290,11 @@ public final UnaryCallable listTrace
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   ListTracesRequest request =
    *       ListTracesRequest.newBuilder()
@@ -308,8 +332,11 @@ public final UnaryCallable listTracesCall
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String traceId = "traceId-1067401920";
@@ -334,8 +361,11 @@ public final Trace getTrace(String projectId, String traceId) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   GetTraceRequest request =
    *       GetTraceRequest.newBuilder()
@@ -360,8 +390,11 @@ public final Trace getTrace(GetTraceRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   GetTraceRequest request =
    *       GetTraceRequest.newBuilder()
@@ -388,8 +421,11 @@ public final UnaryCallable getTraceCallable() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   String projectId = "projectId-894832108";
    *   Traces traces = Traces.newBuilder().build();
@@ -417,8 +453,11 @@ public final void patchTraces(String projectId, Traces traces) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   PatchTracesRequest request =
    *       PatchTracesRequest.newBuilder()
@@ -446,8 +485,11 @@ public final void patchTraces(PatchTracesRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   PatchTracesRequest request =
    *       PatchTracesRequest.newBuilder()
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
index 1d262efaa0c0..06c5d68d521b 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/TraceServiceSettings.java
@@ -59,16 +59,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings.Builder traceServiceSettingsBuilder = TraceServiceSettings.newBuilder();
  * traceServiceSettingsBuilder
  *     .getTraceSettings()
  *     .setRetrySettings(
- *         traceServiceSettingsBuilder
- *             .getTraceSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         traceServiceSettingsBuilder.getTraceSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * TraceServiceSettings traceServiceSettings = traceServiceSettingsBuilder.build();
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
index 90350597cd25..ca66d03a4973 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/package-info.java
@@ -27,8 +27,11 @@
  * 

Sample for TraceServiceClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String traceId = "traceId-1067401920";
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/HttpJsonTraceServiceStub.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/HttpJsonTraceServiceStub.java
index 7ebf0b19eff8..4c48993c8545 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/HttpJsonTraceServiceStub.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/HttpJsonTraceServiceStub.java
@@ -153,7 +153,8 @@ public class HttpJsonTraceServiceStub extends TraceServiceStub {
                         return fields;
                       })
                   .setRequestBodyExtractor(
-                      request -> ProtoRestSerializer.create().toBody("traces", request.getTraces()))
+                      request ->
+                          ProtoRestSerializer.create().toBody("traces", request.getTraces(), false))
                   .build())
           .setResponseParser(
               ProtoMessageResponseParser.newBuilder()
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
index 086c1fb6314b..b75fe661d10a 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
@@ -76,17 +76,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceStubSettings.Builder traceServiceSettingsBuilder =
  *     TraceServiceStubSettings.newBuilder();
  * traceServiceSettingsBuilder
  *     .getTraceSettings()
  *     .setRetrySettings(
- *         traceServiceSettingsBuilder
- *             .getTraceSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         traceServiceSettingsBuilder.getTraceSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * TraceServiceStubSettings traceServiceSettings = traceServiceSettingsBuilder.build();
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
index 8b3a6dc64d01..eb08045a3179 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java
@@ -40,8 +40,11 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
  *   ProjectName name = ProjectName.of("[PROJECT]");
  *   List spans = new ArrayList<>();
@@ -78,8 +81,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -90,8 +96,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * TraceServiceClient traceServiceClient = TraceServiceClient.create(traceServiceSettings);
@@ -101,8 +110,11 @@
  * the wire:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings traceServiceSettings =
  *     TraceServiceSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -169,8 +181,11 @@ public TraceServiceStub getStub() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   ProjectName name = ProjectName.of("[PROJECT]");
    *   List spans = new ArrayList<>();
@@ -200,8 +215,11 @@ public final void batchWriteSpans(ProjectName name, List spans) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   String name = ProjectName.of("[PROJECT]").toString();
    *   List spans = new ArrayList<>();
@@ -228,8 +246,11 @@ public final void batchWriteSpans(String name, List spans) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   BatchWriteSpansRequest request =
    *       BatchWriteSpansRequest.newBuilder()
@@ -254,8 +275,11 @@ public final void batchWriteSpans(BatchWriteSpansRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   BatchWriteSpansRequest request =
    *       BatchWriteSpansRequest.newBuilder()
@@ -279,8 +303,11 @@ public final UnaryCallable batchWriteSpansCallabl
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   Span request =
    *       Span.newBuilder()
@@ -316,8 +343,11 @@ public final Span createSpan(Span request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // 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
    * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
    *   Span request =
    *       Span.newBuilder()
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
index 91c76c6bb009..7f017c24c8fd 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceSettings.java
@@ -53,16 +53,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceSettings.Builder traceServiceSettingsBuilder = TraceServiceSettings.newBuilder();
  * traceServiceSettingsBuilder
  *     .batchWriteSpansSettings()
  *     .setRetrySettings(
- *         traceServiceSettingsBuilder
- *             .batchWriteSpansSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         traceServiceSettingsBuilder.batchWriteSpansSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * TraceServiceSettings traceServiceSettings = traceServiceSettingsBuilder.build();
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
index edfd727d60f1..520764c2b90d 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/package-info.java
@@ -27,8 +27,11 @@
  * 

Sample for TraceServiceClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
  *   ProjectName name = ProjectName.of("[PROJECT]");
  *   List spans = new ArrayList<>();
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/HttpJsonTraceServiceStub.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/HttpJsonTraceServiceStub.java
index cfa71f71610f..1eca78c9722d 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/HttpJsonTraceServiceStub.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/HttpJsonTraceServiceStub.java
@@ -78,7 +78,7 @@ public class HttpJsonTraceServiceStub extends TraceServiceStub {
                       .setRequestBodyExtractor(
                           request ->
                               ProtoRestSerializer.create()
-                                  .toBody("*", request.toBuilder().clearName().build()))
+                                  .toBody("*", request.toBuilder().clearName().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -111,7 +111,7 @@ public class HttpJsonTraceServiceStub extends TraceServiceStub {
                   .setRequestBodyExtractor(
                       request ->
                           ProtoRestSerializer.create()
-                              .toBody("*", request.toBuilder().clearName().build()))
+                              .toBody("*", request.toBuilder().clearName().build(), false))
                   .build())
           .setResponseParser(
               ProtoMessageResponseParser.newBuilder()
diff --git a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
index 1315723f7208..55d080da0a2d 100644
--- a/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
+++ b/java-trace/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/stub/TraceServiceStubSettings.java
@@ -64,17 +64,17 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // 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
  * TraceServiceStubSettings.Builder traceServiceSettingsBuilder =
  *     TraceServiceStubSettings.newBuilder();
  * traceServiceSettingsBuilder
  *     .batchWriteSpansSettings()
  *     .setRetrySettings(
- *         traceServiceSettingsBuilder
- *             .batchWriteSpansSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         traceServiceSettingsBuilder.batchWriteSpansSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * TraceServiceStubSettings traceServiceSettings = traceServiceSettingsBuilder.build();