diff --git a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceClient.java b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceClient.java index fb07f73ee604..659a206f5567 100644 --- a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceClient.java +++ b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceClient.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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
  *   CreateProfileRequest request =
  *       CreateProfileRequest.newBuilder()
@@ -83,8 +86,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
  * ProfilerServiceSettings profilerServiceSettings =
  *     ProfilerServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -96,8 +102,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
  * ProfilerServiceSettings profilerServiceSettings =
  *     ProfilerServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * ProfilerServiceClient profilerServiceClient =
@@ -108,8 +117,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
  * ProfilerServiceSettings profilerServiceSettings =
  *     ProfilerServiceSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -187,8 +199,11 @@ public ProfilerServiceStub 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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   CreateProfileRequest request =
    *       CreateProfileRequest.newBuilder()
@@ -223,8 +238,11 @@ public final Profile createProfile(CreateProfileRequest 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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   CreateProfileRequest request =
    *       CreateProfileRequest.newBuilder()
@@ -250,8 +268,11 @@ public final UnaryCallable createProfileCallable(
    * 

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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   CreateOfflineProfileRequest request =
    *       CreateOfflineProfileRequest.newBuilder()
@@ -277,8 +298,11 @@ public final Profile createOfflineProfile(CreateOfflineProfileRequest 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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   CreateOfflineProfileRequest request =
    *       CreateOfflineProfileRequest.newBuilder()
@@ -305,8 +329,11 @@ public final UnaryCallable createOfflinePr
    * 

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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   UpdateProfileRequest request =
    *       UpdateProfileRequest.newBuilder()
@@ -333,8 +360,11 @@ public final Profile updateProfile(UpdateProfileRequest 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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
    *   UpdateProfileRequest request =
    *       UpdateProfileRequest.newBuilder()
diff --git a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceSettings.java b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceSettings.java
index 33f1b1ea583c..8e6798138678 100644
--- a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceSettings.java
+++ b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/ProfilerServiceSettings.java
@@ -50,17 +50,17 @@
  * 

For example, to set the total timeout of createProfile 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
  * ProfilerServiceSettings.Builder profilerServiceSettingsBuilder =
  *     ProfilerServiceSettings.newBuilder();
  * profilerServiceSettingsBuilder
  *     .createProfileSettings()
  *     .setRetrySettings(
- *         profilerServiceSettingsBuilder
- *             .createProfileSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         profilerServiceSettingsBuilder.createProfileSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProfilerServiceSettings profilerServiceSettings = profilerServiceSettingsBuilder.build();
diff --git a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/package-info.java b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/package-info.java
index e3dea2467fb3..7b505ca470f9 100644
--- a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/package-info.java
+++ b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/package-info.java
@@ -32,8 +32,11 @@
  * 

Sample for ProfilerServiceClient: * *

{@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 (ProfilerServiceClient profilerServiceClient = ProfilerServiceClient.create()) {
  *   CreateProfileRequest request =
  *       CreateProfileRequest.newBuilder()
diff --git a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/HttpJsonProfilerServiceStub.java b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/HttpJsonProfilerServiceStub.java
index 2ba41df61809..779f439ea9a5 100644
--- a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/HttpJsonProfilerServiceStub.java
+++ b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/HttpJsonProfilerServiceStub.java
@@ -79,7 +79,7 @@ public class HttpJsonProfilerServiceStub extends ProfilerServiceStub {
                       .setRequestBodyExtractor(
                           request ->
                               ProtoRestSerializer.create()
-                                  .toBody("*", request.toBuilder().clearParent().build()))
+                                  .toBody("*", request.toBuilder().clearParent().build(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -115,7 +115,8 @@ public class HttpJsonProfilerServiceStub extends ProfilerServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("profile", request.getProfile()))
+                              ProtoRestSerializer.create()
+                                  .toBody("profile", request.getProfile(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -152,7 +153,8 @@ public class HttpJsonProfilerServiceStub extends ProfilerServiceStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("profile", request.getProfile()))
+                              ProtoRestSerializer.create()
+                                  .toBody("profile", request.getProfile(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
diff --git a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/ProfilerServiceStubSettings.java b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/ProfilerServiceStubSettings.java
index f2ed96c41d2c..b8da89105b52 100644
--- a/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/ProfilerServiceStubSettings.java
+++ b/java-profiler/google-cloud-profiler/src/main/java/com/google/devtools/cloudprofiler/v2/stub/ProfilerServiceStubSettings.java
@@ -65,17 +65,17 @@
  * 

For example, to set the total timeout of createProfile 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
  * ProfilerServiceStubSettings.Builder profilerServiceSettingsBuilder =
  *     ProfilerServiceStubSettings.newBuilder();
  * profilerServiceSettingsBuilder
  *     .createProfileSettings()
  *     .setRetrySettings(
- *         profilerServiceSettingsBuilder
- *             .createProfileSettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         profilerServiceSettingsBuilder.createProfileSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ProfilerServiceStubSettings profilerServiceSettings = profilerServiceSettingsBuilder.build();