// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v9/common/ad_type_infos.proto

package com.google.ads.googleads.v9.common;

/**
 * <pre>
 * An image ad.
 * </pre>
 *
 * Protobuf type {@code google.ads.googleads.v9.common.ImageAdInfo}
 */
public final class ImageAdInfo extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.ads.googleads.v9.common.ImageAdInfo)
    ImageAdInfoOrBuilder {
private static final long serialVersionUID = 0L;
  // Use ImageAdInfo.newBuilder() to construct.
  private ImageAdInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private ImageAdInfo() {
    imageUrl_ = "";
    previewImageUrl_ = "";
    mimeType_ = 0;
    name_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new ImageAdInfo();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private ImageAdInfo(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 80: {
            int rawValue = input.readEnum();

            mimeType_ = rawValue;
            break;
          }
          case 98: {
            java.lang.String s = input.readStringRequireUtf8();
            imageCase_ = 12;
            image_ = s;
            break;
          }
          case 106: {
            imageCase_ = 13;
            image_ = input.readBytes();
            break;
          }
          case 112: {
            imageCase_ = 14;
            image_ = input.readInt64();
            break;
          }
          case 120: {
            bitField0_ |= 0x00000001;
            pixelWidth_ = input.readInt64();
            break;
          }
          case 128: {
            bitField0_ |= 0x00000002;
            pixelHeight_ = input.readInt64();
            break;
          }
          case 138: {
            java.lang.String s = input.readStringRequireUtf8();
            bitField0_ |= 0x00000004;
            imageUrl_ = s;
            break;
          }
          case 144: {
            bitField0_ |= 0x00000008;
            previewPixelWidth_ = input.readInt64();
            break;
          }
          case 152: {
            bitField0_ |= 0x00000010;
            previewPixelHeight_ = input.readInt64();
            break;
          }
          case 162: {
            java.lang.String s = input.readStringRequireUtf8();
            bitField0_ |= 0x00000020;
            previewImageUrl_ = s;
            break;
          }
          case 170: {
            java.lang.String s = input.readStringRequireUtf8();
            bitField0_ |= 0x00000040;
            name_ = s;
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.ads.googleads.v9.common.AdTypeInfosProto.internal_static_google_ads_googleads_v9_common_ImageAdInfo_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.ads.googleads.v9.common.AdTypeInfosProto.internal_static_google_ads_googleads_v9_common_ImageAdInfo_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.ads.googleads.v9.common.ImageAdInfo.class, com.google.ads.googleads.v9.common.ImageAdInfo.Builder.class);
  }

  private int bitField0_;
  private int imageCase_ = 0;
  private java.lang.Object image_;
  public enum ImageCase
      implements com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    MEDIA_FILE(12),
    DATA(13),
    AD_ID_TO_COPY_IMAGE_FROM(14),
    IMAGE_NOT_SET(0);
    private final int value;
    private ImageCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static ImageCase valueOf(int value) {
      return forNumber(value);
    }

    public static ImageCase forNumber(int value) {
      switch (value) {
        case 12: return MEDIA_FILE;
        case 13: return DATA;
        case 14: return AD_ID_TO_COPY_IMAGE_FROM;
        case 0: return IMAGE_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public ImageCase
  getImageCase() {
    return ImageCase.forNumber(
        imageCase_);
  }

  public static final int PIXEL_WIDTH_FIELD_NUMBER = 15;
  private long pixelWidth_;
  /**
   * <pre>
   * Width in pixels of the full size image.
   * </pre>
   *
   * <code>optional int64 pixel_width = 15;</code>
   * @return Whether the pixelWidth field is set.
   */
  @java.lang.Override
  public boolean hasPixelWidth() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * <pre>
   * Width in pixels of the full size image.
   * </pre>
   *
   * <code>optional int64 pixel_width = 15;</code>
   * @return The pixelWidth.
   */
  @java.lang.Override
  public long getPixelWidth() {
    return pixelWidth_;
  }

  public static final int PIXEL_HEIGHT_FIELD_NUMBER = 16;
  private long pixelHeight_;
  /**
   * <pre>
   * Height in pixels of the full size image.
   * </pre>
   *
   * <code>optional int64 pixel_height = 16;</code>
   * @return Whether the pixelHeight field is set.
   */
  @java.lang.Override
  public boolean hasPixelHeight() {
    return ((bitField0_ & 0x00000002) != 0);
  }
  /**
   * <pre>
   * Height in pixels of the full size image.
   * </pre>
   *
   * <code>optional int64 pixel_height = 16;</code>
   * @return The pixelHeight.
   */
  @java.lang.Override
  public long getPixelHeight() {
    return pixelHeight_;
  }

  public static final int IMAGE_URL_FIELD_NUMBER = 17;
  private volatile java.lang.Object imageUrl_;
  /**
   * <pre>
   * URL of the full size image.
   * </pre>
   *
   * <code>optional string image_url = 17;</code>
   * @return Whether the imageUrl field is set.
   */
  @java.lang.Override
  public boolean hasImageUrl() {
    return ((bitField0_ & 0x00000004) != 0);
  }
  /**
   * <pre>
   * URL of the full size image.
   * </pre>
   *
   * <code>optional string image_url = 17;</code>
   * @return The imageUrl.
   */
  @java.lang.Override
  public java.lang.String getImageUrl() {
    java.lang.Object ref = imageUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      imageUrl_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * URL of the full size image.
   * </pre>
   *
   * <code>optional string image_url = 17;</code>
   * @return The bytes for imageUrl.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getImageUrlBytes() {
    java.lang.Object ref = imageUrl_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      imageUrl_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PREVIEW_PIXEL_WIDTH_FIELD_NUMBER = 18;
  private long previewPixelWidth_;
  /**
   * <pre>
   * Width in pixels of the preview size image.
   * </pre>
   *
   * <code>optional int64 preview_pixel_width = 18;</code>
   * @return Whether the previewPixelWidth field is set.
   */
  @java.lang.Override
  public boolean hasPreviewPixelWidth() {
    return ((bitField0_ & 0x00000008) != 0);
  }
  /**
   * <pre>
   * Width in pixels of the preview size image.
   * </pre>
   *
   * <code>optional int64 preview_pixel_width = 18;</code>
   * @return The previewPixelWidth.
   */
  @java.lang.Override
  public long getPreviewPixelWidth() {
    return previewPixelWidth_;
  }

  public static final int PREVIEW_PIXEL_HEIGHT_FIELD_NUMBER = 19;
  private long previewPixelHeight_;
  /**
   * <pre>
   * Height in pixels of the preview size image.
   * </pre>
   *
   * <code>optional int64 preview_pixel_height = 19;</code>
   * @return Whether the previewPixelHeight field is set.
   */
  @java.lang.Override
  public boolean hasPreviewPixelHeight() {
    return ((bitField0_ & 0x00000010) != 0);
  }
  /**
   * <pre>
   * Height in pixels of the preview size image.
   * </pre>
   *
   * <code>optional int64 preview_pixel_height = 19;</code>
   * @return The previewPixelHeight.
   */
  @java.lang.Override
  public long getPreviewPixelHeight() {
    return previewPixelHeight_;
  }

  public static final int PREVIEW_IMAGE_URL_FIELD_NUMBER = 20;
  private volatile java.lang.Object previewImageUrl_;
  /**
   * <pre>
   * URL of the preview size image.
   * </pre>
   *
   * <code>optional string preview_image_url = 20;</code>
   * @return Whether the previewImageUrl field is set.
   */
  @java.lang.Override
  public boolean hasPreviewImageUrl() {
    return ((bitField0_ & 0x00000020) != 0);
  }
  /**
   * <pre>
   * URL of the preview size image.
   * </pre>
   *
   * <code>optional string preview_image_url = 20;</code>
   * @return The previewImageUrl.
   */
  @java.lang.Override
  public java.lang.String getPreviewImageUrl() {
    java.lang.Object ref = previewImageUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      previewImageUrl_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * URL of the preview size image.
   * </pre>
   *
   * <code>optional string preview_image_url = 20;</code>
   * @return The bytes for previewImageUrl.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getPreviewImageUrlBytes() {
    java.lang.Object ref = previewImageUrl_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      previewImageUrl_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MIME_TYPE_FIELD_NUMBER = 10;
  private int mimeType_;
  /**
   * <pre>
   * The mime type of the image.
   * </pre>
   *
   * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
   * @return The enum numeric value on the wire for mimeType.
   */
  @java.lang.Override public int getMimeTypeValue() {
    return mimeType_;
  }
  /**
   * <pre>
   * The mime type of the image.
   * </pre>
   *
   * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
   * @return The mimeType.
   */
  @java.lang.Override public com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType getMimeType() {
    @SuppressWarnings("deprecation")
    com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType result = com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.valueOf(mimeType_);
    return result == null ? com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.UNRECOGNIZED : result;
  }

  public static final int NAME_FIELD_NUMBER = 21;
  private volatile java.lang.Object name_;
  /**
   * <pre>
   * The name of the image. If the image was created from a MediaFile, this is
   * the MediaFile's name. If the image was created from bytes, this is empty.
   * </pre>
   *
   * <code>optional string name = 21;</code>
   * @return Whether the name field is set.
   */
  @java.lang.Override
  public boolean hasName() {
    return ((bitField0_ & 0x00000040) != 0);
  }
  /**
   * <pre>
   * The name of the image. If the image was created from a MediaFile, this is
   * the MediaFile's name. If the image was created from bytes, this is empty.
   * </pre>
   *
   * <code>optional string name = 21;</code>
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The name of the image. If the image was created from a MediaFile, this is
   * the MediaFile's name. If the image was created from bytes, this is empty.
   * </pre>
   *
   * <code>optional string name = 21;</code>
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MEDIA_FILE_FIELD_NUMBER = 12;
  /**
   * <pre>
   * The MediaFile resource to use for the image.
   * </pre>
   *
   * <code>string media_file = 12;</code>
   * @return Whether the mediaFile field is set.
   */
  public boolean hasMediaFile() {
    return imageCase_ == 12;
  }
  /**
   * <pre>
   * The MediaFile resource to use for the image.
   * </pre>
   *
   * <code>string media_file = 12;</code>
   * @return The mediaFile.
   */
  public java.lang.String getMediaFile() {
    java.lang.Object ref = "";
    if (imageCase_ == 12) {
      ref = image_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (imageCase_ == 12) {
        image_ = s;
      }
      return s;
    }
  }
  /**
   * <pre>
   * The MediaFile resource to use for the image.
   * </pre>
   *
   * <code>string media_file = 12;</code>
   * @return The bytes for mediaFile.
   */
  public com.google.protobuf.ByteString
      getMediaFileBytes() {
    java.lang.Object ref = "";
    if (imageCase_ == 12) {
      ref = image_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      if (imageCase_ == 12) {
        image_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DATA_FIELD_NUMBER = 13;
  /**
   * <pre>
   * Raw image data as bytes.
   * </pre>
   *
   * <code>bytes data = 13;</code>
   * @return Whether the data field is set.
   */
  @java.lang.Override
  public boolean hasData() {
    return imageCase_ == 13;
  }
  /**
   * <pre>
   * Raw image data as bytes.
   * </pre>
   *
   * <code>bytes data = 13;</code>
   * @return The data.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getData() {
    if (imageCase_ == 13) {
      return (com.google.protobuf.ByteString) image_;
    }
    return com.google.protobuf.ByteString.EMPTY;
  }

  public static final int AD_ID_TO_COPY_IMAGE_FROM_FIELD_NUMBER = 14;
  /**
   * <pre>
   * An ad ID to copy the image from.
   * </pre>
   *
   * <code>int64 ad_id_to_copy_image_from = 14;</code>
   * @return Whether the adIdToCopyImageFrom field is set.
   */
  @java.lang.Override
  public boolean hasAdIdToCopyImageFrom() {
    return imageCase_ == 14;
  }
  /**
   * <pre>
   * An ad ID to copy the image from.
   * </pre>
   *
   * <code>int64 ad_id_to_copy_image_from = 14;</code>
   * @return The adIdToCopyImageFrom.
   */
  @java.lang.Override
  public long getAdIdToCopyImageFrom() {
    if (imageCase_ == 14) {
      return (java.lang.Long) image_;
    }
    return 0L;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (mimeType_ != com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.UNSPECIFIED.getNumber()) {
      output.writeEnum(10, mimeType_);
    }
    if (imageCase_ == 12) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 12, image_);
    }
    if (imageCase_ == 13) {
      output.writeBytes(
          13, (com.google.protobuf.ByteString) image_);
    }
    if (imageCase_ == 14) {
      output.writeInt64(
          14, (long)((java.lang.Long) image_));
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeInt64(15, pixelWidth_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      output.writeInt64(16, pixelHeight_);
    }
    if (((bitField0_ & 0x00000004) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 17, imageUrl_);
    }
    if (((bitField0_ & 0x00000008) != 0)) {
      output.writeInt64(18, previewPixelWidth_);
    }
    if (((bitField0_ & 0x00000010) != 0)) {
      output.writeInt64(19, previewPixelHeight_);
    }
    if (((bitField0_ & 0x00000020) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 20, previewImageUrl_);
    }
    if (((bitField0_ & 0x00000040) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 21, name_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (mimeType_ != com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(10, mimeType_);
    }
    if (imageCase_ == 12) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, image_);
    }
    if (imageCase_ == 13) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(
            13, (com.google.protobuf.ByteString) image_);
    }
    if (imageCase_ == 14) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(
            14, (long)((java.lang.Long) image_));
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(15, pixelWidth_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(16, pixelHeight_);
    }
    if (((bitField0_ & 0x00000004) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, imageUrl_);
    }
    if (((bitField0_ & 0x00000008) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(18, previewPixelWidth_);
    }
    if (((bitField0_ & 0x00000010) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(19, previewPixelHeight_);
    }
    if (((bitField0_ & 0x00000020) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, previewImageUrl_);
    }
    if (((bitField0_ & 0x00000040) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, name_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.ads.googleads.v9.common.ImageAdInfo)) {
      return super.equals(obj);
    }
    com.google.ads.googleads.v9.common.ImageAdInfo other = (com.google.ads.googleads.v9.common.ImageAdInfo) obj;

    if (hasPixelWidth() != other.hasPixelWidth()) return false;
    if (hasPixelWidth()) {
      if (getPixelWidth()
          != other.getPixelWidth()) return false;
    }
    if (hasPixelHeight() != other.hasPixelHeight()) return false;
    if (hasPixelHeight()) {
      if (getPixelHeight()
          != other.getPixelHeight()) return false;
    }
    if (hasImageUrl() != other.hasImageUrl()) return false;
    if (hasImageUrl()) {
      if (!getImageUrl()
          .equals(other.getImageUrl())) return false;
    }
    if (hasPreviewPixelWidth() != other.hasPreviewPixelWidth()) return false;
    if (hasPreviewPixelWidth()) {
      if (getPreviewPixelWidth()
          != other.getPreviewPixelWidth()) return false;
    }
    if (hasPreviewPixelHeight() != other.hasPreviewPixelHeight()) return false;
    if (hasPreviewPixelHeight()) {
      if (getPreviewPixelHeight()
          != other.getPreviewPixelHeight()) return false;
    }
    if (hasPreviewImageUrl() != other.hasPreviewImageUrl()) return false;
    if (hasPreviewImageUrl()) {
      if (!getPreviewImageUrl()
          .equals(other.getPreviewImageUrl())) return false;
    }
    if (mimeType_ != other.mimeType_) return false;
    if (hasName() != other.hasName()) return false;
    if (hasName()) {
      if (!getName()
          .equals(other.getName())) return false;
    }
    if (!getImageCase().equals(other.getImageCase())) return false;
    switch (imageCase_) {
      case 12:
        if (!getMediaFile()
            .equals(other.getMediaFile())) return false;
        break;
      case 13:
        if (!getData()
            .equals(other.getData())) return false;
        break;
      case 14:
        if (getAdIdToCopyImageFrom()
            != other.getAdIdToCopyImageFrom()) return false;
        break;
      case 0:
      default:
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasPixelWidth()) {
      hash = (37 * hash) + PIXEL_WIDTH_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPixelWidth());
    }
    if (hasPixelHeight()) {
      hash = (37 * hash) + PIXEL_HEIGHT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPixelHeight());
    }
    if (hasImageUrl()) {
      hash = (37 * hash) + IMAGE_URL_FIELD_NUMBER;
      hash = (53 * hash) + getImageUrl().hashCode();
    }
    if (hasPreviewPixelWidth()) {
      hash = (37 * hash) + PREVIEW_PIXEL_WIDTH_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPreviewPixelWidth());
    }
    if (hasPreviewPixelHeight()) {
      hash = (37 * hash) + PREVIEW_PIXEL_HEIGHT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getPreviewPixelHeight());
    }
    if (hasPreviewImageUrl()) {
      hash = (37 * hash) + PREVIEW_IMAGE_URL_FIELD_NUMBER;
      hash = (53 * hash) + getPreviewImageUrl().hashCode();
    }
    hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + mimeType_;
    if (hasName()) {
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
    }
    switch (imageCase_) {
      case 12:
        hash = (37 * hash) + MEDIA_FILE_FIELD_NUMBER;
        hash = (53 * hash) + getMediaFile().hashCode();
        break;
      case 13:
        hash = (37 * hash) + DATA_FIELD_NUMBER;
        hash = (53 * hash) + getData().hashCode();
        break;
      case 14:
        hash = (37 * hash) + AD_ID_TO_COPY_IMAGE_FROM_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getAdIdToCopyImageFrom());
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.ads.googleads.v9.common.ImageAdInfo parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.ads.googleads.v9.common.ImageAdInfo prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * An image ad.
   * </pre>
   *
   * Protobuf type {@code google.ads.googleads.v9.common.ImageAdInfo}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.ads.googleads.v9.common.ImageAdInfo)
      com.google.ads.googleads.v9.common.ImageAdInfoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.ads.googleads.v9.common.AdTypeInfosProto.internal_static_google_ads_googleads_v9_common_ImageAdInfo_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.ads.googleads.v9.common.AdTypeInfosProto.internal_static_google_ads_googleads_v9_common_ImageAdInfo_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.ads.googleads.v9.common.ImageAdInfo.class, com.google.ads.googleads.v9.common.ImageAdInfo.Builder.class);
    }

    // Construct using com.google.ads.googleads.v9.common.ImageAdInfo.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      pixelWidth_ = 0L;
      bitField0_ = (bitField0_ & ~0x00000001);
      pixelHeight_ = 0L;
      bitField0_ = (bitField0_ & ~0x00000002);
      imageUrl_ = "";
      bitField0_ = (bitField0_ & ~0x00000004);
      previewPixelWidth_ = 0L;
      bitField0_ = (bitField0_ & ~0x00000008);
      previewPixelHeight_ = 0L;
      bitField0_ = (bitField0_ & ~0x00000010);
      previewImageUrl_ = "";
      bitField0_ = (bitField0_ & ~0x00000020);
      mimeType_ = 0;

      name_ = "";
      bitField0_ = (bitField0_ & ~0x00000040);
      imageCase_ = 0;
      image_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.ads.googleads.v9.common.AdTypeInfosProto.internal_static_google_ads_googleads_v9_common_ImageAdInfo_descriptor;
    }

    @java.lang.Override
    public com.google.ads.googleads.v9.common.ImageAdInfo getDefaultInstanceForType() {
      return com.google.ads.googleads.v9.common.ImageAdInfo.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.ads.googleads.v9.common.ImageAdInfo build() {
      com.google.ads.googleads.v9.common.ImageAdInfo result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.ads.googleads.v9.common.ImageAdInfo buildPartial() {
      com.google.ads.googleads.v9.common.ImageAdInfo result = new com.google.ads.googleads.v9.common.ImageAdInfo(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.pixelWidth_ = pixelWidth_;
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.pixelHeight_ = pixelHeight_;
        to_bitField0_ |= 0x00000002;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        to_bitField0_ |= 0x00000004;
      }
      result.imageUrl_ = imageUrl_;
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.previewPixelWidth_ = previewPixelWidth_;
        to_bitField0_ |= 0x00000008;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.previewPixelHeight_ = previewPixelHeight_;
        to_bitField0_ |= 0x00000010;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        to_bitField0_ |= 0x00000020;
      }
      result.previewImageUrl_ = previewImageUrl_;
      result.mimeType_ = mimeType_;
      if (((from_bitField0_ & 0x00000040) != 0)) {
        to_bitField0_ |= 0x00000040;
      }
      result.name_ = name_;
      if (imageCase_ == 12) {
        result.image_ = image_;
      }
      if (imageCase_ == 13) {
        result.image_ = image_;
      }
      if (imageCase_ == 14) {
        result.image_ = image_;
      }
      result.bitField0_ = to_bitField0_;
      result.imageCase_ = imageCase_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.ads.googleads.v9.common.ImageAdInfo) {
        return mergeFrom((com.google.ads.googleads.v9.common.ImageAdInfo)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.ads.googleads.v9.common.ImageAdInfo other) {
      if (other == com.google.ads.googleads.v9.common.ImageAdInfo.getDefaultInstance()) return this;
      if (other.hasPixelWidth()) {
        setPixelWidth(other.getPixelWidth());
      }
      if (other.hasPixelHeight()) {
        setPixelHeight(other.getPixelHeight());
      }
      if (other.hasImageUrl()) {
        bitField0_ |= 0x00000004;
        imageUrl_ = other.imageUrl_;
        onChanged();
      }
      if (other.hasPreviewPixelWidth()) {
        setPreviewPixelWidth(other.getPreviewPixelWidth());
      }
      if (other.hasPreviewPixelHeight()) {
        setPreviewPixelHeight(other.getPreviewPixelHeight());
      }
      if (other.hasPreviewImageUrl()) {
        bitField0_ |= 0x00000020;
        previewImageUrl_ = other.previewImageUrl_;
        onChanged();
      }
      if (other.mimeType_ != 0) {
        setMimeTypeValue(other.getMimeTypeValue());
      }
      if (other.hasName()) {
        bitField0_ |= 0x00000040;
        name_ = other.name_;
        onChanged();
      }
      switch (other.getImageCase()) {
        case MEDIA_FILE: {
          imageCase_ = 12;
          image_ = other.image_;
          onChanged();
          break;
        }
        case DATA: {
          setData(other.getData());
          break;
        }
        case AD_ID_TO_COPY_IMAGE_FROM: {
          setAdIdToCopyImageFrom(other.getAdIdToCopyImageFrom());
          break;
        }
        case IMAGE_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.ads.googleads.v9.common.ImageAdInfo parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.ads.googleads.v9.common.ImageAdInfo) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int imageCase_ = 0;
    private java.lang.Object image_;
    public ImageCase
        getImageCase() {
      return ImageCase.forNumber(
          imageCase_);
    }

    public Builder clearImage() {
      imageCase_ = 0;
      image_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private long pixelWidth_ ;
    /**
     * <pre>
     * Width in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_width = 15;</code>
     * @return Whether the pixelWidth field is set.
     */
    @java.lang.Override
    public boolean hasPixelWidth() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     * <pre>
     * Width in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_width = 15;</code>
     * @return The pixelWidth.
     */
    @java.lang.Override
    public long getPixelWidth() {
      return pixelWidth_;
    }
    /**
     * <pre>
     * Width in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_width = 15;</code>
     * @param value The pixelWidth to set.
     * @return This builder for chaining.
     */
    public Builder setPixelWidth(long value) {
      bitField0_ |= 0x00000001;
      pixelWidth_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Width in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_width = 15;</code>
     * @return This builder for chaining.
     */
    public Builder clearPixelWidth() {
      bitField0_ = (bitField0_ & ~0x00000001);
      pixelWidth_ = 0L;
      onChanged();
      return this;
    }

    private long pixelHeight_ ;
    /**
     * <pre>
     * Height in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_height = 16;</code>
     * @return Whether the pixelHeight field is set.
     */
    @java.lang.Override
    public boolean hasPixelHeight() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     * <pre>
     * Height in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_height = 16;</code>
     * @return The pixelHeight.
     */
    @java.lang.Override
    public long getPixelHeight() {
      return pixelHeight_;
    }
    /**
     * <pre>
     * Height in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_height = 16;</code>
     * @param value The pixelHeight to set.
     * @return This builder for chaining.
     */
    public Builder setPixelHeight(long value) {
      bitField0_ |= 0x00000002;
      pixelHeight_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Height in pixels of the full size image.
     * </pre>
     *
     * <code>optional int64 pixel_height = 16;</code>
     * @return This builder for chaining.
     */
    public Builder clearPixelHeight() {
      bitField0_ = (bitField0_ & ~0x00000002);
      pixelHeight_ = 0L;
      onChanged();
      return this;
    }

    private java.lang.Object imageUrl_ = "";
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @return Whether the imageUrl field is set.
     */
    public boolean hasImageUrl() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @return The imageUrl.
     */
    public java.lang.String getImageUrl() {
      java.lang.Object ref = imageUrl_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        imageUrl_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @return The bytes for imageUrl.
     */
    public com.google.protobuf.ByteString
        getImageUrlBytes() {
      java.lang.Object ref = imageUrl_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        imageUrl_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @param value The imageUrl to set.
     * @return This builder for chaining.
     */
    public Builder setImageUrl(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
      imageUrl_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @return This builder for chaining.
     */
    public Builder clearImageUrl() {
      bitField0_ = (bitField0_ & ~0x00000004);
      imageUrl_ = getDefaultInstance().getImageUrl();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the full size image.
     * </pre>
     *
     * <code>optional string image_url = 17;</code>
     * @param value The bytes for imageUrl to set.
     * @return This builder for chaining.
     */
    public Builder setImageUrlBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000004;
      imageUrl_ = value;
      onChanged();
      return this;
    }

    private long previewPixelWidth_ ;
    /**
     * <pre>
     * Width in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_width = 18;</code>
     * @return Whether the previewPixelWidth field is set.
     */
    @java.lang.Override
    public boolean hasPreviewPixelWidth() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     * <pre>
     * Width in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_width = 18;</code>
     * @return The previewPixelWidth.
     */
    @java.lang.Override
    public long getPreviewPixelWidth() {
      return previewPixelWidth_;
    }
    /**
     * <pre>
     * Width in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_width = 18;</code>
     * @param value The previewPixelWidth to set.
     * @return This builder for chaining.
     */
    public Builder setPreviewPixelWidth(long value) {
      bitField0_ |= 0x00000008;
      previewPixelWidth_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Width in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_width = 18;</code>
     * @return This builder for chaining.
     */
    public Builder clearPreviewPixelWidth() {
      bitField0_ = (bitField0_ & ~0x00000008);
      previewPixelWidth_ = 0L;
      onChanged();
      return this;
    }

    private long previewPixelHeight_ ;
    /**
     * <pre>
     * Height in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_height = 19;</code>
     * @return Whether the previewPixelHeight field is set.
     */
    @java.lang.Override
    public boolean hasPreviewPixelHeight() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     * <pre>
     * Height in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_height = 19;</code>
     * @return The previewPixelHeight.
     */
    @java.lang.Override
    public long getPreviewPixelHeight() {
      return previewPixelHeight_;
    }
    /**
     * <pre>
     * Height in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_height = 19;</code>
     * @param value The previewPixelHeight to set.
     * @return This builder for chaining.
     */
    public Builder setPreviewPixelHeight(long value) {
      bitField0_ |= 0x00000010;
      previewPixelHeight_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Height in pixels of the preview size image.
     * </pre>
     *
     * <code>optional int64 preview_pixel_height = 19;</code>
     * @return This builder for chaining.
     */
    public Builder clearPreviewPixelHeight() {
      bitField0_ = (bitField0_ & ~0x00000010);
      previewPixelHeight_ = 0L;
      onChanged();
      return this;
    }

    private java.lang.Object previewImageUrl_ = "";
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @return Whether the previewImageUrl field is set.
     */
    public boolean hasPreviewImageUrl() {
      return ((bitField0_ & 0x00000020) != 0);
    }
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @return The previewImageUrl.
     */
    public java.lang.String getPreviewImageUrl() {
      java.lang.Object ref = previewImageUrl_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        previewImageUrl_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @return The bytes for previewImageUrl.
     */
    public com.google.protobuf.ByteString
        getPreviewImageUrlBytes() {
      java.lang.Object ref = previewImageUrl_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        previewImageUrl_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @param value The previewImageUrl to set.
     * @return This builder for chaining.
     */
    public Builder setPreviewImageUrl(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000020;
      previewImageUrl_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @return This builder for chaining.
     */
    public Builder clearPreviewImageUrl() {
      bitField0_ = (bitField0_ & ~0x00000020);
      previewImageUrl_ = getDefaultInstance().getPreviewImageUrl();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the preview size image.
     * </pre>
     *
     * <code>optional string preview_image_url = 20;</code>
     * @param value The bytes for previewImageUrl to set.
     * @return This builder for chaining.
     */
    public Builder setPreviewImageUrlBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000020;
      previewImageUrl_ = value;
      onChanged();
      return this;
    }

    private int mimeType_ = 0;
    /**
     * <pre>
     * The mime type of the image.
     * </pre>
     *
     * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
     * @return The enum numeric value on the wire for mimeType.
     */
    @java.lang.Override public int getMimeTypeValue() {
      return mimeType_;
    }
    /**
     * <pre>
     * The mime type of the image.
     * </pre>
     *
     * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
     * @param value The enum numeric value on the wire for mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeTypeValue(int value) {
      
      mimeType_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The mime type of the image.
     * </pre>
     *
     * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
     * @return The mimeType.
     */
    @java.lang.Override
    public com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType getMimeType() {
      @SuppressWarnings("deprecation")
      com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType result = com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.valueOf(mimeType_);
      return result == null ? com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * The mime type of the image.
     * </pre>
     *
     * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
     * @param value The mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeType(com.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      mimeType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The mime type of the image.
     * </pre>
     *
     * <code>.google.ads.googleads.v9.enums.MimeTypeEnum.MimeType mime_type = 10;</code>
     * @return This builder for chaining.
     */
    public Builder clearMimeType() {
      
      mimeType_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @return Whether the name field is set.
     */
    public boolean hasName() {
      return ((bitField0_ & 0x00000040) != 0);
    }
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
      name_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @return This builder for chaining.
     */
    public Builder clearName() {
      bitField0_ = (bitField0_ & ~0x00000040);
      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the image. If the image was created from a MediaFile, this is
     * the MediaFile's name. If the image was created from bytes, this is empty.
     * </pre>
     *
     * <code>optional string name = 21;</code>
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000040;
      name_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @return Whether the mediaFile field is set.
     */
    @java.lang.Override
    public boolean hasMediaFile() {
      return imageCase_ == 12;
    }
    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @return The mediaFile.
     */
    @java.lang.Override
    public java.lang.String getMediaFile() {
      java.lang.Object ref = "";
      if (imageCase_ == 12) {
        ref = image_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (imageCase_ == 12) {
          image_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @return The bytes for mediaFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getMediaFileBytes() {
      java.lang.Object ref = "";
      if (imageCase_ == 12) {
        ref = image_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        if (imageCase_ == 12) {
          image_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @param value The mediaFile to set.
     * @return This builder for chaining.
     */
    public Builder setMediaFile(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  imageCase_ = 12;
      image_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @return This builder for chaining.
     */
    public Builder clearMediaFile() {
      if (imageCase_ == 12) {
        imageCase_ = 0;
        image_ = null;
        onChanged();
      }
      return this;
    }
    /**
     * <pre>
     * The MediaFile resource to use for the image.
     * </pre>
     *
     * <code>string media_file = 12;</code>
     * @param value The bytes for mediaFile to set.
     * @return This builder for chaining.
     */
    public Builder setMediaFileBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      imageCase_ = 12;
      image_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * Raw image data as bytes.
     * </pre>
     *
     * <code>bytes data = 13;</code>
     * @return Whether the data field is set.
     */
    public boolean hasData() {
      return imageCase_ == 13;
    }
    /**
     * <pre>
     * Raw image data as bytes.
     * </pre>
     *
     * <code>bytes data = 13;</code>
     * @return The data.
     */
    public com.google.protobuf.ByteString getData() {
      if (imageCase_ == 13) {
        return (com.google.protobuf.ByteString) image_;
      }
      return com.google.protobuf.ByteString.EMPTY;
    }
    /**
     * <pre>
     * Raw image data as bytes.
     * </pre>
     *
     * <code>bytes data = 13;</code>
     * @param value The data to set.
     * @return This builder for chaining.
     */
    public Builder setData(com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  imageCase_ = 13;
      image_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Raw image data as bytes.
     * </pre>
     *
     * <code>bytes data = 13;</code>
     * @return This builder for chaining.
     */
    public Builder clearData() {
      if (imageCase_ == 13) {
        imageCase_ = 0;
        image_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * An ad ID to copy the image from.
     * </pre>
     *
     * <code>int64 ad_id_to_copy_image_from = 14;</code>
     * @return Whether the adIdToCopyImageFrom field is set.
     */
    public boolean hasAdIdToCopyImageFrom() {
      return imageCase_ == 14;
    }
    /**
     * <pre>
     * An ad ID to copy the image from.
     * </pre>
     *
     * <code>int64 ad_id_to_copy_image_from = 14;</code>
     * @return The adIdToCopyImageFrom.
     */
    public long getAdIdToCopyImageFrom() {
      if (imageCase_ == 14) {
        return (java.lang.Long) image_;
      }
      return 0L;
    }
    /**
     * <pre>
     * An ad ID to copy the image from.
     * </pre>
     *
     * <code>int64 ad_id_to_copy_image_from = 14;</code>
     * @param value The adIdToCopyImageFrom to set.
     * @return This builder for chaining.
     */
    public Builder setAdIdToCopyImageFrom(long value) {
      imageCase_ = 14;
      image_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * An ad ID to copy the image from.
     * </pre>
     *
     * <code>int64 ad_id_to_copy_image_from = 14;</code>
     * @return This builder for chaining.
     */
    public Builder clearAdIdToCopyImageFrom() {
      if (imageCase_ == 14) {
        imageCase_ = 0;
        image_ = null;
        onChanged();
      }
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:google.ads.googleads.v9.common.ImageAdInfo)
  }

  // @@protoc_insertion_point(class_scope:google.ads.googleads.v9.common.ImageAdInfo)
  private static final com.google.ads.googleads.v9.common.ImageAdInfo DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.ads.googleads.v9.common.ImageAdInfo();
  }

  public static com.google.ads.googleads.v9.common.ImageAdInfo getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ImageAdInfo>
      PARSER = new com.google.protobuf.AbstractParser<ImageAdInfo>() {
    @java.lang.Override
    public ImageAdInfo parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new ImageAdInfo(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<ImageAdInfo> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ImageAdInfo> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.ads.googleads.v9.common.ImageAdInfo getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

