/*
 * Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://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!
// NO CHECKED-IN PROTOBUF GENCODE
// source: google/apps/card/v1/card.proto
// Protobuf Java Version: 4.33.2

package com.google.apps.card.v1;

/**
 *
 *
 * <pre>
 * Represents an image.
 *
 * [Google Workspace add-ons and Chat
 * apps](https://developers.google.com/workspace/extend):
 * </pre>
 *
 * Protobuf type {@code google.apps.card.v1.ImageComponent}
 */
@com.google.protobuf.Generated
public final class ImageComponent extends com.google.protobuf.GeneratedMessage
    implements
    // @@protoc_insertion_point(message_implements:google.apps.card.v1.ImageComponent)
    ImageComponentOrBuilder {
  private static final long serialVersionUID = 0L;

  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 33,
        /* patch= */ 2,
        /* suffix= */ "",
        "ImageComponent");
  }

  // Use ImageComponent.newBuilder() to construct.
  private ImageComponent(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }

  private ImageComponent() {
    imageUri_ = "";
    altText_ = "";
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.apps.card.v1.CardProto
        .internal_static_google_apps_card_v1_ImageComponent_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.apps.card.v1.CardProto
        .internal_static_google_apps_card_v1_ImageComponent_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.apps.card.v1.ImageComponent.class,
            com.google.apps.card.v1.ImageComponent.Builder.class);
  }

  private int bitField0_;
  public static final int IMAGE_URI_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object imageUri_ = "";

  /**
   *
   *
   * <pre>
   * The image URL.
   * </pre>
   *
   * <code>string image_uri = 1;</code>
   *
   * @return The imageUri.
   */
  @java.lang.Override
  public java.lang.String getImageUri() {
    java.lang.Object ref = imageUri_;
    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();
      imageUri_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * The image URL.
   * </pre>
   *
   * <code>string image_uri = 1;</code>
   *
   * @return The bytes for imageUri.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getImageUriBytes() {
    java.lang.Object ref = imageUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      imageUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ALT_TEXT_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object altText_ = "";

  /**
   *
   *
   * <pre>
   * The accessibility label for the image.
   * </pre>
   *
   * <code>string alt_text = 2;</code>
   *
   * @return The altText.
   */
  @java.lang.Override
  public java.lang.String getAltText() {
    java.lang.Object ref = altText_;
    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();
      altText_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * The accessibility label for the image.
   * </pre>
   *
   * <code>string alt_text = 2;</code>
   *
   * @return The bytes for altText.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAltTextBytes() {
    java.lang.Object ref = altText_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      altText_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CROP_STYLE_FIELD_NUMBER = 3;
  private com.google.apps.card.v1.ImageCropStyle cropStyle_;

  /**
   *
   *
   * <pre>
   * The crop style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
   *
   * @return Whether the cropStyle field is set.
   */
  @java.lang.Override
  public boolean hasCropStyle() {
    return ((bitField0_ & 0x00000001) != 0);
  }

  /**
   *
   *
   * <pre>
   * The crop style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
   *
   * @return The cropStyle.
   */
  @java.lang.Override
  public com.google.apps.card.v1.ImageCropStyle getCropStyle() {
    return cropStyle_ == null
        ? com.google.apps.card.v1.ImageCropStyle.getDefaultInstance()
        : cropStyle_;
  }

  /**
   *
   *
   * <pre>
   * The crop style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
   */
  @java.lang.Override
  public com.google.apps.card.v1.ImageCropStyleOrBuilder getCropStyleOrBuilder() {
    return cropStyle_ == null
        ? com.google.apps.card.v1.ImageCropStyle.getDefaultInstance()
        : cropStyle_;
  }

  public static final int BORDER_STYLE_FIELD_NUMBER = 4;
  private com.google.apps.card.v1.BorderStyle borderStyle_;

  /**
   *
   *
   * <pre>
   * The border style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
   *
   * @return Whether the borderStyle field is set.
   */
  @java.lang.Override
  public boolean hasBorderStyle() {
    return ((bitField0_ & 0x00000002) != 0);
  }

  /**
   *
   *
   * <pre>
   * The border style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
   *
   * @return The borderStyle.
   */
  @java.lang.Override
  public com.google.apps.card.v1.BorderStyle getBorderStyle() {
    return borderStyle_ == null
        ? com.google.apps.card.v1.BorderStyle.getDefaultInstance()
        : borderStyle_;
  }

  /**
   *
   *
   * <pre>
   * The border style to apply to the image.
   * </pre>
   *
   * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
   */
  @java.lang.Override
  public com.google.apps.card.v1.BorderStyleOrBuilder getBorderStyleOrBuilder() {
    return borderStyle_ == null
        ? com.google.apps.card.v1.BorderStyle.getDefaultInstance()
        : borderStyle_;
  }

  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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(imageUri_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 1, imageUri_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(altText_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 2, altText_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(3, getCropStyle());
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      output.writeMessage(4, getBorderStyle());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(imageUri_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, imageUri_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(altText_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, altText_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCropStyle());
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBorderStyle());
    }
    size += getUnknownFields().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.apps.card.v1.ImageComponent)) {
      return super.equals(obj);
    }
    com.google.apps.card.v1.ImageComponent other = (com.google.apps.card.v1.ImageComponent) obj;

    if (!getImageUri().equals(other.getImageUri())) return false;
    if (!getAltText().equals(other.getAltText())) return false;
    if (hasCropStyle() != other.hasCropStyle()) return false;
    if (hasCropStyle()) {
      if (!getCropStyle().equals(other.getCropStyle())) return false;
    }
    if (hasBorderStyle() != other.hasBorderStyle()) return false;
    if (hasBorderStyle()) {
      if (!getBorderStyle().equals(other.getBorderStyle())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + IMAGE_URI_FIELD_NUMBER;
    hash = (53 * hash) + getImageUri().hashCode();
    hash = (37 * hash) + ALT_TEXT_FIELD_NUMBER;
    hash = (53 * hash) + getAltText().hashCode();
    if (hasCropStyle()) {
      hash = (37 * hash) + CROP_STYLE_FIELD_NUMBER;
      hash = (53 * hash) + getCropStyle().hashCode();
    }
    if (hasBorderStyle()) {
      hash = (37 * hash) + BORDER_STYLE_FIELD_NUMBER;
      hash = (53 * hash) + getBorderStyle().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.apps.card.v1.ImageComponent 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.apps.card.v1.ImageComponent parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.apps.card.v1.ImageComponent parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.apps.card.v1.ImageComponent parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.apps.card.v1.ImageComponent parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.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.apps.card.v1.ImageComponent 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.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }

  /**
   *
   *
   * <pre>
   * Represents an image.
   *
   * [Google Workspace add-ons and Chat
   * apps](https://developers.google.com/workspace/extend):
   * </pre>
   *
   * Protobuf type {@code google.apps.card.v1.ImageComponent}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.apps.card.v1.ImageComponent)
      com.google.apps.card.v1.ImageComponentOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.apps.card.v1.CardProto
          .internal_static_google_apps_card_v1_ImageComponent_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.apps.card.v1.CardProto
          .internal_static_google_apps_card_v1_ImageComponent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.apps.card.v1.ImageComponent.class,
              com.google.apps.card.v1.ImageComponent.Builder.class);
    }

    // Construct using com.google.apps.card.v1.ImageComponent.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        internalGetCropStyleFieldBuilder();
        internalGetBorderStyleFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      imageUri_ = "";
      altText_ = "";
      cropStyle_ = null;
      if (cropStyleBuilder_ != null) {
        cropStyleBuilder_.dispose();
        cropStyleBuilder_ = null;
      }
      borderStyle_ = null;
      if (borderStyleBuilder_ != null) {
        borderStyleBuilder_.dispose();
        borderStyleBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.apps.card.v1.CardProto
          .internal_static_google_apps_card_v1_ImageComponent_descriptor;
    }

    @java.lang.Override
    public com.google.apps.card.v1.ImageComponent getDefaultInstanceForType() {
      return com.google.apps.card.v1.ImageComponent.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.apps.card.v1.ImageComponent build() {
      com.google.apps.card.v1.ImageComponent result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.apps.card.v1.ImageComponent buildPartial() {
      com.google.apps.card.v1.ImageComponent result =
          new com.google.apps.card.v1.ImageComponent(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.apps.card.v1.ImageComponent result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.imageUri_ = imageUri_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.altText_ = altText_;
      }
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.cropStyle_ = cropStyleBuilder_ == null ? cropStyle_ : cropStyleBuilder_.build();
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.borderStyle_ =
            borderStyleBuilder_ == null ? borderStyle_ : borderStyleBuilder_.build();
        to_bitField0_ |= 0x00000002;
      }
      result.bitField0_ |= to_bitField0_;
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.apps.card.v1.ImageComponent) {
        return mergeFrom((com.google.apps.card.v1.ImageComponent) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.apps.card.v1.ImageComponent other) {
      if (other == com.google.apps.card.v1.ImageComponent.getDefaultInstance()) return this;
      if (!other.getImageUri().isEmpty()) {
        imageUri_ = other.imageUri_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getAltText().isEmpty()) {
        altText_ = other.altText_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.hasCropStyle()) {
        mergeCropStyle(other.getCropStyle());
      }
      if (other.hasBorderStyle()) {
        mergeBorderStyle(other.getBorderStyle());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      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 {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                imageUri_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                altText_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(
                    internalGetCropStyleFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(
                    internalGetBorderStyleFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object imageUri_ = "";

    /**
     *
     *
     * <pre>
     * The image URL.
     * </pre>
     *
     * <code>string image_uri = 1;</code>
     *
     * @return The imageUri.
     */
    public java.lang.String getImageUri() {
      java.lang.Object ref = imageUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        imageUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * The image URL.
     * </pre>
     *
     * <code>string image_uri = 1;</code>
     *
     * @return The bytes for imageUri.
     */
    public com.google.protobuf.ByteString getImageUriBytes() {
      java.lang.Object ref = imageUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        imageUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * The image URL.
     * </pre>
     *
     * <code>string image_uri = 1;</code>
     *
     * @param value The imageUri to set.
     * @return This builder for chaining.
     */
    public Builder setImageUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      imageUri_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The image URL.
     * </pre>
     *
     * <code>string image_uri = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearImageUri() {
      imageUri_ = getDefaultInstance().getImageUri();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The image URL.
     * </pre>
     *
     * <code>string image_uri = 1;</code>
     *
     * @param value The bytes for imageUri to set.
     * @return This builder for chaining.
     */
    public Builder setImageUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      imageUri_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object altText_ = "";

    /**
     *
     *
     * <pre>
     * The accessibility label for the image.
     * </pre>
     *
     * <code>string alt_text = 2;</code>
     *
     * @return The altText.
     */
    public java.lang.String getAltText() {
      java.lang.Object ref = altText_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        altText_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * The accessibility label for the image.
     * </pre>
     *
     * <code>string alt_text = 2;</code>
     *
     * @return The bytes for altText.
     */
    public com.google.protobuf.ByteString getAltTextBytes() {
      java.lang.Object ref = altText_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        altText_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * The accessibility label for the image.
     * </pre>
     *
     * <code>string alt_text = 2;</code>
     *
     * @param value The altText to set.
     * @return This builder for chaining.
     */
    public Builder setAltText(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      altText_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The accessibility label for the image.
     * </pre>
     *
     * <code>string alt_text = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAltText() {
      altText_ = getDefaultInstance().getAltText();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The accessibility label for the image.
     * </pre>
     *
     * <code>string alt_text = 2;</code>
     *
     * @param value The bytes for altText to set.
     * @return This builder for chaining.
     */
    public Builder setAltTextBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      altText_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.apps.card.v1.ImageCropStyle cropStyle_;
    private com.google.protobuf.SingleFieldBuilder<
            com.google.apps.card.v1.ImageCropStyle,
            com.google.apps.card.v1.ImageCropStyle.Builder,
            com.google.apps.card.v1.ImageCropStyleOrBuilder>
        cropStyleBuilder_;

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     *
     * @return Whether the cropStyle field is set.
     */
    public boolean hasCropStyle() {
      return ((bitField0_ & 0x00000004) != 0);
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     *
     * @return The cropStyle.
     */
    public com.google.apps.card.v1.ImageCropStyle getCropStyle() {
      if (cropStyleBuilder_ == null) {
        return cropStyle_ == null
            ? com.google.apps.card.v1.ImageCropStyle.getDefaultInstance()
            : cropStyle_;
      } else {
        return cropStyleBuilder_.getMessage();
      }
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public Builder setCropStyle(com.google.apps.card.v1.ImageCropStyle value) {
      if (cropStyleBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cropStyle_ = value;
      } else {
        cropStyleBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public Builder setCropStyle(com.google.apps.card.v1.ImageCropStyle.Builder builderForValue) {
      if (cropStyleBuilder_ == null) {
        cropStyle_ = builderForValue.build();
      } else {
        cropStyleBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public Builder mergeCropStyle(com.google.apps.card.v1.ImageCropStyle value) {
      if (cropStyleBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && cropStyle_ != null
            && cropStyle_ != com.google.apps.card.v1.ImageCropStyle.getDefaultInstance()) {
          getCropStyleBuilder().mergeFrom(value);
        } else {
          cropStyle_ = value;
        }
      } else {
        cropStyleBuilder_.mergeFrom(value);
      }
      if (cropStyle_ != null) {
        bitField0_ |= 0x00000004;
        onChanged();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public Builder clearCropStyle() {
      bitField0_ = (bitField0_ & ~0x00000004);
      cropStyle_ = null;
      if (cropStyleBuilder_ != null) {
        cropStyleBuilder_.dispose();
        cropStyleBuilder_ = null;
      }
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public com.google.apps.card.v1.ImageCropStyle.Builder getCropStyleBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return internalGetCropStyleFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    public com.google.apps.card.v1.ImageCropStyleOrBuilder getCropStyleOrBuilder() {
      if (cropStyleBuilder_ != null) {
        return cropStyleBuilder_.getMessageOrBuilder();
      } else {
        return cropStyle_ == null
            ? com.google.apps.card.v1.ImageCropStyle.getDefaultInstance()
            : cropStyle_;
      }
    }

    /**
     *
     *
     * <pre>
     * The crop style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.ImageCropStyle crop_style = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.google.apps.card.v1.ImageCropStyle,
            com.google.apps.card.v1.ImageCropStyle.Builder,
            com.google.apps.card.v1.ImageCropStyleOrBuilder>
        internalGetCropStyleFieldBuilder() {
      if (cropStyleBuilder_ == null) {
        cropStyleBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.google.apps.card.v1.ImageCropStyle,
                com.google.apps.card.v1.ImageCropStyle.Builder,
                com.google.apps.card.v1.ImageCropStyleOrBuilder>(
                getCropStyle(), getParentForChildren(), isClean());
        cropStyle_ = null;
      }
      return cropStyleBuilder_;
    }

    private com.google.apps.card.v1.BorderStyle borderStyle_;
    private com.google.protobuf.SingleFieldBuilder<
            com.google.apps.card.v1.BorderStyle,
            com.google.apps.card.v1.BorderStyle.Builder,
            com.google.apps.card.v1.BorderStyleOrBuilder>
        borderStyleBuilder_;

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     *
     * @return Whether the borderStyle field is set.
     */
    public boolean hasBorderStyle() {
      return ((bitField0_ & 0x00000008) != 0);
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     *
     * @return The borderStyle.
     */
    public com.google.apps.card.v1.BorderStyle getBorderStyle() {
      if (borderStyleBuilder_ == null) {
        return borderStyle_ == null
            ? com.google.apps.card.v1.BorderStyle.getDefaultInstance()
            : borderStyle_;
      } else {
        return borderStyleBuilder_.getMessage();
      }
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public Builder setBorderStyle(com.google.apps.card.v1.BorderStyle value) {
      if (borderStyleBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        borderStyle_ = value;
      } else {
        borderStyleBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public Builder setBorderStyle(com.google.apps.card.v1.BorderStyle.Builder builderForValue) {
      if (borderStyleBuilder_ == null) {
        borderStyle_ = builderForValue.build();
      } else {
        borderStyleBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public Builder mergeBorderStyle(com.google.apps.card.v1.BorderStyle value) {
      if (borderStyleBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && borderStyle_ != null
            && borderStyle_ != com.google.apps.card.v1.BorderStyle.getDefaultInstance()) {
          getBorderStyleBuilder().mergeFrom(value);
        } else {
          borderStyle_ = value;
        }
      } else {
        borderStyleBuilder_.mergeFrom(value);
      }
      if (borderStyle_ != null) {
        bitField0_ |= 0x00000008;
        onChanged();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public Builder clearBorderStyle() {
      bitField0_ = (bitField0_ & ~0x00000008);
      borderStyle_ = null;
      if (borderStyleBuilder_ != null) {
        borderStyleBuilder_.dispose();
        borderStyleBuilder_ = null;
      }
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public com.google.apps.card.v1.BorderStyle.Builder getBorderStyleBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return internalGetBorderStyleFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    public com.google.apps.card.v1.BorderStyleOrBuilder getBorderStyleOrBuilder() {
      if (borderStyleBuilder_ != null) {
        return borderStyleBuilder_.getMessageOrBuilder();
      } else {
        return borderStyle_ == null
            ? com.google.apps.card.v1.BorderStyle.getDefaultInstance()
            : borderStyle_;
      }
    }

    /**
     *
     *
     * <pre>
     * The border style to apply to the image.
     * </pre>
     *
     * <code>.google.apps.card.v1.BorderStyle border_style = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.google.apps.card.v1.BorderStyle,
            com.google.apps.card.v1.BorderStyle.Builder,
            com.google.apps.card.v1.BorderStyleOrBuilder>
        internalGetBorderStyleFieldBuilder() {
      if (borderStyleBuilder_ == null) {
        borderStyleBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.google.apps.card.v1.BorderStyle,
                com.google.apps.card.v1.BorderStyle.Builder,
                com.google.apps.card.v1.BorderStyleOrBuilder>(
                getBorderStyle(), getParentForChildren(), isClean());
        borderStyle_ = null;
      }
      return borderStyleBuilder_;
    }

    // @@protoc_insertion_point(builder_scope:google.apps.card.v1.ImageComponent)
  }

  // @@protoc_insertion_point(class_scope:google.apps.card.v1.ImageComponent)
  private static final com.google.apps.card.v1.ImageComponent DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.apps.card.v1.ImageComponent();
  }

  public static com.google.apps.card.v1.ImageComponent getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ImageComponent> PARSER =
      new com.google.protobuf.AbstractParser<ImageComponent>() {
        @java.lang.Override
        public ImageComponent parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.apps.card.v1.ImageComponent getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
