All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.gmail.model.MessagePartBody Maven / Gradle / Ivy

/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/google/apis-client-generator/
 * (build: 2016-05-27 16:00:31 UTC)
 * on 2016-06-24 at 22:52:46 UTC 
 * Modify at your own risk.
 */

package com.google.api.services.gmail.model;

/**
 * The body of a single MIME message part.
 *
 * 

This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Gmail API. For a detailed explanation see: * https://developers.google.com/api-client-library/java/google-http-java-client/json *

* * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class MessagePartBody extends com.google.api.client.json.GenericJson { /** * When present, contains the ID of an external attachment that can be retrieved in a separate * messages.attachments.get request. When not present, the entire content of the message part body * is contained in the data field. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String attachmentId; /** * The body data of a MIME message part. May be empty for MIME container types that have no * message body or when the body data is sent as a separate attachment. An attachment ID is * present if the body data is contained in a separate attachment. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String data; /** * Total number of bytes in the body of the message part. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer size; /** * When present, contains the ID of an external attachment that can be retrieved in a separate * messages.attachments.get request. When not present, the entire content of the message part body * is contained in the data field. * @return value or {@code null} for none */ public java.lang.String getAttachmentId() { return attachmentId; } /** * When present, contains the ID of an external attachment that can be retrieved in a separate * messages.attachments.get request. When not present, the entire content of the message part body * is contained in the data field. * @param attachmentId attachmentId or {@code null} for none */ public MessagePartBody setAttachmentId(java.lang.String attachmentId) { this.attachmentId = attachmentId; return this; } /** * The body data of a MIME message part. May be empty for MIME container types that have no * message body or when the body data is sent as a separate attachment. An attachment ID is * present if the body data is contained in a separate attachment. * @see #decodeData() * @return value or {@code null} for none */ public java.lang.String getData() { return data; } /** * The body data of a MIME message part. May be empty for MIME container types that have no * message body or when the body data is sent as a separate attachment. An attachment ID is * present if the body data is contained in a separate attachment. * @see #getData() * @return Base64 decoded value or {@code null} for none * * @since 1.14 */ public byte[] decodeData() { return com.google.api.client.util.Base64.decodeBase64(data); } /** * The body data of a MIME message part. May be empty for MIME container types that have no * message body or when the body data is sent as a separate attachment. An attachment ID is * present if the body data is contained in a separate attachment. * @see #encodeData() * @param data data or {@code null} for none */ public MessagePartBody setData(java.lang.String data) { this.data = data; return this; } /** * The body data of a MIME message part. May be empty for MIME container types that have no * message body or when the body data is sent as a separate attachment. An attachment ID is * present if the body data is contained in a separate attachment. * @see #setData() * *

* The value is encoded Base64 or {@code null} for none. *

* * @since 1.14 */ public MessagePartBody encodeData(byte[] data) { this.data = com.google.api.client.util.Base64.encodeBase64URLSafeString(data); return this; } /** * Total number of bytes in the body of the message part. * @return value or {@code null} for none */ public java.lang.Integer getSize() { return size; } /** * Total number of bytes in the body of the message part. * @param size size or {@code null} for none */ public MessagePartBody setSize(java.lang.Integer size) { this.size = size; return this; } @Override public MessagePartBody set(String fieldName, Object value) { return (MessagePartBody) super.set(fieldName, value); } @Override public MessagePartBody clone() { return (MessagePartBody) super.clone(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy