/** * Creates a new draft with the DRAFT label. * * Create a request for the method "drafts.create". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation. <p> {@link * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Draft} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Create(java.lang.String userId, com.google.api.services.gmail.model.Draft content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Draft.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); initializeMediaUpload(mediaContent); }
/** * Sends the specified message to the recipients in the To, Cc, and Bcc headers. * * Create a request for the method "messages.send". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Send#execute()} method to invoke the remote operation. <p> {@link * Send#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be * called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Message} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Send(java.lang.String userId, com.google.api.services.gmail.model.Message content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Message.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); initializeMediaUpload(mediaContent); }
/** * Imports a message into only this user's mailbox, with standard email delivery scanning and * classification similar to receiving via SMTP. Does not send a message. * * Create a request for the method "messages.import". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link GmailImport#execute()} method to invoke the remote operation. <p> * {@link * GmailImport#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} * must be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Message} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected GmailImport(java.lang.String userId, com.google.api.services.gmail.model.Message content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Message.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); initializeMediaUpload(mediaContent); }
/** * Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. * * Create a request for the method "drafts.send". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Send#execute()} method to invoke the remote operation. <p> {@link * Send#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be * called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Draft} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Send(java.lang.String userId, com.google.api.services.gmail.model.Draft content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Message.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); initializeMediaUpload(mediaContent); }
/** * Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most * scanning and classification. Does not send a message. * * Create a request for the method "messages.insert". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Insert#execute()} method to invoke the remote operation. <p> {@link * Insert#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Message} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Insert(java.lang.String userId, com.google.api.services.gmail.model.Message content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Message.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); initializeMediaUpload(mediaContent); }
/** * Replaces a draft's content. * * Create a request for the method "drafts.update". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Update#execute()} method to invoke the remote operation. <p> {@link * Update#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * <p> * This constructor should be used for uploading media content. * </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me]@param id The ID of the draft to update. * @param content the {@link com.google.api.services.gmail.model.Draft} media metadata or {@code null} if none * @param mediaContent The media HTTP content or {@code null} if none. * @since 1.13 */ protected Update(java.lang.String userId, java.lang.String id, com.google.api.services.gmail.model.Draft content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { super(Gmail.this, "PUT", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.gmail.model.Draft.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); this.id = com.google.api.client.util.Preconditions.checkNotNull(id, "Required parameter id must be specified."); initializeMediaUpload(mediaContent); }