/*
 * 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/billing/budgets/v1/budget_model.proto

package com.google.cloud.billing.budgets.v1;

/**
 *
 *
 * <pre>
 * NotificationsRule defines notifications that are sent based on budget spend
 * and thresholds.
 * </pre>
 *
 * Protobuf type {@code google.cloud.billing.budgets.v1.NotificationsRule}
 */
public final class NotificationsRule extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.NotificationsRule)
    NotificationsRuleOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use NotificationsRule.newBuilder() to construct.
  private NotificationsRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private NotificationsRule() {
    pubsubTopic_ = "";
    schemaVersion_ = "";
    monitoringNotificationChannels_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

  @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.billing.budgets.v1.BudgetModelProto
        .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.billing.budgets.v1.BudgetModelProto
        .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.billing.budgets.v1.NotificationsRule.class,
            com.google.cloud.billing.budgets.v1.NotificationsRule.Builder.class);
  }

  public static final int PUBSUB_TOPIC_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pubsubTopic_ = "";
  /**
   *
   *
   * <pre>
   * Optional. The name of the Pub/Sub topic where budget related messages will
   * be published, in the form `projects/{project_id}/topics/{topic_id}`.
   * Updates are sent at regular intervals to the topic. The topic needs to be
   * created before the budget is created; see
   * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
   * for more details.
   * Caller is expected to have
   * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
   * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
   * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
   * for more details on Pub/Sub roles and permissions.
   * </pre>
   *
   * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The pubsubTopic.
   */
  @java.lang.Override
  public java.lang.String getPubsubTopic() {
    java.lang.Object ref = pubsubTopic_;
    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();
      pubsubTopic_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The name of the Pub/Sub topic where budget related messages will
   * be published, in the form `projects/{project_id}/topics/{topic_id}`.
   * Updates are sent at regular intervals to the topic. The topic needs to be
   * created before the budget is created; see
   * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
   * for more details.
   * Caller is expected to have
   * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
   * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
   * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
   * for more details on Pub/Sub roles and permissions.
   * </pre>
   *
   * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for pubsubTopic.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPubsubTopicBytes() {
    java.lang.Object ref = pubsubTopic_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pubsubTopic_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SCHEMA_VERSION_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object schemaVersion_ = "";
  /**
   *
   *
   * <pre>
   * Optional. Required when
   * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
   * is set. The schema version of the notification sent to
   * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
   * Only "1.0" is accepted. It represents the JSON schema as defined in
   * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
   * </pre>
   *
   * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The schemaVersion.
   */
  @java.lang.Override
  public java.lang.String getSchemaVersion() {
    java.lang.Object ref = schemaVersion_;
    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();
      schemaVersion_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Required when
   * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
   * is set. The schema version of the notification sent to
   * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
   * Only "1.0" is accepted. It represents the JSON schema as defined in
   * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
   * </pre>
   *
   * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for schemaVersion.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSchemaVersionBytes() {
    java.lang.Object ref = schemaVersion_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      schemaVersion_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MONITORING_NOTIFICATION_CHANNELS_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList monitoringNotificationChannels_;
  /**
   *
   *
   * <pre>
   * Optional. Targets to send notifications to when a threshold is exceeded.
   * This is in addition to default recipients who have billing account IAM
   * roles. The value is the full REST resource name of a monitoring
   * notification channel with the form
   * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
   * channels are allowed. See
   * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
   * for more details.
   * </pre>
   *
   * <code>
   * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return A list containing the monitoringNotificationChannels.
   */
  public com.google.protobuf.ProtocolStringList getMonitoringNotificationChannelsList() {
    return monitoringNotificationChannels_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Targets to send notifications to when a threshold is exceeded.
   * This is in addition to default recipients who have billing account IAM
   * roles. The value is the full REST resource name of a monitoring
   * notification channel with the form
   * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
   * channels are allowed. See
   * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
   * for more details.
   * </pre>
   *
   * <code>
   * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The count of monitoringNotificationChannels.
   */
  public int getMonitoringNotificationChannelsCount() {
    return monitoringNotificationChannels_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional. Targets to send notifications to when a threshold is exceeded.
   * This is in addition to default recipients who have billing account IAM
   * roles. The value is the full REST resource name of a monitoring
   * notification channel with the form
   * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
   * channels are allowed. See
   * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
   * for more details.
   * </pre>
   *
   * <code>
   * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The monitoringNotificationChannels at the given index.
   */
  public java.lang.String getMonitoringNotificationChannels(int index) {
    return monitoringNotificationChannels_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Optional. Targets to send notifications to when a threshold is exceeded.
   * This is in addition to default recipients who have billing account IAM
   * roles. The value is the full REST resource name of a monitoring
   * notification channel with the form
   * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
   * channels are allowed. See
   * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
   * for more details.
   * </pre>
   *
   * <code>
   * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the monitoringNotificationChannels at the given index.
   */
  public com.google.protobuf.ByteString getMonitoringNotificationChannelsBytes(int index) {
    return monitoringNotificationChannels_.getByteString(index);
  }

  public static final int DISABLE_DEFAULT_IAM_RECIPIENTS_FIELD_NUMBER = 4;
  private boolean disableDefaultIamRecipients_ = false;
  /**
   *
   *
   * <pre>
   * Optional. When set to true, disables default notifications sent when a
   * threshold is exceeded. Default notifications are sent to those with Billing
   * Account Administrator and Billing Account User IAM roles for the target
   * account.
   * </pre>
   *
   * <code>bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The disableDefaultIamRecipients.
   */
  @java.lang.Override
  public boolean getDisableDefaultIamRecipients() {
    return disableDefaultIamRecipients_;
  }

  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(pubsubTopic_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubTopic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaVersion_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, schemaVersion_);
    }
    for (int i = 0; i < monitoringNotificationChannels_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(
          output, 3, monitoringNotificationChannels_.getRaw(i));
    }
    if (disableDefaultIamRecipients_ != false) {
      output.writeBool(4, disableDefaultIamRecipients_);
    }
    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(pubsubTopic_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubTopic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaVersion_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, schemaVersion_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < monitoringNotificationChannels_.size(); i++) {
        dataSize += computeStringSizeNoTag(monitoringNotificationChannels_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getMonitoringNotificationChannelsList().size();
    }
    if (disableDefaultIamRecipients_ != false) {
      size +=
          com.google.protobuf.CodedOutputStream.computeBoolSize(4, disableDefaultIamRecipients_);
    }
    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.billing.budgets.v1.NotificationsRule)) {
      return super.equals(obj);
    }
    com.google.cloud.billing.budgets.v1.NotificationsRule other =
        (com.google.cloud.billing.budgets.v1.NotificationsRule) obj;

    if (!getPubsubTopic().equals(other.getPubsubTopic())) return false;
    if (!getSchemaVersion().equals(other.getSchemaVersion())) return false;
    if (!getMonitoringNotificationChannelsList()
        .equals(other.getMonitoringNotificationChannelsList())) return false;
    if (getDisableDefaultIamRecipients() != other.getDisableDefaultIamRecipients()) 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) + PUBSUB_TOPIC_FIELD_NUMBER;
    hash = (53 * hash) + getPubsubTopic().hashCode();
    hash = (37 * hash) + SCHEMA_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getSchemaVersion().hashCode();
    if (getMonitoringNotificationChannelsCount() > 0) {
      hash = (37 * hash) + MONITORING_NOTIFICATION_CHANNELS_FIELD_NUMBER;
      hash = (53 * hash) + getMonitoringNotificationChannelsList().hashCode();
    }
    hash = (37 * hash) + DISABLE_DEFAULT_IAM_RECIPIENTS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableDefaultIamRecipients());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.billing.budgets.v1.NotificationsRule 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.billing.budgets.v1.NotificationsRule parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.cloud.billing.budgets.v1.NotificationsRule 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.billing.budgets.v1.NotificationsRule 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>
   * NotificationsRule defines notifications that are sent based on budget spend
   * and thresholds.
   * </pre>
   *
   * Protobuf type {@code google.cloud.billing.budgets.v1.NotificationsRule}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.billing.budgets.v1.NotificationsRule)
      com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.billing.budgets.v1.BudgetModelProto
          .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.billing.budgets.v1.BudgetModelProto
          .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.billing.budgets.v1.NotificationsRule.class,
              com.google.cloud.billing.budgets.v1.NotificationsRule.Builder.class);
    }

    // Construct using com.google.cloud.billing.budgets.v1.NotificationsRule.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      pubsubTopic_ = "";
      schemaVersion_ = "";
      monitoringNotificationChannels_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      disableDefaultIamRecipients_ = false;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.billing.budgets.v1.BudgetModelProto
          .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.billing.budgets.v1.NotificationsRule getDefaultInstanceForType() {
      return com.google.cloud.billing.budgets.v1.NotificationsRule.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.billing.budgets.v1.NotificationsRule build() {
      com.google.cloud.billing.budgets.v1.NotificationsRule result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.billing.budgets.v1.NotificationsRule buildPartial() {
      com.google.cloud.billing.budgets.v1.NotificationsRule result =
          new com.google.cloud.billing.budgets.v1.NotificationsRule(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.billing.budgets.v1.NotificationsRule result) {
      if (((bitField0_ & 0x00000004) != 0)) {
        monitoringNotificationChannels_ = monitoringNotificationChannels_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.monitoringNotificationChannels_ = monitoringNotificationChannels_;
    }

    private void buildPartial0(com.google.cloud.billing.budgets.v1.NotificationsRule result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.pubsubTopic_ = pubsubTopic_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.schemaVersion_ = schemaVersion_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.disableDefaultIamRecipients_ = disableDefaultIamRecipients_;
      }
    }

    @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.billing.budgets.v1.NotificationsRule) {
        return mergeFrom((com.google.cloud.billing.budgets.v1.NotificationsRule) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.billing.budgets.v1.NotificationsRule other) {
      if (other == com.google.cloud.billing.budgets.v1.NotificationsRule.getDefaultInstance())
        return this;
      if (!other.getPubsubTopic().isEmpty()) {
        pubsubTopic_ = other.pubsubTopic_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getSchemaVersion().isEmpty()) {
        schemaVersion_ = other.schemaVersion_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.monitoringNotificationChannels_.isEmpty()) {
        if (monitoringNotificationChannels_.isEmpty()) {
          monitoringNotificationChannels_ = other.monitoringNotificationChannels_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureMonitoringNotificationChannelsIsMutable();
          monitoringNotificationChannels_.addAll(other.monitoringNotificationChannels_);
        }
        onChanged();
      }
      if (other.getDisableDefaultIamRecipients() != false) {
        setDisableDefaultIamRecipients(other.getDisableDefaultIamRecipients());
      }
      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:
              {
                pubsubTopic_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                schemaVersion_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureMonitoringNotificationChannelsIsMutable();
                monitoringNotificationChannels_.add(s);
                break;
              } // case 26
            case 32:
              {
                disableDefaultIamRecipients_ = input.readBool();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
            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 pubsubTopic_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The name of the Pub/Sub topic where budget related messages will
     * be published, in the form `projects/{project_id}/topics/{topic_id}`.
     * Updates are sent at regular intervals to the topic. The topic needs to be
     * created before the budget is created; see
     * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
     * for more details.
     * Caller is expected to have
     * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
     * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
     * for more details on Pub/Sub roles and permissions.
     * </pre>
     *
     * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The pubsubTopic.
     */
    public java.lang.String getPubsubTopic() {
      java.lang.Object ref = pubsubTopic_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pubsubTopic_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of the Pub/Sub topic where budget related messages will
     * be published, in the form `projects/{project_id}/topics/{topic_id}`.
     * Updates are sent at regular intervals to the topic. The topic needs to be
     * created before the budget is created; see
     * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
     * for more details.
     * Caller is expected to have
     * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
     * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
     * for more details on Pub/Sub roles and permissions.
     * </pre>
     *
     * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for pubsubTopic.
     */
    public com.google.protobuf.ByteString getPubsubTopicBytes() {
      java.lang.Object ref = pubsubTopic_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pubsubTopic_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of the Pub/Sub topic where budget related messages will
     * be published, in the form `projects/{project_id}/topics/{topic_id}`.
     * Updates are sent at regular intervals to the topic. The topic needs to be
     * created before the budget is created; see
     * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
     * for more details.
     * Caller is expected to have
     * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
     * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
     * for more details on Pub/Sub roles and permissions.
     * </pre>
     *
     * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The pubsubTopic to set.
     * @return This builder for chaining.
     */
    public Builder setPubsubTopic(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      pubsubTopic_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of the Pub/Sub topic where budget related messages will
     * be published, in the form `projects/{project_id}/topics/{topic_id}`.
     * Updates are sent at regular intervals to the topic. The topic needs to be
     * created before the budget is created; see
     * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
     * for more details.
     * Caller is expected to have
     * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
     * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
     * for more details on Pub/Sub roles and permissions.
     * </pre>
     *
     * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPubsubTopic() {
      pubsubTopic_ = getDefaultInstance().getPubsubTopic();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of the Pub/Sub topic where budget related messages will
     * be published, in the form `projects/{project_id}/topics/{topic_id}`.
     * Updates are sent at regular intervals to the topic. The topic needs to be
     * created before the budget is created; see
     * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
     * for more details.
     * Caller is expected to have
     * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
     * budget, otherwise, the API call will fail with PERMISSION_DENIED. See
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
     * for more details on Pub/Sub roles and permissions.
     * </pre>
     *
     * <code>string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for pubsubTopic to set.
     * @return This builder for chaining.
     */
    public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      pubsubTopic_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object schemaVersion_ = "";
    /**
     *
     *
     * <pre>
     * Optional. Required when
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
     * is set. The schema version of the notification sent to
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
     * Only "1.0" is accepted. It represents the JSON schema as defined in
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
     * </pre>
     *
     * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The schemaVersion.
     */
    public java.lang.String getSchemaVersion() {
      java.lang.Object ref = schemaVersion_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        schemaVersion_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Required when
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
     * is set. The schema version of the notification sent to
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
     * Only "1.0" is accepted. It represents the JSON schema as defined in
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
     * </pre>
     *
     * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for schemaVersion.
     */
    public com.google.protobuf.ByteString getSchemaVersionBytes() {
      java.lang.Object ref = schemaVersion_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        schemaVersion_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Required when
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
     * is set. The schema version of the notification sent to
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
     * Only "1.0" is accepted. It represents the JSON schema as defined in
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
     * </pre>
     *
     * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The schemaVersion to set.
     * @return This builder for chaining.
     */
    public Builder setSchemaVersion(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      schemaVersion_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Required when
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
     * is set. The schema version of the notification sent to
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
     * Only "1.0" is accepted. It represents the JSON schema as defined in
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
     * </pre>
     *
     * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSchemaVersion() {
      schemaVersion_ = getDefaultInstance().getSchemaVersion();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Required when
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
     * is set. The schema version of the notification sent to
     * [NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
     * Only "1.0" is accepted. It represents the JSON schema as defined in
     * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
     * </pre>
     *
     * <code>string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for schemaVersion to set.
     * @return This builder for chaining.
     */
    public Builder setSchemaVersionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      schemaVersion_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList monitoringNotificationChannels_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureMonitoringNotificationChannelsIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        monitoringNotificationChannels_ =
            new com.google.protobuf.LazyStringArrayList(monitoringNotificationChannels_);
        bitField0_ |= 0x00000004;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return A list containing the monitoringNotificationChannels.
     */
    public com.google.protobuf.ProtocolStringList getMonitoringNotificationChannelsList() {
      return monitoringNotificationChannels_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The count of monitoringNotificationChannels.
     */
    public int getMonitoringNotificationChannelsCount() {
      return monitoringNotificationChannels_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the element to return.
     * @return The monitoringNotificationChannels at the given index.
     */
    public java.lang.String getMonitoringNotificationChannels(int index) {
      return monitoringNotificationChannels_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the monitoringNotificationChannels at the given index.
     */
    public com.google.protobuf.ByteString getMonitoringNotificationChannelsBytes(int index) {
      return monitoringNotificationChannels_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The monitoringNotificationChannels to set.
     * @return This builder for chaining.
     */
    public Builder setMonitoringNotificationChannels(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureMonitoringNotificationChannelsIsMutable();
      monitoringNotificationChannels_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The monitoringNotificationChannels to add.
     * @return This builder for chaining.
     */
    public Builder addMonitoringNotificationChannels(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureMonitoringNotificationChannelsIsMutable();
      monitoringNotificationChannels_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param values The monitoringNotificationChannels to add.
     * @return This builder for chaining.
     */
    public Builder addAllMonitoringNotificationChannels(
        java.lang.Iterable<java.lang.String> values) {
      ensureMonitoringNotificationChannelsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, monitoringNotificationChannels_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMonitoringNotificationChannels() {
      monitoringNotificationChannels_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Targets to send notifications to when a threshold is exceeded.
     * This is in addition to default recipients who have billing account IAM
     * roles. The value is the full REST resource name of a monitoring
     * notification channel with the form
     * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
     * channels are allowed. See
     * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
     * for more details.
     * </pre>
     *
     * <code>
     * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The bytes of the monitoringNotificationChannels to add.
     * @return This builder for chaining.
     */
    public Builder addMonitoringNotificationChannelsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureMonitoringNotificationChannelsIsMutable();
      monitoringNotificationChannels_.add(value);
      onChanged();
      return this;
    }

    private boolean disableDefaultIamRecipients_;
    /**
     *
     *
     * <pre>
     * Optional. When set to true, disables default notifications sent when a
     * threshold is exceeded. Default notifications are sent to those with Billing
     * Account Administrator and Billing Account User IAM roles for the target
     * account.
     * </pre>
     *
     * <code>bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The disableDefaultIamRecipients.
     */
    @java.lang.Override
    public boolean getDisableDefaultIamRecipients() {
      return disableDefaultIamRecipients_;
    }
    /**
     *
     *
     * <pre>
     * Optional. When set to true, disables default notifications sent when a
     * threshold is exceeded. Default notifications are sent to those with Billing
     * Account Administrator and Billing Account User IAM roles for the target
     * account.
     * </pre>
     *
     * <code>bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The disableDefaultIamRecipients to set.
     * @return This builder for chaining.
     */
    public Builder setDisableDefaultIamRecipients(boolean value) {

      disableDefaultIamRecipients_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. When set to true, disables default notifications sent when a
     * threshold is exceeded. Default notifications are sent to those with Billing
     * Account Administrator and Billing Account User IAM roles for the target
     * account.
     * </pre>
     *
     * <code>bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisableDefaultIamRecipients() {
      bitField0_ = (bitField0_ & ~0x00000008);
      disableDefaultIamRecipients_ = false;
      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.billing.budgets.v1.NotificationsRule)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.NotificationsRule)
  private static final com.google.cloud.billing.budgets.v1.NotificationsRule DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.NotificationsRule();
  }

  public static com.google.cloud.billing.budgets.v1.NotificationsRule getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.cloud.billing.budgets.v1.NotificationsRule getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
