Codota Logo
Gmail$Users$Messages$List
Code IndexAdd Codota to your IDE (free)

How to use
Gmail$Users$Messages$List
in
com.google.api.services.gmail

Best Java code snippets using com.google.api.services.gmail.Gmail$Users$Messages$List (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: google/data-transfer-project

 /**
  * Sets up a response with a single message
  */
 private void setUpSingleMessageResponse() throws IOException {
  messageListResponse = new ListMessagesResponse()
    .setMessages(Collections.singletonList(INITIAL_MESSAGE));
  when(messageListRequest.execute()).thenReturn(messageListResponse);
  when(get.execute()).thenReturn(FULL_MESSAGE);
 }
}
origin: google/data-transfer-project

@Before
public void setup() throws IOException {
 googleMailExporter = new GoogleMailExporter(googleCredentialFactory, gmail);
 when(gmail.users()).thenReturn(users);
 when(users.messages()).thenReturn(messages);
 when(messages.list(Matchers.anyString())).thenReturn(messageListRequest);
 when(messageListRequest.setMaxResults(Matchers.anyLong())).thenReturn(messageListRequest);
 when(messages.get(Matchers.anyString(), Matchers.anyString())).thenReturn(get);
 when(get.setFormat(Matchers.anyString())).thenReturn(get);
 verifyZeroInteractions(googleCredentialFactory);
}
origin: google/data-transfer-project

@Test
public void exportMessagesSubsequentSet() throws IOException {
 setUpSingleMessageResponse();
 // Looking at subsequent page, with no page after it
 PaginationData paginationData = new StringPaginationToken(NEXT_TOKEN);
 ExportInformation exportInformation = new ExportInformation(paginationData, null);
 messageListResponse.setNextPageToken(null);
 // Run test
 ExportResult<MailContainerResource> result =
   googleMailExporter.export(JOB_ID, null, Optional.of(exportInformation));
 // Check results
 // Verify correct calls were made (i.e., token was set before execution)
 InOrder inOrder = Mockito.inOrder(messageListRequest);
 inOrder.verify(messageListRequest).setPageToken(NEXT_TOKEN);
 inOrder.verify(messageListRequest).execute();
 // Check pagination token (should be null)
 ContinuationData continuationData = (ContinuationData) result.getContinuationData();
 StringPaginationToken paginationToken =
   (StringPaginationToken) continuationData.getPaginationData();
 assertThat(paginationToken).isNull();
}
origin: google/data-transfer-project

inOrder.verify(messageListRequest).setMaxResults(GoogleMailExporter.PAGE_SIZE);
verify(messageListRequest, never()).setPageToken(Matchers.anyString());
origin: google/data-transfer-project

 request = gmail.users().messages().list(USER).setMaxResults(PAGE_SIZE);
} catch (IOException e) {
 return new ExportResult<>(e);
 request.setPageToken(
   ((StringPaginationToken) exportInformation.get().getPaginationData()).getToken());
 response = request.execute();
} catch (IOException e) {
 return new ExportResult<>(e);
origin: TEAMMATES/teammates

/**
 * Returns an empty list if there is no unread email of the user.
 */
private List<Message> getListOfUnreadEmailOfUser() throws IOException {
  List<Message> messageStubs = service.users().messages().list(username).setQ("is:UNREAD").execute().getMessages();
  return messageStubs == null ? new ArrayList<>() : messageStubs;
}
origin: com.google.apis/google-api-services-gmail

/**
 * Lists the messages in the user's mailbox.
 *
 * Create a request for the method "messages.list".
 *
 * This request holds the parameters needed by the gmail server.  After setting any optional
 * parameters, call the {@link List#execute()} method to invoke the remote operation.
 *
 * @param userId The user's email address. The special value me can be used to indicate the authenticated user.
 *        [default: me]
 * @return the request
 */
public List list(java.lang.String userId) throws java.io.IOException {
 List result = new List(userId);
 initialize(result);
 return result;
}
origin: google/mail-importer

for (LocalMessage localMessage : localMessages) {
 gmail.users().messages().list(user.getEmailAddress())
   .setQ("rfc822msgid:" + localMessage.getMessageId())
   .setFields("messages(id)")
   .queue(batch, new JsonBatchCallback<ListMessagesResponse>() {
    @Override
    public void onFailure(
origin: kebernet/shortyz

    .messages()
    .list("me")
    .setQ(query)
    .execute();
LOGGER.fine("==Found "+ neverNull(response.getMessages()).size()+" messages.");
for(Message message : neverNull(response.getMessages())){
com.google.api.services.gmailGmail$Users$Messages$List

Most used methods

  • execute
  • setQ
    Only return messages matching the specified query. Supports the same query format as the Gmail searc
  • setMaxResults
    Maximum number of messages to return.
  • setPageToken
    Page token to retrieve a specific page of results in the list.
  • <init>
    Lists the messages in the user's mailbox. Create a request for the method "messages.list". This requ
  • queue
  • setFields

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ImageIO (javax.imageio)
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now