Here are the examples of the java api class com.google.api.services.gmail.model.ListLabelsResponse taken from open source projects.
1. Mailbox#loadLabels()
Project: mail-importer
File: Mailbox.java
File: Mailbox.java
/** * Loads the user's labels and remembers them. */ void loadLabels() throws IOException { ListLabelsResponse labelResponse = gmailService.getServiceWithRetries().users().labels().list(user.getEmailAddress()).execute(); Verify.verify(!labelResponse.isEmpty(), "could not get labels %s"); List<Label> labels = labelResponse.getLabels(); labelsByName = labels.stream().collect(toMap(Label::getName, label -> label)); labelsById = labels.stream().collect(toMap(Label::getId, label -> label)); System.err.format("Got labels: %s", labelsByName); }