GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Request initialization logic is missing in in-code samples for *Callable() paginated methods · Issue #680 · googleapis/sdk-platform-java

This repository was archived by the owner on Oct 29, 2026. It is now read-only.
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Request initialization logic is missing in in-code samples for *Callable() paginated methods #680

Copy link
Copy link
Closed
Closed
Request initialization logic is missing in in-code samples for *Callable() paginated methods#680
Copy link
Assignees
summer-ji-eng
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.

Description

@vam-google
vam-google
opened on Mar 3, 2021
Issue body actions

This seems to be happening only in a very limited scope of the paginated <smth>Callable() methods.

The incode-samples for paginated methods seem missing request creation logic. This is how they look now

 // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to
   * learn more.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   *   while (true) {
   *     ListDeidentifyTemplatesResponse response =
   *         dlpServiceClient.listDeidentifyTemplatesCallable().call(request);
   *     for (DeidentifyTemplate element : response.getResponsesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }</pre>
   */
  public final UnaryCallable<ListDeidentifyTemplatesRequest, ListDeidentifyTemplatesResponse>
      listDeidentifyTemplatesCallable() {
    return stub.listDeidentifyTemplatesCallable();
  }

Notice that the request is not defined when first used in the example above.
Also there is an extra } right at the end (before </pre> element).

This is how they used to be:

 // AUTO-GENERATED DOCUMENTATION AND METHOD
  /**
   * Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to
   * learn more.
   *
   * <p>Sample code:
   *
   * <pre><code>
   * try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   *   ListDeidentifyTemplatesRequest request = ListDeidentifyTemplatesRequest.newBuilder()
   *     .setParent(parent.toString())
   *     .build();
   *   while (true) {
   *     ListDeidentifyTemplatesResponse response = dlpServiceClient.listDeidentifyTemplatesCallable().call(request);
   *     for (DeidentifyTemplate element : response.getDeidentifyTemplatesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * </code></pre>
   */
  public final UnaryCallable<ListDeidentifyTemplatesRequest, ListDeidentifyTemplatesResponse>
      listDeidentifyTemplatesCallable() {
    return stub.listDeidentifyTemplatesCallable();
  }

The request is defined and initialized before being used.

Activity

  1. product-auto-label
    added
    samplesIssues that are directly related to samples.
    on Mar 3, 2021
  2. miraleung
    assigned
    summer-ji-eng
    on Mar 3, 2021
  3. yoshi-automation
    added
    triage meI really want to be triaged.
    on Mar 4, 2021
  4. summer-ji-eng commented on Mar 6, 2021

    @summer-ji-eng
    summer-ji-eng
    on Mar 6, 2021
    Contributor
    More actions

    @vam-google Thanks for pointing out the issue. It should fix in #690

    "Also there is an extra } right at the end (before element)."
    The } is not extra, it closed for <pre>{@code..}</pre>.

  5. yoshi-automation
    added
    🚨This issue needs some love.
    on Mar 8, 2021
  6. miraleung
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Mar 11, 2021
  7. miraleung commented on Mar 11, 2021

    @miraleung
    miraleung
    on Mar 11, 2021
    Contributor
    More actions

    Looks like this is fixed, closing.

  8. miraleung
    closed this as completedon Mar 11, 2021
  9. suztomo
    added 4 commits that reference this issue on Mar 21, 2023

    deps: update dependency io.grpc:grpc-bom to v1.46.0 (#680)

    00f5d4a

    chore(main): release 2.11.0 (#688)

    e9300fe

    chore(main): release 2.0.0 (#739)

    ea9f421

    deps: update dependency org.graalvm.sdk:graal-sdk to v22 (#680)

    9ecf916
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @summer-ji-eng
    summer-ji-eng

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.