diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java index 8cc89dce01..495c60c01d 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java @@ -45,8 +45,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 (PoliciesClient policiesClient = PoliciesClient.create()) {
  *   String name = "name3373707";
  *   Policy response = policiesClient.getPolicy(name);
@@ -82,8 +85,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
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -94,8 +100,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
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
  * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
@@ -105,8 +114,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
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -200,8 +212,11 @@ public final OperationsClient getHttpJsonOperationsClient() {
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String parent = "parent-995424086";
    *   for (Policy element : policiesClient.listPolicies(parent).iterateAll()) {
@@ -233,8 +248,11 @@ public final ListPoliciesPagedResponse listPolicies(String parent) {
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -264,8 +282,11 @@ public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest 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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -295,8 +316,11 @@ public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest 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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -330,8 +354,11 @@ public final UnaryCallable listPolici
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String name = "name3373707";
    *   Policy response = policiesClient.getPolicy(name);
@@ -359,8 +386,11 @@ public final Policy getPolicy(String name) {
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
    *   Policy response = policiesClient.getPolicy(request);
@@ -381,8 +411,11 @@ public final Policy getPolicy(GetPolicyRequest 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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
    *   ApiFuture future = policiesClient.getPolicyCallable().futureCall(request);
@@ -402,8 +435,11 @@ public final UnaryCallable getPolicyCallable() {
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String parent = "parent-995424086";
    *   Policy policy = Policy.newBuilder().build();
@@ -444,8 +480,11 @@ public final OperationFuture createPolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -472,8 +511,11 @@ public final OperationFuture createPolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -500,8 +542,11 @@ public final OperationFuture createPolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -535,8 +580,11 @@ public final UnaryCallable createPolicyCallable(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -568,8 +616,11 @@ public final OperationFuture updatePolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -601,8 +652,11 @@ public final OperationFuture updatePolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -623,8 +677,11 @@ public final UnaryCallable updatePolicyCallable(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String name = "name3373707";
    *   Policy response = policiesClient.deletePolicyAsync(name).get();
@@ -652,8 +709,11 @@ public final OperationFuture deletePolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
@@ -676,8 +736,11 @@ public final OperationFuture deletePolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
@@ -700,8 +763,11 @@ public final OperationFuture deletePolicyAsync(
    * 

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
index 1f9de494ef..de80d3ce66 100644
--- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
+++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
@@ -55,16 +55,16 @@
  * 

For example, to set the total timeout of getPolicy 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
  * PoliciesSettings.Builder policiesSettingsBuilder = PoliciesSettings.newBuilder();
  * policiesSettingsBuilder
  *     .getPolicySettings()
  *     .setRetrySettings(
- *         policiesSettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PoliciesSettings policiesSettings = policiesSettingsBuilder.build();
diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
index f8f79438d2..e5ed70548c 100644
--- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
+++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
@@ -26,8 +26,11 @@
  * 

Sample for PoliciesClient: * *

{@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 (PoliciesClient policiesClient = PoliciesClient.create()) {
  *   String name = "name3373707";
  *   Policy response = policiesClient.getPolicy(name);
diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
index 1329c96f57..cd12ad2905 100644
--- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
+++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
@@ -160,7 +160,8 @@ public class HttpJsonPoliciesStub extends PoliciesStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+                              ProtoRestSerializer.create()
+                                  .toBody("policy", request.getPolicy(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -199,7 +200,8 @@ public class HttpJsonPoliciesStub extends PoliciesStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+                              ProtoRestSerializer.create()
+                                  .toBody("policy", request.getPolicy(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
index 48a3936f6f..7bfcfdf50c 100644
--- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
+++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
@@ -83,16 +83,16 @@
  * 

For example, to set the total timeout of getPolicy 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
  * PoliciesStubSettings.Builder policiesSettingsBuilder = PoliciesStubSettings.newBuilder();
  * policiesSettingsBuilder
  *     .getPolicySettings()
  *     .setRetrySettings(
- *         policiesSettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PoliciesStubSettings policiesSettings = policiesSettingsBuilder.build();