/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: org/waveprotocol/box/attachment/attachment.proto

package org.waveprotocol.box.attachment;

public final class AttachmentProto {
  private AttachmentProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public static final class AttachmentsResponse extends
      com.google.protobuf.GeneratedMessage {
    // Use AttachmentsResponse.newBuilder() to construct.
    private AttachmentsResponse() {
      initFields();
    }
    private AttachmentsResponse(boolean noInit) {}

    private static final AttachmentsResponse defaultInstance;
    public static AttachmentsResponse getDefaultInstance() {
      return defaultInstance;
    }

    public AttachmentsResponse getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_AttachmentsResponse_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_AttachmentsResponse_fieldAccessorTable;
    }

    // repeated .attachment.AttachmentMetadata attachment = 1;
    public static final int ATTACHMENT_FIELD_NUMBER = 1;
    private java.util.List<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata> attachment_ =
      java.util.Collections.emptyList();
    public java.util.List<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata> getAttachmentList() {
      return attachment_;
    }
    public int getAttachmentCount() { return attachment_.size(); }
    public org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata getAttachment(int index) {
      return attachment_.get(index);
    }

    private void initFields() {
    }
    public final boolean isInitialized() {
      for (org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata element : getAttachmentList()) {
        if (!element.isInitialized()) return false;
      }
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      for (org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata element : getAttachmentList()) {
        output.writeMessage(1, element);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      for (org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata element : getAttachmentList()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, element);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse result;

      // Construct using org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.newBuilder()
      private Builder() {}

      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse();
        return builder;
      }

      protected org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse internalGetResult() {
        return result;
      }

      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse();
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(result);
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.getDescriptor();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse getDefaultInstanceForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.getDefaultInstance();
      }

      public boolean isInitialized() {
        return result.isInitialized();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }

      private org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        if (result.attachment_ != java.util.Collections.EMPTY_LIST) {
          result.attachment_ =
            java.util.Collections.unmodifiableList(result.attachment_);
        }
        org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse returnMe = result;
        result = null;
        return returnMe;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse) {
          return mergeFrom((org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse other) {
        if (other == org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.getDefaultInstance()) return this;
        if (!other.attachment_.isEmpty()) {
          if (result.attachment_.isEmpty()) {
            result.attachment_ = new java.util.ArrayList<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata>();
          }
          result.attachment_.addAll(other.attachment_);
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 10: {
              org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.Builder subBuilder = org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.newBuilder();
              input.readMessage(subBuilder, extensionRegistry);
              addAttachment(subBuilder.buildPartial());
              break;
            }
          }
        }
      }


      // repeated .attachment.AttachmentMetadata attachment = 1;
      public java.util.List<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata> getAttachmentList() {
        return java.util.Collections.unmodifiableList(result.attachment_);
      }
      public int getAttachmentCount() {
        return result.getAttachmentCount();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata getAttachment(int index) {
        return result.getAttachment(index);
      }
      public Builder setAttachment(int index, org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.attachment_.set(index, value);
        return this;
      }
      public Builder setAttachment(int index, org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.Builder builderForValue) {
        result.attachment_.set(index, builderForValue.build());
        return this;
      }
      public Builder addAttachment(org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata value) {
        if (value == null) {
          throw new NullPointerException();
        }
        if (result.attachment_.isEmpty()) {
          result.attachment_ = new java.util.ArrayList<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata>();
        }
        result.attachment_.add(value);
        return this;
      }
      public Builder addAttachment(org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.Builder builderForValue) {
        if (result.attachment_.isEmpty()) {
          result.attachment_ = new java.util.ArrayList<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata>();
        }
        result.attachment_.add(builderForValue.build());
        return this;
      }
      public Builder addAllAttachment(
          java.lang.Iterable<? extends org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata> values) {
        if (result.attachment_.isEmpty()) {
          result.attachment_ = new java.util.ArrayList<org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata>();
        }
        super.addAll(values, result.attachment_);
        return this;
      }
      public Builder clearAttachment() {
        result.attachment_ = java.util.Collections.emptyList();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:attachment.AttachmentsResponse)
    }

    static {
      defaultInstance = new AttachmentsResponse(true);
      org.waveprotocol.box.attachment.AttachmentProto.internalForceInit();
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:attachment.AttachmentsResponse)
  }

  public static final class AttachmentMetadata extends
      com.google.protobuf.GeneratedMessage {
    // Use AttachmentMetadata.newBuilder() to construct.
    private AttachmentMetadata() {
      initFields();
    }
    private AttachmentMetadata(boolean noInit) {}

    private static final AttachmentMetadata defaultInstance;
    public static AttachmentMetadata getDefaultInstance() {
      return defaultInstance;
    }

    public AttachmentMetadata getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_AttachmentMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_AttachmentMetadata_fieldAccessorTable;
    }

    // required string attachmentId = 1;
    public static final int ATTACHMENTID_FIELD_NUMBER = 1;
    private boolean hasAttachmentId;
    private java.lang.String attachmentId_ = "";
    public boolean hasAttachmentId() { return hasAttachmentId; }
    public java.lang.String getAttachmentId() { return attachmentId_; }

    // required string waveRef = 2;
    public static final int WAVEREF_FIELD_NUMBER = 2;
    private boolean hasWaveRef;
    private java.lang.String waveRef_ = "";
    public boolean hasWaveRef() { return hasWaveRef; }
    public java.lang.String getWaveRef() { return waveRef_; }

    // required string fileName = 3;
    public static final int FILENAME_FIELD_NUMBER = 3;
    private boolean hasFileName;
    private java.lang.String fileName_ = "";
    public boolean hasFileName() { return hasFileName; }
    public java.lang.String getFileName() { return fileName_; }

    // required string mimeType = 4;
    public static final int MIMETYPE_FIELD_NUMBER = 4;
    private boolean hasMimeType;
    private java.lang.String mimeType_ = "";
    public boolean hasMimeType() { return hasMimeType; }
    public java.lang.String getMimeType() { return mimeType_; }

    // required int64 size = 5;
    public static final int SIZE_FIELD_NUMBER = 5;
    private boolean hasSize;
    private long size_ = 0L;
    public boolean hasSize() { return hasSize; }
    public long getSize() { return size_; }

    // required string creator = 6;
    public static final int CREATOR_FIELD_NUMBER = 6;
    private boolean hasCreator;
    private java.lang.String creator_ = "";
    public boolean hasCreator() { return hasCreator; }
    public java.lang.String getCreator() { return creator_; }

    // required string attachmentUrl = 7;
    public static final int ATTACHMENTURL_FIELD_NUMBER = 7;
    private boolean hasAttachmentUrl;
    private java.lang.String attachmentUrl_ = "";
    public boolean hasAttachmentUrl() { return hasAttachmentUrl; }
    public java.lang.String getAttachmentUrl() { return attachmentUrl_; }

    // required string thumbnailUrl = 8;
    public static final int THUMBNAILURL_FIELD_NUMBER = 8;
    private boolean hasThumbnailUrl;
    private java.lang.String thumbnailUrl_ = "";
    public boolean hasThumbnailUrl() { return hasThumbnailUrl; }
    public java.lang.String getThumbnailUrl() { return thumbnailUrl_; }

    // optional .attachment.ImageMetadata imageMetadata = 9;
    public static final int IMAGEMETADATA_FIELD_NUMBER = 9;
    private boolean hasImageMetadata;
    private org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata imageMetadata_;
    public boolean hasImageMetadata() { return hasImageMetadata; }
    public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata getImageMetadata() { return imageMetadata_; }

    // optional .attachment.ImageMetadata thumbnailMetadata = 10;
    public static final int THUMBNAILMETADATA_FIELD_NUMBER = 10;
    private boolean hasThumbnailMetadata;
    private org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata thumbnailMetadata_;
    public boolean hasThumbnailMetadata() { return hasThumbnailMetadata; }
    public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata getThumbnailMetadata() { return thumbnailMetadata_; }

    // optional bool malware = 11;
    public static final int MALWARE_FIELD_NUMBER = 11;
    private boolean hasMalware;
    private boolean malware_ = false;
    public boolean hasMalware() { return hasMalware; }
    public boolean getMalware() { return malware_; }

    private void initFields() {
      imageMetadata_ = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance();
      thumbnailMetadata_ = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance();
    }
    public final boolean isInitialized() {
      if (!hasAttachmentId) return false;
      if (!hasWaveRef) return false;
      if (!hasFileName) return false;
      if (!hasMimeType) return false;
      if (!hasSize) return false;
      if (!hasCreator) return false;
      if (!hasAttachmentUrl) return false;
      if (!hasThumbnailUrl) return false;
      if (hasImageMetadata()) {
        if (!getImageMetadata().isInitialized()) return false;
      }
      if (hasThumbnailMetadata()) {
        if (!getThumbnailMetadata().isInitialized()) return false;
      }
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (hasAttachmentId()) {
        output.writeString(1, getAttachmentId());
      }
      if (hasWaveRef()) {
        output.writeString(2, getWaveRef());
      }
      if (hasFileName()) {
        output.writeString(3, getFileName());
      }
      if (hasMimeType()) {
        output.writeString(4, getMimeType());
      }
      if (hasSize()) {
        output.writeInt64(5, getSize());
      }
      if (hasCreator()) {
        output.writeString(6, getCreator());
      }
      if (hasAttachmentUrl()) {
        output.writeString(7, getAttachmentUrl());
      }
      if (hasThumbnailUrl()) {
        output.writeString(8, getThumbnailUrl());
      }
      if (hasImageMetadata()) {
        output.writeMessage(9, getImageMetadata());
      }
      if (hasThumbnailMetadata()) {
        output.writeMessage(10, getThumbnailMetadata());
      }
      if (hasMalware()) {
        output.writeBool(11, getMalware());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (hasAttachmentId()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(1, getAttachmentId());
      }
      if (hasWaveRef()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(2, getWaveRef());
      }
      if (hasFileName()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(3, getFileName());
      }
      if (hasMimeType()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(4, getMimeType());
      }
      if (hasSize()) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(5, getSize());
      }
      if (hasCreator()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(6, getCreator());
      }
      if (hasAttachmentUrl()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(7, getAttachmentUrl());
      }
      if (hasThumbnailUrl()) {
        size += com.google.protobuf.CodedOutputStream
          .computeStringSize(8, getThumbnailUrl());
      }
      if (hasImageMetadata()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(9, getImageMetadata());
      }
      if (hasThumbnailMetadata()) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(10, getThumbnailMetadata());
      }
      if (hasMalware()) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(11, getMalware());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata result;

      // Construct using org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.newBuilder()
      private Builder() {}

      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata();
        return builder;
      }

      protected org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata internalGetResult() {
        return result;
      }

      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata();
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(result);
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.getDescriptor();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata getDefaultInstanceForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.getDefaultInstance();
      }

      public boolean isInitialized() {
        return result.isInitialized();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }

      private org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata returnMe = result;
        result = null;
        return returnMe;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata) {
          return mergeFrom((org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata other) {
        if (other == org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.getDefaultInstance()) return this;
        if (other.hasAttachmentId()) {
          setAttachmentId(other.getAttachmentId());
        }
        if (other.hasWaveRef()) {
          setWaveRef(other.getWaveRef());
        }
        if (other.hasFileName()) {
          setFileName(other.getFileName());
        }
        if (other.hasMimeType()) {
          setMimeType(other.getMimeType());
        }
        if (other.hasSize()) {
          setSize(other.getSize());
        }
        if (other.hasCreator()) {
          setCreator(other.getCreator());
        }
        if (other.hasAttachmentUrl()) {
          setAttachmentUrl(other.getAttachmentUrl());
        }
        if (other.hasThumbnailUrl()) {
          setThumbnailUrl(other.getThumbnailUrl());
        }
        if (other.hasImageMetadata()) {
          mergeImageMetadata(other.getImageMetadata());
        }
        if (other.hasThumbnailMetadata()) {
          mergeThumbnailMetadata(other.getThumbnailMetadata());
        }
        if (other.hasMalware()) {
          setMalware(other.getMalware());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 10: {
              setAttachmentId(input.readString());
              break;
            }
            case 18: {
              setWaveRef(input.readString());
              break;
            }
            case 26: {
              setFileName(input.readString());
              break;
            }
            case 34: {
              setMimeType(input.readString());
              break;
            }
            case 40: {
              setSize(input.readInt64());
              break;
            }
            case 50: {
              setCreator(input.readString());
              break;
            }
            case 58: {
              setAttachmentUrl(input.readString());
              break;
            }
            case 66: {
              setThumbnailUrl(input.readString());
              break;
            }
            case 74: {
              org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.Builder subBuilder = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.newBuilder();
              if (hasImageMetadata()) {
                subBuilder.mergeFrom(getImageMetadata());
              }
              input.readMessage(subBuilder, extensionRegistry);
              setImageMetadata(subBuilder.buildPartial());
              break;
            }
            case 82: {
              org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.Builder subBuilder = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.newBuilder();
              if (hasThumbnailMetadata()) {
                subBuilder.mergeFrom(getThumbnailMetadata());
              }
              input.readMessage(subBuilder, extensionRegistry);
              setThumbnailMetadata(subBuilder.buildPartial());
              break;
            }
            case 88: {
              setMalware(input.readBool());
              break;
            }
          }
        }
      }


      // required string attachmentId = 1;
      public boolean hasAttachmentId() {
        return result.hasAttachmentId();
      }
      public java.lang.String getAttachmentId() {
        return result.getAttachmentId();
      }
      public Builder setAttachmentId(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasAttachmentId = true;
        result.attachmentId_ = value;
        return this;
      }
      public Builder clearAttachmentId() {
        result.hasAttachmentId = false;
        result.attachmentId_ = getDefaultInstance().getAttachmentId();
        return this;
      }

      // required string waveRef = 2;
      public boolean hasWaveRef() {
        return result.hasWaveRef();
      }
      public java.lang.String getWaveRef() {
        return result.getWaveRef();
      }
      public Builder setWaveRef(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasWaveRef = true;
        result.waveRef_ = value;
        return this;
      }
      public Builder clearWaveRef() {
        result.hasWaveRef = false;
        result.waveRef_ = getDefaultInstance().getWaveRef();
        return this;
      }

      // required string fileName = 3;
      public boolean hasFileName() {
        return result.hasFileName();
      }
      public java.lang.String getFileName() {
        return result.getFileName();
      }
      public Builder setFileName(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasFileName = true;
        result.fileName_ = value;
        return this;
      }
      public Builder clearFileName() {
        result.hasFileName = false;
        result.fileName_ = getDefaultInstance().getFileName();
        return this;
      }

      // required string mimeType = 4;
      public boolean hasMimeType() {
        return result.hasMimeType();
      }
      public java.lang.String getMimeType() {
        return result.getMimeType();
      }
      public Builder setMimeType(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasMimeType = true;
        result.mimeType_ = value;
        return this;
      }
      public Builder clearMimeType() {
        result.hasMimeType = false;
        result.mimeType_ = getDefaultInstance().getMimeType();
        return this;
      }

      // required int64 size = 5;
      public boolean hasSize() {
        return result.hasSize();
      }
      public long getSize() {
        return result.getSize();
      }
      public Builder setSize(long value) {
        result.hasSize = true;
        result.size_ = value;
        return this;
      }
      public Builder clearSize() {
        result.hasSize = false;
        result.size_ = 0L;
        return this;
      }

      // required string creator = 6;
      public boolean hasCreator() {
        return result.hasCreator();
      }
      public java.lang.String getCreator() {
        return result.getCreator();
      }
      public Builder setCreator(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasCreator = true;
        result.creator_ = value;
        return this;
      }
      public Builder clearCreator() {
        result.hasCreator = false;
        result.creator_ = getDefaultInstance().getCreator();
        return this;
      }

      // required string attachmentUrl = 7;
      public boolean hasAttachmentUrl() {
        return result.hasAttachmentUrl();
      }
      public java.lang.String getAttachmentUrl() {
        return result.getAttachmentUrl();
      }
      public Builder setAttachmentUrl(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasAttachmentUrl = true;
        result.attachmentUrl_ = value;
        return this;
      }
      public Builder clearAttachmentUrl() {
        result.hasAttachmentUrl = false;
        result.attachmentUrl_ = getDefaultInstance().getAttachmentUrl();
        return this;
      }

      // required string thumbnailUrl = 8;
      public boolean hasThumbnailUrl() {
        return result.hasThumbnailUrl();
      }
      public java.lang.String getThumbnailUrl() {
        return result.getThumbnailUrl();
      }
      public Builder setThumbnailUrl(java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  result.hasThumbnailUrl = true;
        result.thumbnailUrl_ = value;
        return this;
      }
      public Builder clearThumbnailUrl() {
        result.hasThumbnailUrl = false;
        result.thumbnailUrl_ = getDefaultInstance().getThumbnailUrl();
        return this;
      }

      // optional .attachment.ImageMetadata imageMetadata = 9;
      public boolean hasImageMetadata() {
        return result.hasImageMetadata();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata getImageMetadata() {
        return result.getImageMetadata();
      }
      public Builder setImageMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.hasImageMetadata = true;
        result.imageMetadata_ = value;
        return this;
      }
      public Builder setImageMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.Builder builderForValue) {
        result.hasImageMetadata = true;
        result.imageMetadata_ = builderForValue.build();
        return this;
      }
      public Builder mergeImageMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata value) {
        if (result.hasImageMetadata() &&
            result.imageMetadata_ != org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance()) {
          result.imageMetadata_ =
            org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.newBuilder(result.imageMetadata_).mergeFrom(value).buildPartial();
        } else {
          result.imageMetadata_ = value;
        }
        result.hasImageMetadata = true;
        return this;
      }
      public Builder clearImageMetadata() {
        result.hasImageMetadata = false;
        result.imageMetadata_ = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance();
        return this;
      }

      // optional .attachment.ImageMetadata thumbnailMetadata = 10;
      public boolean hasThumbnailMetadata() {
        return result.hasThumbnailMetadata();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata getThumbnailMetadata() {
        return result.getThumbnailMetadata();
      }
      public Builder setThumbnailMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.hasThumbnailMetadata = true;
        result.thumbnailMetadata_ = value;
        return this;
      }
      public Builder setThumbnailMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.Builder builderForValue) {
        result.hasThumbnailMetadata = true;
        result.thumbnailMetadata_ = builderForValue.build();
        return this;
      }
      public Builder mergeThumbnailMetadata(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata value) {
        if (result.hasThumbnailMetadata() &&
            result.thumbnailMetadata_ != org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance()) {
          result.thumbnailMetadata_ =
            org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.newBuilder(result.thumbnailMetadata_).mergeFrom(value).buildPartial();
        } else {
          result.thumbnailMetadata_ = value;
        }
        result.hasThumbnailMetadata = true;
        return this;
      }
      public Builder clearThumbnailMetadata() {
        result.hasThumbnailMetadata = false;
        result.thumbnailMetadata_ = org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance();
        return this;
      }

      // optional bool malware = 11;
      public boolean hasMalware() {
        return result.hasMalware();
      }
      public boolean getMalware() {
        return result.getMalware();
      }
      public Builder setMalware(boolean value) {
        result.hasMalware = true;
        result.malware_ = value;
        return this;
      }
      public Builder clearMalware() {
        result.hasMalware = false;
        result.malware_ = false;
        return this;
      }

      // @@protoc_insertion_point(builder_scope:attachment.AttachmentMetadata)
    }

    static {
      defaultInstance = new AttachmentMetadata(true);
      org.waveprotocol.box.attachment.AttachmentProto.internalForceInit();
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:attachment.AttachmentMetadata)
  }

  public static final class ImageMetadata extends
      com.google.protobuf.GeneratedMessage {
    // Use ImageMetadata.newBuilder() to construct.
    private ImageMetadata() {
      initFields();
    }
    private ImageMetadata(boolean noInit) {}

    private static final ImageMetadata defaultInstance;
    public static ImageMetadata getDefaultInstance() {
      return defaultInstance;
    }

    public ImageMetadata getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_ImageMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.waveprotocol.box.attachment.AttachmentProto.internal_static_attachment_ImageMetadata_fieldAccessorTable;
    }

    // required int32 width = 1;
    public static final int WIDTH_FIELD_NUMBER = 1;
    private boolean hasWidth;
    private int width_ = 0;
    public boolean hasWidth() { return hasWidth; }
    public int getWidth() { return width_; }

    // required int32 height = 2;
    public static final int HEIGHT_FIELD_NUMBER = 2;
    private boolean hasHeight;
    private int height_ = 0;
    public boolean hasHeight() { return hasHeight; }
    public int getHeight() { return height_; }

    private void initFields() {
    }
    public final boolean isInitialized() {
      if (!hasWidth) return false;
      if (!hasHeight) return false;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (hasWidth()) {
        output.writeInt32(1, getWidth());
      }
      if (hasHeight()) {
        output.writeInt32(2, getHeight());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (hasWidth()) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, getWidth());
      }
      if (hasHeight()) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, getHeight());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata result;

      // Construct using org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.newBuilder()
      private Builder() {}

      private static Builder create() {
        Builder builder = new Builder();
        builder.result = new org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata();
        return builder;
      }

      protected org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata internalGetResult() {
        return result;
      }

      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException(
            "Cannot call clear() after build().");
        }
        result = new org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata();
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(result);
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDescriptor();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata getDefaultInstanceForType() {
        return org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance();
      }

      public boolean isInitialized() {
        return result.isInitialized();
      }
      public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }

      private org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }

      public org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata buildPartial() {
        if (result == null) {
          throw new IllegalStateException(
            "build() has already been called on this Builder.");
        }
        org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata returnMe = result;
        result = null;
        return returnMe;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata) {
          return mergeFrom((org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata other) {
        if (other == org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.getDefaultInstance()) return this;
        if (other.hasWidth()) {
          setWidth(other.getWidth());
        }
        if (other.hasHeight()) {
          setHeight(other.getHeight());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                return this;
              }
              break;
            }
            case 8: {
              setWidth(input.readInt32());
              break;
            }
            case 16: {
              setHeight(input.readInt32());
              break;
            }
          }
        }
      }


      // required int32 width = 1;
      public boolean hasWidth() {
        return result.hasWidth();
      }
      public int getWidth() {
        return result.getWidth();
      }
      public Builder setWidth(int value) {
        result.hasWidth = true;
        result.width_ = value;
        return this;
      }
      public Builder clearWidth() {
        result.hasWidth = false;
        result.width_ = 0;
        return this;
      }

      // required int32 height = 2;
      public boolean hasHeight() {
        return result.hasHeight();
      }
      public int getHeight() {
        return result.getHeight();
      }
      public Builder setHeight(int value) {
        result.hasHeight = true;
        result.height_ = value;
        return this;
      }
      public Builder clearHeight() {
        result.hasHeight = false;
        result.height_ = 0;
        return this;
      }

      // @@protoc_insertion_point(builder_scope:attachment.ImageMetadata)
    }

    static {
      defaultInstance = new ImageMetadata(true);
      org.waveprotocol.box.attachment.AttachmentProto.internalForceInit();
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:attachment.ImageMetadata)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_attachment_AttachmentsResponse_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_attachment_AttachmentsResponse_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_attachment_AttachmentMetadata_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_attachment_AttachmentMetadata_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_attachment_ImageMetadata_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_attachment_ImageMetadata_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n0org/waveprotocol/box/attachment/attach" +
      "ment.proto\022\nattachment\"I\n\023AttachmentsRes" +
      "ponse\0222\n\nattachment\030\001 \003(\0132\036.attachment.A" +
      "ttachmentMetadata\"\244\002\n\022AttachmentMetadata" +
      "\022\024\n\014attachmentId\030\001 \002(\t\022\017\n\007waveRef\030\002 \002(\t\022" +
      "\020\n\010fileName\030\003 \002(\t\022\020\n\010mimeType\030\004 \002(\t\022\014\n\004s" +
      "ize\030\005 \002(\003\022\017\n\007creator\030\006 \002(\t\022\025\n\rattachment" +
      "Url\030\007 \002(\t\022\024\n\014thumbnailUrl\030\010 \002(\t\0220\n\rimage" +
      "Metadata\030\t \001(\0132\031.attachment.ImageMetadat" +
      "a\0224\n\021thumbnailMetadata\030\n \001(\0132\031.attachmen",
      "t.ImageMetadata\022\017\n\007malware\030\013 \001(\010\".\n\rImag" +
      "eMetadata\022\r\n\005width\030\001 \002(\005\022\016\n\006height\030\002 \002(\005" +
      "B2\n\037org.waveprotocol.box.attachmentB\017Att" +
      "achmentProto"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_attachment_AttachmentsResponse_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_attachment_AttachmentsResponse_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_attachment_AttachmentsResponse_descriptor,
              new java.lang.String[] { "Attachment", },
              org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.class,
              org.waveprotocol.box.attachment.AttachmentProto.AttachmentsResponse.Builder.class);
          internal_static_attachment_AttachmentMetadata_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_attachment_AttachmentMetadata_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_attachment_AttachmentMetadata_descriptor,
              new java.lang.String[] { "AttachmentId", "WaveRef", "FileName", "MimeType", "Size", "Creator", "AttachmentUrl", "ThumbnailUrl", "ImageMetadata", "ThumbnailMetadata", "Malware", },
              org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.class,
              org.waveprotocol.box.attachment.AttachmentProto.AttachmentMetadata.Builder.class);
          internal_static_attachment_ImageMetadata_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_attachment_ImageMetadata_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_attachment_ImageMetadata_descriptor,
              new java.lang.String[] { "Width", "Height", },
              org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.class,
              org.waveprotocol.box.attachment.AttachmentProto.ImageMetadata.Builder.class);
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }

  public static void internalForceInit() {}

  // @@protoc_insertion_point(outer_class_scope)
}
