/*
 * Copyright 2020 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!
// source: google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto

package com.google.cloud.bigquery.dataexchange.v1beta1;

/**
 *
 *
 * <pre>
 * A data exchange is a container that lets you share data. Along with the
 * descriptive information about the data exchange, it contains listings that
 * reference shared datasets.
 * </pre>
 *
 * Protobuf type {@code google.cloud.bigquery.dataexchange.v1beta1.DataExchange}
 */
public final class DataExchange extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.bigquery.dataexchange.v1beta1.DataExchange)
    DataExchangeOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DataExchange.newBuilder() to construct.
  private DataExchange(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DataExchange() {
    name_ = "";
    displayName_ = "";
    description_ = "";
    primaryContact_ = "";
    documentation_ = "";
    icon_ = com.google.protobuf.ByteString.EMPTY;
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeProto
        .internal_static_google_cloud_bigquery_dataexchange_v1beta1_DataExchange_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeProto
        .internal_static_google_cloud_bigquery_dataexchange_v1beta1_DataExchange_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.class,
            com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.Builder.class);
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The resource name of the data exchange.
   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
   * Output only. The resource name of the data exchange.
   * e.g. `projects/myproject/locations/US/dataExchanges/123`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 DISPLAY_NAME_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object displayName_ = "";
  /**
   *
   *
   * <pre>
   * Required. Human-readable display name of the data exchange. The display name must
   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
   * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
   * Default value is an empty string.
   * Max length: 63 bytes.
   * </pre>
   *
   * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The displayName.
   */
  @java.lang.Override
  public java.lang.String getDisplayName() {
    java.lang.Object ref = displayName_;
    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();
      displayName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. Human-readable display name of the data exchange. The display name must
   * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
   * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
   * Default value is an empty string.
   * Max length: 63 bytes.
   * </pre>
   *
   * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for displayName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDisplayNameBytes() {
    java.lang.Object ref = displayName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      displayName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESCRIPTION_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object description_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Description of the data exchange. The description must not contain Unicode
   * non-characters as well as C0 and C1 control codes except tabs (HT),
   * new lines (LF), carriage returns (CR), and page breaks (FF).
   * Default value is an empty string.
   * Max length: 2000 bytes.
   * </pre>
   *
   * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The description.
   */
  @java.lang.Override
  public java.lang.String getDescription() {
    java.lang.Object ref = description_;
    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();
      description_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Description of the data exchange. The description must not contain Unicode
   * non-characters as well as C0 and C1 control codes except tabs (HT),
   * new lines (LF), carriage returns (CR), and page breaks (FF).
   * Default value is an empty string.
   * Max length: 2000 bytes.
   * </pre>
   *
   * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for description.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDescriptionBytes() {
    java.lang.Object ref = description_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      description_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PRIMARY_CONTACT_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object primaryContact_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Email or URL of the primary point of contact of the data exchange.
   * Max Length: 1000 bytes.
   * </pre>
   *
   * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The primaryContact.
   */
  @java.lang.Override
  public java.lang.String getPrimaryContact() {
    java.lang.Object ref = primaryContact_;
    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();
      primaryContact_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Email or URL of the primary point of contact of the data exchange.
   * Max Length: 1000 bytes.
   * </pre>
   *
   * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for primaryContact.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPrimaryContactBytes() {
    java.lang.Object ref = primaryContact_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      primaryContact_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DOCUMENTATION_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object documentation_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Documentation describing the data exchange.
   * </pre>
   *
   * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The documentation.
   */
  @java.lang.Override
  public java.lang.String getDocumentation() {
    java.lang.Object ref = documentation_;
    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();
      documentation_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Documentation describing the data exchange.
   * </pre>
   *
   * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for documentation.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDocumentationBytes() {
    java.lang.Object ref = documentation_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      documentation_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LISTING_COUNT_FIELD_NUMBER = 6;
  private int listingCount_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Number of listings contained in the data exchange.
   * </pre>
   *
   * <code>int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The listingCount.
   */
  @java.lang.Override
  public int getListingCount() {
    return listingCount_;
  }

  public static final int ICON_FIELD_NUMBER = 7;
  private com.google.protobuf.ByteString icon_ = com.google.protobuf.ByteString.EMPTY;
  /**
   *
   *
   * <pre>
   * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
   * Expected image dimensions are 512x512 pixels, however the API only
   * performs validation on size of the encoded data.
   * Note: For byte fields, the content of the fields are base64-encoded (which
   * increases the size of the data by 33-36%) when using JSON on the wire.
   * </pre>
   *
   * <code>bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The icon.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIcon() {
    return icon_;
  }

  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.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, primaryContact_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, documentation_);
    }
    if (listingCount_ != 0) {
      output.writeInt32(6, listingCount_);
    }
    if (!icon_.isEmpty()) {
      output.writeBytes(7, icon_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(primaryContact_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, primaryContact_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, documentation_);
    }
    if (listingCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, listingCount_);
    }
    if (!icon_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, icon_);
    }
    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.cloud.bigquery.dataexchange.v1beta1.DataExchange)) {
      return super.equals(obj);
    }
    com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange other =
        (com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getDisplayName().equals(other.getDisplayName())) return false;
    if (!getDescription().equals(other.getDescription())) return false;
    if (!getPrimaryContact().equals(other.getPrimaryContact())) return false;
    if (!getDocumentation().equals(other.getDocumentation())) return false;
    if (getListingCount() != other.getListingCount()) return false;
    if (!getIcon().equals(other.getIcon())) 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) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDisplayName().hashCode();
    hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
    hash = (53 * hash) + getDescription().hashCode();
    hash = (37 * hash) + PRIMARY_CONTACT_FIELD_NUMBER;
    hash = (53 * hash) + getPrimaryContact().hashCode();
    hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER;
    hash = (53 * hash) + getDocumentation().hashCode();
    hash = (37 * hash) + LISTING_COUNT_FIELD_NUMBER;
    hash = (53 * hash) + getListingCount();
    hash = (37 * hash) + ICON_FIELD_NUMBER;
    hash = (53 * hash) + getIcon().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange 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.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange 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.cloud.bigquery.dataexchange.v1beta1.DataExchange parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange 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.cloud.bigquery.dataexchange.v1beta1.DataExchange parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange 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.cloud.bigquery.dataexchange.v1beta1.DataExchange 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>
   * A data exchange is a container that lets you share data. Along with the
   * descriptive information about the data exchange, it contains listings that
   * reference shared datasets.
   * </pre>
   *
   * Protobuf type {@code google.cloud.bigquery.dataexchange.v1beta1.DataExchange}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.dataexchange.v1beta1.DataExchange)
      com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeProto
          .internal_static_google_cloud_bigquery_dataexchange_v1beta1_DataExchange_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeProto
          .internal_static_google_cloud_bigquery_dataexchange_v1beta1_DataExchange_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.class,
              com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.Builder.class);
    }

    // Construct using com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      displayName_ = "";
      description_ = "";
      primaryContact_ = "";
      documentation_ = "";
      listingCount_ = 0;
      icon_ = com.google.protobuf.ByteString.EMPTY;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchangeProto
          .internal_static_google_cloud_bigquery_dataexchange_v1beta1_DataExchange_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange getDefaultInstanceForType() {
      return com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange build() {
      com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange buildPartial() {
      com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange result =
          new com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.displayName_ = displayName_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.description_ = description_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.primaryContact_ = primaryContact_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.documentation_ = documentation_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.listingCount_ = listingCount_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.icon_ = icon_;
      }
    }

    @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.cloud.bigquery.dataexchange.v1beta1.DataExchange) {
        return mergeFrom((com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange other) {
      if (other == com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getDisplayName().isEmpty()) {
        displayName_ = other.displayName_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getDescription().isEmpty()) {
        description_ = other.description_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (!other.getPrimaryContact().isEmpty()) {
        primaryContact_ = other.primaryContact_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (!other.getDocumentation().isEmpty()) {
        documentation_ = other.documentation_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (other.getListingCount() != 0) {
        setListingCount(other.getListingCount());
      }
      if (other.getIcon() != com.google.protobuf.ByteString.EMPTY) {
        setIcon(other.getIcon());
      }
      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:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                displayName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                description_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                primaryContact_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                documentation_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 48:
              {
                listingCount_ = input.readInt32();
                bitField0_ |= 0x00000020;
                break;
              } // case 48
            case 58:
              {
                icon_ = input.readBytes();
                bitField0_ |= 0x00000040;
                break;
              } // case 58
            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 name_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the data exchange.
     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
     * Output only. The resource name of the data exchange.
     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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>
     * Output only. The resource name of the data exchange.
     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the data exchange.
     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the data exchange.
     * e.g. `projects/myproject/locations/US/dataExchanges/123`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object displayName_ = "";
    /**
     *
     *
     * <pre>
     * Required. Human-readable display name of the data exchange. The display name must
     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
     * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
     * Default value is an empty string.
     * Max length: 63 bytes.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The displayName.
     */
    public java.lang.String getDisplayName() {
      java.lang.Object ref = displayName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        displayName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Human-readable display name of the data exchange. The display name must
     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
     * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
     * Default value is an empty string.
     * Max length: 63 bytes.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for displayName.
     */
    public com.google.protobuf.ByteString getDisplayNameBytes() {
      java.lang.Object ref = displayName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        displayName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Human-readable display name of the data exchange. The display name must
     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
     * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
     * Default value is an empty string.
     * Max length: 63 bytes.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      displayName_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Human-readable display name of the data exchange. The display name must
     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
     * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
     * Default value is an empty string.
     * Max length: 63 bytes.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisplayName() {
      displayName_ = getDefaultInstance().getDisplayName();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Human-readable display name of the data exchange. The display name must
     * contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
     * spaces ( ), ampersands (&amp;) and must not start or end with spaces.
     * Default value is an empty string.
     * Max length: 63 bytes.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      displayName_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object description_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Description of the data exchange. The description must not contain Unicode
     * non-characters as well as C0 and C1 control codes except tabs (HT),
     * new lines (LF), carriage returns (CR), and page breaks (FF).
     * Default value is an empty string.
     * Max length: 2000 bytes.
     * </pre>
     *
     * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The description.
     */
    public java.lang.String getDescription() {
      java.lang.Object ref = description_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        description_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Description of the data exchange. The description must not contain Unicode
     * non-characters as well as C0 and C1 control codes except tabs (HT),
     * new lines (LF), carriage returns (CR), and page breaks (FF).
     * Default value is an empty string.
     * Max length: 2000 bytes.
     * </pre>
     *
     * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for description.
     */
    public com.google.protobuf.ByteString getDescriptionBytes() {
      java.lang.Object ref = description_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        description_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Description of the data exchange. The description must not contain Unicode
     * non-characters as well as C0 and C1 control codes except tabs (HT),
     * new lines (LF), carriage returns (CR), and page breaks (FF).
     * Default value is an empty string.
     * Max length: 2000 bytes.
     * </pre>
     *
     * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The description to set.
     * @return This builder for chaining.
     */
    public Builder setDescription(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      description_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Description of the data exchange. The description must not contain Unicode
     * non-characters as well as C0 and C1 control codes except tabs (HT),
     * new lines (LF), carriage returns (CR), and page breaks (FF).
     * Default value is an empty string.
     * Max length: 2000 bytes.
     * </pre>
     *
     * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDescription() {
      description_ = getDefaultInstance().getDescription();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Description of the data exchange. The description must not contain Unicode
     * non-characters as well as C0 and C1 control codes except tabs (HT),
     * new lines (LF), carriage returns (CR), and page breaks (FF).
     * Default value is an empty string.
     * Max length: 2000 bytes.
     * </pre>
     *
     * <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for description to set.
     * @return This builder for chaining.
     */
    public Builder setDescriptionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      description_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.lang.Object primaryContact_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Email or URL of the primary point of contact of the data exchange.
     * Max Length: 1000 bytes.
     * </pre>
     *
     * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The primaryContact.
     */
    public java.lang.String getPrimaryContact() {
      java.lang.Object ref = primaryContact_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        primaryContact_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Email or URL of the primary point of contact of the data exchange.
     * Max Length: 1000 bytes.
     * </pre>
     *
     * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for primaryContact.
     */
    public com.google.protobuf.ByteString getPrimaryContactBytes() {
      java.lang.Object ref = primaryContact_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        primaryContact_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Email or URL of the primary point of contact of the data exchange.
     * Max Length: 1000 bytes.
     * </pre>
     *
     * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The primaryContact to set.
     * @return This builder for chaining.
     */
    public Builder setPrimaryContact(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      primaryContact_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Email or URL of the primary point of contact of the data exchange.
     * Max Length: 1000 bytes.
     * </pre>
     *
     * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPrimaryContact() {
      primaryContact_ = getDefaultInstance().getPrimaryContact();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Email or URL of the primary point of contact of the data exchange.
     * Max Length: 1000 bytes.
     * </pre>
     *
     * <code>string primary_contact = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for primaryContact to set.
     * @return This builder for chaining.
     */
    public Builder setPrimaryContactBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      primaryContact_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private java.lang.Object documentation_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Documentation describing the data exchange.
     * </pre>
     *
     * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The documentation.
     */
    public java.lang.String getDocumentation() {
      java.lang.Object ref = documentation_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        documentation_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Documentation describing the data exchange.
     * </pre>
     *
     * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for documentation.
     */
    public com.google.protobuf.ByteString getDocumentationBytes() {
      java.lang.Object ref = documentation_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        documentation_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Documentation describing the data exchange.
     * </pre>
     *
     * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The documentation to set.
     * @return This builder for chaining.
     */
    public Builder setDocumentation(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      documentation_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Documentation describing the data exchange.
     * </pre>
     *
     * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDocumentation() {
      documentation_ = getDefaultInstance().getDocumentation();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Documentation describing the data exchange.
     * </pre>
     *
     * <code>string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for documentation to set.
     * @return This builder for chaining.
     */
    public Builder setDocumentationBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      documentation_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private int listingCount_;
    /**
     *
     *
     * <pre>
     * Output only. Number of listings contained in the data exchange.
     * </pre>
     *
     * <code>int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The listingCount.
     */
    @java.lang.Override
    public int getListingCount() {
      return listingCount_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Number of listings contained in the data exchange.
     * </pre>
     *
     * <code>int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The listingCount to set.
     * @return This builder for chaining.
     */
    public Builder setListingCount(int value) {

      listingCount_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Number of listings contained in the data exchange.
     * </pre>
     *
     * <code>int32 listing_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearListingCount() {
      bitField0_ = (bitField0_ & ~0x00000020);
      listingCount_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString icon_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
     * Expected image dimensions are 512x512 pixels, however the API only
     * performs validation on size of the encoded data.
     * Note: For byte fields, the content of the fields are base64-encoded (which
     * increases the size of the data by 33-36%) when using JSON on the wire.
     * </pre>
     *
     * <code>bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The icon.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getIcon() {
      return icon_;
    }
    /**
     *
     *
     * <pre>
     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
     * Expected image dimensions are 512x512 pixels, however the API only
     * performs validation on size of the encoded data.
     * Note: For byte fields, the content of the fields are base64-encoded (which
     * increases the size of the data by 33-36%) when using JSON on the wire.
     * </pre>
     *
     * <code>bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The icon to set.
     * @return This builder for chaining.
     */
    public Builder setIcon(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      icon_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB
     * Expected image dimensions are 512x512 pixels, however the API only
     * performs validation on size of the encoded data.
     * Note: For byte fields, the content of the fields are base64-encoded (which
     * increases the size of the data by 33-36%) when using JSON on the wire.
     * </pre>
     *
     * <code>bytes icon = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearIcon() {
      bitField0_ = (bitField0_ & ~0x00000040);
      icon_ = getDefaultInstance().getIcon();
      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.cloud.bigquery.dataexchange.v1beta1.DataExchange)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.bigquery.dataexchange.v1beta1.DataExchange)
  private static final com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange();
  }

  public static com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<DataExchange> PARSER =
      new com.google.protobuf.AbstractParser<DataExchange>() {
        @java.lang.Override
        public DataExchange 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<DataExchange> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.cloud.bigquery.dataexchange.v1beta1.DataExchange getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
