/*
 * 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/domains/v1alpha2/domains.proto

package com.google.cloud.domains.v1alpha2;

/**
 *
 *
 * <pre>
 * Request for the `TransferDomain` method.
 * </pre>
 *
 * Protobuf type {@code google.cloud.domains.v1alpha2.TransferDomainRequest}
 */
public final class TransferDomainRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.domains.v1alpha2.TransferDomainRequest)
    TransferDomainRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TransferDomainRequest.newBuilder() to construct.
  private TransferDomainRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private TransferDomainRequest() {
    parent_ = "";
    contactNotices_ = java.util.Collections.emptyList();
  }

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

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

  private TransferDomainRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              parent_ = s;
              break;
            }
          case 18:
            {
              com.google.cloud.domains.v1alpha2.Registration.Builder subBuilder = null;
              if (registration_ != null) {
                subBuilder = registration_.toBuilder();
              }
              registration_ =
                  input.readMessage(
                      com.google.cloud.domains.v1alpha2.Registration.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(registration_);
                registration_ = subBuilder.buildPartial();
              }

              break;
            }
          case 24:
            {
              int rawValue = input.readEnum();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                contactNotices_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000001;
              }
              contactNotices_.add(rawValue);
              break;
            }
          case 26:
            {
              int length = input.readRawVarint32();
              int oldLimit = input.pushLimit(length);
              while (input.getBytesUntilLimit() > 0) {
                int rawValue = input.readEnum();
                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                  contactNotices_ = new java.util.ArrayList<java.lang.Integer>();
                  mutable_bitField0_ |= 0x00000001;
                }
                contactNotices_.add(rawValue);
              }
              input.popLimit(oldLimit);
              break;
            }
          case 34:
            {
              com.google.type.Money.Builder subBuilder = null;
              if (yearlyPrice_ != null) {
                subBuilder = yearlyPrice_.toBuilder();
              }
              yearlyPrice_ = input.readMessage(com.google.type.Money.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(yearlyPrice_);
                yearlyPrice_ = subBuilder.buildPartial();
              }

              break;
            }
          case 42:
            {
              com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder subBuilder = null;
              if (authorizationCode_ != null) {
                subBuilder = authorizationCode_.toBuilder();
              }
              authorizationCode_ =
                  input.readMessage(
                      com.google.cloud.domains.v1alpha2.AuthorizationCode.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(authorizationCode_);
                authorizationCode_ = subBuilder.buildPartial();
              }

              break;
            }
          case 48:
            {
              validateOnly_ = input.readBool();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        contactNotices_ = java.util.Collections.unmodifiableList(contactNotices_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.domains.v1alpha2.DomainsProto
        .internal_static_google_cloud_domains_v1alpha2_TransferDomainRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.domains.v1alpha2.DomainsProto
        .internal_static_google_cloud_domains_v1alpha2_TransferDomainRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.domains.v1alpha2.TransferDomainRequest.class,
            com.google.cloud.domains.v1alpha2.TransferDomainRequest.Builder.class);
  }

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The parent resource of the `Registration`. Must be in the
   * format `projects/&#42;&#47;locations/&#42;`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The parent resource of the `Registration`. Must be in the
   * format `projects/&#42;&#47;locations/&#42;`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REGISTRATION_FIELD_NUMBER = 2;
  private com.google.cloud.domains.v1alpha2.Registration registration_;
  /**
   *
   *
   * <pre>
   * Required. The complete `Registration` resource to be created.
   * You can leave `registration.dns_settings` unset to import the
   * domain's current DNS configuration from its current registrar. Use this
   * option only if you are sure that the domain's current DNS service
   * does not cease upon transfer, as is often the case for DNS services
   * provided for free by the registrar.
   * </pre>
   *
   * <code>
   * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the registration field is set.
   */
  @java.lang.Override
  public boolean hasRegistration() {
    return registration_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The complete `Registration` resource to be created.
   * You can leave `registration.dns_settings` unset to import the
   * domain's current DNS configuration from its current registrar. Use this
   * option only if you are sure that the domain's current DNS service
   * does not cease upon transfer, as is often the case for DNS services
   * provided for free by the registrar.
   * </pre>
   *
   * <code>
   * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The registration.
   */
  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.Registration getRegistration() {
    return registration_ == null
        ? com.google.cloud.domains.v1alpha2.Registration.getDefaultInstance()
        : registration_;
  }
  /**
   *
   *
   * <pre>
   * Required. The complete `Registration` resource to be created.
   * You can leave `registration.dns_settings` unset to import the
   * domain's current DNS configuration from its current registrar. Use this
   * option only if you are sure that the domain's current DNS service
   * does not cease upon transfer, as is often the case for DNS services
   * provided for free by the registrar.
   * </pre>
   *
   * <code>
   * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.RegistrationOrBuilder getRegistrationOrBuilder() {
    return getRegistration();
  }

  public static final int CONTACT_NOTICES_FIELD_NUMBER = 3;
  private java.util.List<java.lang.Integer> contactNotices_;
  private static final com.google.protobuf.Internal.ListAdapter.Converter<
          java.lang.Integer, com.google.cloud.domains.v1alpha2.ContactNotice>
      contactNotices_converter_ =
          new com.google.protobuf.Internal.ListAdapter.Converter<
              java.lang.Integer, com.google.cloud.domains.v1alpha2.ContactNotice>() {
            public com.google.cloud.domains.v1alpha2.ContactNotice convert(java.lang.Integer from) {
              @SuppressWarnings("deprecation")
              com.google.cloud.domains.v1alpha2.ContactNotice result =
                  com.google.cloud.domains.v1alpha2.ContactNotice.valueOf(from);
              return result == null
                  ? com.google.cloud.domains.v1alpha2.ContactNotice.UNRECOGNIZED
                  : result;
            }
          };
  /**
   *
   *
   * <pre>
   * The list of contact notices that you acknowledge. The notices
   * needed here depend on the values specified in
   * `registration.contact_settings`.
   * </pre>
   *
   * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
   *
   * @return A list containing the contactNotices.
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.domains.v1alpha2.ContactNotice> getContactNoticesList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, com.google.cloud.domains.v1alpha2.ContactNotice>(
        contactNotices_, contactNotices_converter_);
  }
  /**
   *
   *
   * <pre>
   * The list of contact notices that you acknowledge. The notices
   * needed here depend on the values specified in
   * `registration.contact_settings`.
   * </pre>
   *
   * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
   *
   * @return The count of contactNotices.
   */
  @java.lang.Override
  public int getContactNoticesCount() {
    return contactNotices_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of contact notices that you acknowledge. The notices
   * needed here depend on the values specified in
   * `registration.contact_settings`.
   * </pre>
   *
   * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
   *
   * @param index The index of the element to return.
   * @return The contactNotices at the given index.
   */
  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.ContactNotice getContactNotices(int index) {
    return contactNotices_converter_.convert(contactNotices_.get(index));
  }
  /**
   *
   *
   * <pre>
   * The list of contact notices that you acknowledge. The notices
   * needed here depend on the values specified in
   * `registration.contact_settings`.
   * </pre>
   *
   * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
   *
   * @return A list containing the enum numeric values on the wire for contactNotices.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer> getContactNoticesValueList() {
    return contactNotices_;
  }
  /**
   *
   *
   * <pre>
   * The list of contact notices that you acknowledge. The notices
   * needed here depend on the values specified in
   * `registration.contact_settings`.
   * </pre>
   *
   * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
   *
   * @param index The index of the value to return.
   * @return The enum numeric value on the wire of contactNotices at the given index.
   */
  @java.lang.Override
  public int getContactNoticesValue(int index) {
    return contactNotices_.get(index);
  }

  private int contactNoticesMemoizedSerializedSize;

  public static final int YEARLY_PRICE_FIELD_NUMBER = 4;
  private com.google.type.Money yearlyPrice_;
  /**
   *
   *
   * <pre>
   * Required. Acknowledgement of the price to transfer or renew the domain for one year.
   * Call `RetrieveTransferParameters` to obtain the price, which you must
   * acknowledge.
   * </pre>
   *
   * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return Whether the yearlyPrice field is set.
   */
  @java.lang.Override
  public boolean hasYearlyPrice() {
    return yearlyPrice_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Acknowledgement of the price to transfer or renew the domain for one year.
   * Call `RetrieveTransferParameters` to obtain the price, which you must
   * acknowledge.
   * </pre>
   *
   * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The yearlyPrice.
   */
  @java.lang.Override
  public com.google.type.Money getYearlyPrice() {
    return yearlyPrice_ == null ? com.google.type.Money.getDefaultInstance() : yearlyPrice_;
  }
  /**
   *
   *
   * <pre>
   * Required. Acknowledgement of the price to transfer or renew the domain for one year.
   * Call `RetrieveTransferParameters` to obtain the price, which you must
   * acknowledge.
   * </pre>
   *
   * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
   */
  @java.lang.Override
  public com.google.type.MoneyOrBuilder getYearlyPriceOrBuilder() {
    return getYearlyPrice();
  }

  public static final int AUTHORIZATION_CODE_FIELD_NUMBER = 5;
  private com.google.cloud.domains.v1alpha2.AuthorizationCode authorizationCode_;
  /**
   *
   *
   * <pre>
   * The domain's transfer authorization code. You can obtain this from the
   * domain's current registrar.
   * </pre>
   *
   * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
   *
   * @return Whether the authorizationCode field is set.
   */
  @java.lang.Override
  public boolean hasAuthorizationCode() {
    return authorizationCode_ != null;
  }
  /**
   *
   *
   * <pre>
   * The domain's transfer authorization code. You can obtain this from the
   * domain's current registrar.
   * </pre>
   *
   * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
   *
   * @return The authorizationCode.
   */
  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.AuthorizationCode getAuthorizationCode() {
    return authorizationCode_ == null
        ? com.google.cloud.domains.v1alpha2.AuthorizationCode.getDefaultInstance()
        : authorizationCode_;
  }
  /**
   *
   *
   * <pre>
   * The domain's transfer authorization code. You can obtain this from the
   * domain's current registrar.
   * </pre>
   *
   * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
   */
  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.AuthorizationCodeOrBuilder
      getAuthorizationCodeOrBuilder() {
    return getAuthorizationCode();
  }

  public static final int VALIDATE_ONLY_FIELD_NUMBER = 6;
  private boolean validateOnly_;
  /**
   *
   *
   * <pre>
   * Validate the request without actually transferring the domain.
   * </pre>
   *
   * <code>bool validate_only = 6;</code>
   *
   * @return The validateOnly.
   */
  @java.lang.Override
  public boolean getValidateOnly() {
    return validateOnly_;
  }

  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 {
    getSerializedSize();
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (registration_ != null) {
      output.writeMessage(2, getRegistration());
    }
    if (getContactNoticesList().size() > 0) {
      output.writeUInt32NoTag(26);
      output.writeUInt32NoTag(contactNoticesMemoizedSerializedSize);
    }
    for (int i = 0; i < contactNotices_.size(); i++) {
      output.writeEnumNoTag(contactNotices_.get(i));
    }
    if (yearlyPrice_ != null) {
      output.writeMessage(4, getYearlyPrice());
    }
    if (authorizationCode_ != null) {
      output.writeMessage(5, getAuthorizationCode());
    }
    if (validateOnly_ != false) {
      output.writeBool(6, validateOnly_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (registration_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRegistration());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < contactNotices_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(contactNotices_.get(i));
      }
      size += dataSize;
      if (!getContactNoticesList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
      }
      contactNoticesMemoizedSerializedSize = dataSize;
    }
    if (yearlyPrice_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getYearlyPrice());
    }
    if (authorizationCode_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAuthorizationCode());
    }
    if (validateOnly_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, validateOnly_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.domains.v1alpha2.TransferDomainRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.domains.v1alpha2.TransferDomainRequest other =
        (com.google.cloud.domains.v1alpha2.TransferDomainRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (hasRegistration() != other.hasRegistration()) return false;
    if (hasRegistration()) {
      if (!getRegistration().equals(other.getRegistration())) return false;
    }
    if (!contactNotices_.equals(other.contactNotices_)) return false;
    if (hasYearlyPrice() != other.hasYearlyPrice()) return false;
    if (hasYearlyPrice()) {
      if (!getYearlyPrice().equals(other.getYearlyPrice())) return false;
    }
    if (hasAuthorizationCode() != other.hasAuthorizationCode()) return false;
    if (hasAuthorizationCode()) {
      if (!getAuthorizationCode().equals(other.getAuthorizationCode())) return false;
    }
    if (getValidateOnly() != other.getValidateOnly()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (hasRegistration()) {
      hash = (37 * hash) + REGISTRATION_FIELD_NUMBER;
      hash = (53 * hash) + getRegistration().hashCode();
    }
    if (getContactNoticesCount() > 0) {
      hash = (37 * hash) + CONTACT_NOTICES_FIELD_NUMBER;
      hash = (53 * hash) + contactNotices_.hashCode();
    }
    if (hasYearlyPrice()) {
      hash = (37 * hash) + YEARLY_PRICE_FIELD_NUMBER;
      hash = (53 * hash) + getYearlyPrice().hashCode();
    }
    if (hasAuthorizationCode()) {
      hash = (37 * hash) + AUTHORIZATION_CODE_FIELD_NUMBER;
      hash = (53 * hash) + getAuthorizationCode().hashCode();
    }
    hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest 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.domains.v1alpha2.TransferDomainRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest 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.domains.v1alpha2.TransferDomainRequest 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>
   * Request for the `TransferDomain` method.
   * </pre>
   *
   * Protobuf type {@code google.cloud.domains.v1alpha2.TransferDomainRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.domains.v1alpha2.TransferDomainRequest)
      com.google.cloud.domains.v1alpha2.TransferDomainRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.domains.v1alpha2.DomainsProto
          .internal_static_google_cloud_domains_v1alpha2_TransferDomainRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.domains.v1alpha2.DomainsProto
          .internal_static_google_cloud_domains_v1alpha2_TransferDomainRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.domains.v1alpha2.TransferDomainRequest.class,
              com.google.cloud.domains.v1alpha2.TransferDomainRequest.Builder.class);
    }

    // Construct using com.google.cloud.domains.v1alpha2.TransferDomainRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      parent_ = "";

      if (registrationBuilder_ == null) {
        registration_ = null;
      } else {
        registration_ = null;
        registrationBuilder_ = null;
      }
      contactNotices_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000001);
      if (yearlyPriceBuilder_ == null) {
        yearlyPrice_ = null;
      } else {
        yearlyPrice_ = null;
        yearlyPriceBuilder_ = null;
      }
      if (authorizationCodeBuilder_ == null) {
        authorizationCode_ = null;
      } else {
        authorizationCode_ = null;
        authorizationCodeBuilder_ = null;
      }
      validateOnly_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.domains.v1alpha2.DomainsProto
          .internal_static_google_cloud_domains_v1alpha2_TransferDomainRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.domains.v1alpha2.TransferDomainRequest getDefaultInstanceForType() {
      return com.google.cloud.domains.v1alpha2.TransferDomainRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.domains.v1alpha2.TransferDomainRequest build() {
      com.google.cloud.domains.v1alpha2.TransferDomainRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.domains.v1alpha2.TransferDomainRequest buildPartial() {
      com.google.cloud.domains.v1alpha2.TransferDomainRequest result =
          new com.google.cloud.domains.v1alpha2.TransferDomainRequest(this);
      int from_bitField0_ = bitField0_;
      result.parent_ = parent_;
      if (registrationBuilder_ == null) {
        result.registration_ = registration_;
      } else {
        result.registration_ = registrationBuilder_.build();
      }
      if (((bitField0_ & 0x00000001) != 0)) {
        contactNotices_ = java.util.Collections.unmodifiableList(contactNotices_);
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.contactNotices_ = contactNotices_;
      if (yearlyPriceBuilder_ == null) {
        result.yearlyPrice_ = yearlyPrice_;
      } else {
        result.yearlyPrice_ = yearlyPriceBuilder_.build();
      }
      if (authorizationCodeBuilder_ == null) {
        result.authorizationCode_ = authorizationCode_;
      } else {
        result.authorizationCode_ = authorizationCodeBuilder_.build();
      }
      result.validateOnly_ = validateOnly_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.domains.v1alpha2.TransferDomainRequest) {
        return mergeFrom((com.google.cloud.domains.v1alpha2.TransferDomainRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.domains.v1alpha2.TransferDomainRequest other) {
      if (other == com.google.cloud.domains.v1alpha2.TransferDomainRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (other.hasRegistration()) {
        mergeRegistration(other.getRegistration());
      }
      if (!other.contactNotices_.isEmpty()) {
        if (contactNotices_.isEmpty()) {
          contactNotices_ = other.contactNotices_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureContactNoticesIsMutable();
          contactNotices_.addAll(other.contactNotices_);
        }
        onChanged();
      }
      if (other.hasYearlyPrice()) {
        mergeYearlyPrice(other.getYearlyPrice());
      }
      if (other.hasAuthorizationCode()) {
        mergeAuthorizationCode(other.getAuthorizationCode());
      }
      if (other.getValidateOnly() != false) {
        setValidateOnly(other.getValidateOnly());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.domains.v1alpha2.TransferDomainRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.domains.v1alpha2.TransferDomainRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The parent resource of the `Registration`. Must be in the
     * format `projects/&#42;&#47;locations/&#42;`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The parent resource of the `Registration`. Must be in the
     * format `projects/&#42;&#47;locations/&#42;`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The parent resource of the `Registration`. Must be in the
     * format `projects/&#42;&#47;locations/&#42;`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The parent resource of the `Registration`. Must be in the
     * format `projects/&#42;&#47;locations/&#42;`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The parent resource of the `Registration`. Must be in the
     * format `projects/&#42;&#47;locations/&#42;`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      parent_ = value;
      onChanged();
      return this;
    }

    private com.google.cloud.domains.v1alpha2.Registration registration_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.domains.v1alpha2.Registration,
            com.google.cloud.domains.v1alpha2.Registration.Builder,
            com.google.cloud.domains.v1alpha2.RegistrationOrBuilder>
        registrationBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the registration field is set.
     */
    public boolean hasRegistration() {
      return registrationBuilder_ != null || registration_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The registration.
     */
    public com.google.cloud.domains.v1alpha2.Registration getRegistration() {
      if (registrationBuilder_ == null) {
        return registration_ == null
            ? com.google.cloud.domains.v1alpha2.Registration.getDefaultInstance()
            : registration_;
      } else {
        return registrationBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setRegistration(com.google.cloud.domains.v1alpha2.Registration value) {
      if (registrationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        registration_ = value;
        onChanged();
      } else {
        registrationBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setRegistration(
        com.google.cloud.domains.v1alpha2.Registration.Builder builderForValue) {
      if (registrationBuilder_ == null) {
        registration_ = builderForValue.build();
        onChanged();
      } else {
        registrationBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeRegistration(com.google.cloud.domains.v1alpha2.Registration value) {
      if (registrationBuilder_ == null) {
        if (registration_ != null) {
          registration_ =
              com.google.cloud.domains.v1alpha2.Registration.newBuilder(registration_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          registration_ = value;
        }
        onChanged();
      } else {
        registrationBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearRegistration() {
      if (registrationBuilder_ == null) {
        registration_ = null;
        onChanged();
      } else {
        registration_ = null;
        registrationBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.domains.v1alpha2.Registration.Builder getRegistrationBuilder() {

      onChanged();
      return getRegistrationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.domains.v1alpha2.RegistrationOrBuilder getRegistrationOrBuilder() {
      if (registrationBuilder_ != null) {
        return registrationBuilder_.getMessageOrBuilder();
      } else {
        return registration_ == null
            ? com.google.cloud.domains.v1alpha2.Registration.getDefaultInstance()
            : registration_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The complete `Registration` resource to be created.
     * You can leave `registration.dns_settings` unset to import the
     * domain's current DNS configuration from its current registrar. Use this
     * option only if you are sure that the domain's current DNS service
     * does not cease upon transfer, as is often the case for DNS services
     * provided for free by the registrar.
     * </pre>
     *
     * <code>
     * .google.cloud.domains.v1alpha2.Registration registration = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.domains.v1alpha2.Registration,
            com.google.cloud.domains.v1alpha2.Registration.Builder,
            com.google.cloud.domains.v1alpha2.RegistrationOrBuilder>
        getRegistrationFieldBuilder() {
      if (registrationBuilder_ == null) {
        registrationBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.domains.v1alpha2.Registration,
                com.google.cloud.domains.v1alpha2.Registration.Builder,
                com.google.cloud.domains.v1alpha2.RegistrationOrBuilder>(
                getRegistration(), getParentForChildren(), isClean());
        registration_ = null;
      }
      return registrationBuilder_;
    }

    private java.util.List<java.lang.Integer> contactNotices_ = java.util.Collections.emptyList();

    private void ensureContactNoticesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        contactNotices_ = new java.util.ArrayList<java.lang.Integer>(contactNotices_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @return A list containing the contactNotices.
     */
    public java.util.List<com.google.cloud.domains.v1alpha2.ContactNotice> getContactNoticesList() {
      return new com.google.protobuf.Internal.ListAdapter<
          java.lang.Integer, com.google.cloud.domains.v1alpha2.ContactNotice>(
          contactNotices_, contactNotices_converter_);
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @return The count of contactNotices.
     */
    public int getContactNoticesCount() {
      return contactNotices_.size();
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The contactNotices at the given index.
     */
    public com.google.cloud.domains.v1alpha2.ContactNotice getContactNotices(int index) {
      return contactNotices_converter_.convert(contactNotices_.get(index));
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param index The index to set the value at.
     * @param value The contactNotices to set.
     * @return This builder for chaining.
     */
    public Builder setContactNotices(
        int index, com.google.cloud.domains.v1alpha2.ContactNotice value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureContactNoticesIsMutable();
      contactNotices_.set(index, value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param value The contactNotices to add.
     * @return This builder for chaining.
     */
    public Builder addContactNotices(com.google.cloud.domains.v1alpha2.ContactNotice value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureContactNoticesIsMutable();
      contactNotices_.add(value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param values The contactNotices to add.
     * @return This builder for chaining.
     */
    public Builder addAllContactNotices(
        java.lang.Iterable<? extends com.google.cloud.domains.v1alpha2.ContactNotice> values) {
      ensureContactNoticesIsMutable();
      for (com.google.cloud.domains.v1alpha2.ContactNotice value : values) {
        contactNotices_.add(value.getNumber());
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearContactNotices() {
      contactNotices_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @return A list containing the enum numeric values on the wire for contactNotices.
     */
    public java.util.List<java.lang.Integer> getContactNoticesValueList() {
      return java.util.Collections.unmodifiableList(contactNotices_);
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The enum numeric value on the wire of contactNotices at the given index.
     */
    public int getContactNoticesValue(int index) {
      return contactNotices_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The enum numeric value on the wire of contactNotices at the given index.
     * @return This builder for chaining.
     */
    public Builder setContactNoticesValue(int index, int value) {
      ensureContactNoticesIsMutable();
      contactNotices_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param value The enum numeric value on the wire for contactNotices to add.
     * @return This builder for chaining.
     */
    public Builder addContactNoticesValue(int value) {
      ensureContactNoticesIsMutable();
      contactNotices_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of contact notices that you acknowledge. The notices
     * needed here depend on the values specified in
     * `registration.contact_settings`.
     * </pre>
     *
     * <code>repeated .google.cloud.domains.v1alpha2.ContactNotice contact_notices = 3;</code>
     *
     * @param values The enum numeric values on the wire for contactNotices to add.
     * @return This builder for chaining.
     */
    public Builder addAllContactNoticesValue(java.lang.Iterable<java.lang.Integer> values) {
      ensureContactNoticesIsMutable();
      for (int value : values) {
        contactNotices_.add(value);
      }
      onChanged();
      return this;
    }

    private com.google.type.Money yearlyPrice_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder>
        yearlyPriceBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return Whether the yearlyPrice field is set.
     */
    public boolean hasYearlyPrice() {
      return yearlyPriceBuilder_ != null || yearlyPrice_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The yearlyPrice.
     */
    public com.google.type.Money getYearlyPrice() {
      if (yearlyPriceBuilder_ == null) {
        return yearlyPrice_ == null ? com.google.type.Money.getDefaultInstance() : yearlyPrice_;
      } else {
        return yearlyPriceBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public Builder setYearlyPrice(com.google.type.Money value) {
      if (yearlyPriceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        yearlyPrice_ = value;
        onChanged();
      } else {
        yearlyPriceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public Builder setYearlyPrice(com.google.type.Money.Builder builderForValue) {
      if (yearlyPriceBuilder_ == null) {
        yearlyPrice_ = builderForValue.build();
        onChanged();
      } else {
        yearlyPriceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public Builder mergeYearlyPrice(com.google.type.Money value) {
      if (yearlyPriceBuilder_ == null) {
        if (yearlyPrice_ != null) {
          yearlyPrice_ =
              com.google.type.Money.newBuilder(yearlyPrice_).mergeFrom(value).buildPartial();
        } else {
          yearlyPrice_ = value;
        }
        onChanged();
      } else {
        yearlyPriceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public Builder clearYearlyPrice() {
      if (yearlyPriceBuilder_ == null) {
        yearlyPrice_ = null;
        onChanged();
      } else {
        yearlyPrice_ = null;
        yearlyPriceBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public com.google.type.Money.Builder getYearlyPriceBuilder() {

      onChanged();
      return getYearlyPriceFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    public com.google.type.MoneyOrBuilder getYearlyPriceOrBuilder() {
      if (yearlyPriceBuilder_ != null) {
        return yearlyPriceBuilder_.getMessageOrBuilder();
      } else {
        return yearlyPrice_ == null ? com.google.type.Money.getDefaultInstance() : yearlyPrice_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Acknowledgement of the price to transfer or renew the domain for one year.
     * Call `RetrieveTransferParameters` to obtain the price, which you must
     * acknowledge.
     * </pre>
     *
     * <code>.google.type.Money yearly_price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder>
        getYearlyPriceFieldBuilder() {
      if (yearlyPriceBuilder_ == null) {
        yearlyPriceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.type.Money,
                com.google.type.Money.Builder,
                com.google.type.MoneyOrBuilder>(
                getYearlyPrice(), getParentForChildren(), isClean());
        yearlyPrice_ = null;
      }
      return yearlyPriceBuilder_;
    }

    private com.google.cloud.domains.v1alpha2.AuthorizationCode authorizationCode_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.domains.v1alpha2.AuthorizationCode,
            com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder,
            com.google.cloud.domains.v1alpha2.AuthorizationCodeOrBuilder>
        authorizationCodeBuilder_;
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     *
     * @return Whether the authorizationCode field is set.
     */
    public boolean hasAuthorizationCode() {
      return authorizationCodeBuilder_ != null || authorizationCode_ != null;
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     *
     * @return The authorizationCode.
     */
    public com.google.cloud.domains.v1alpha2.AuthorizationCode getAuthorizationCode() {
      if (authorizationCodeBuilder_ == null) {
        return authorizationCode_ == null
            ? com.google.cloud.domains.v1alpha2.AuthorizationCode.getDefaultInstance()
            : authorizationCode_;
      } else {
        return authorizationCodeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public Builder setAuthorizationCode(com.google.cloud.domains.v1alpha2.AuthorizationCode value) {
      if (authorizationCodeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        authorizationCode_ = value;
        onChanged();
      } else {
        authorizationCodeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public Builder setAuthorizationCode(
        com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder builderForValue) {
      if (authorizationCodeBuilder_ == null) {
        authorizationCode_ = builderForValue.build();
        onChanged();
      } else {
        authorizationCodeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public Builder mergeAuthorizationCode(
        com.google.cloud.domains.v1alpha2.AuthorizationCode value) {
      if (authorizationCodeBuilder_ == null) {
        if (authorizationCode_ != null) {
          authorizationCode_ =
              com.google.cloud.domains.v1alpha2.AuthorizationCode.newBuilder(authorizationCode_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          authorizationCode_ = value;
        }
        onChanged();
      } else {
        authorizationCodeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public Builder clearAuthorizationCode() {
      if (authorizationCodeBuilder_ == null) {
        authorizationCode_ = null;
        onChanged();
      } else {
        authorizationCode_ = null;
        authorizationCodeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder
        getAuthorizationCodeBuilder() {

      onChanged();
      return getAuthorizationCodeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    public com.google.cloud.domains.v1alpha2.AuthorizationCodeOrBuilder
        getAuthorizationCodeOrBuilder() {
      if (authorizationCodeBuilder_ != null) {
        return authorizationCodeBuilder_.getMessageOrBuilder();
      } else {
        return authorizationCode_ == null
            ? com.google.cloud.domains.v1alpha2.AuthorizationCode.getDefaultInstance()
            : authorizationCode_;
      }
    }
    /**
     *
     *
     * <pre>
     * The domain's transfer authorization code. You can obtain this from the
     * domain's current registrar.
     * </pre>
     *
     * <code>.google.cloud.domains.v1alpha2.AuthorizationCode authorization_code = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.domains.v1alpha2.AuthorizationCode,
            com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder,
            com.google.cloud.domains.v1alpha2.AuthorizationCodeOrBuilder>
        getAuthorizationCodeFieldBuilder() {
      if (authorizationCodeBuilder_ == null) {
        authorizationCodeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.domains.v1alpha2.AuthorizationCode,
                com.google.cloud.domains.v1alpha2.AuthorizationCode.Builder,
                com.google.cloud.domains.v1alpha2.AuthorizationCodeOrBuilder>(
                getAuthorizationCode(), getParentForChildren(), isClean());
        authorizationCode_ = null;
      }
      return authorizationCodeBuilder_;
    }

    private boolean validateOnly_;
    /**
     *
     *
     * <pre>
     * Validate the request without actually transferring the domain.
     * </pre>
     *
     * <code>bool validate_only = 6;</code>
     *
     * @return The validateOnly.
     */
    @java.lang.Override
    public boolean getValidateOnly() {
      return validateOnly_;
    }
    /**
     *
     *
     * <pre>
     * Validate the request without actually transferring the domain.
     * </pre>
     *
     * <code>bool validate_only = 6;</code>
     *
     * @param value The validateOnly to set.
     * @return This builder for chaining.
     */
    public Builder setValidateOnly(boolean value) {

      validateOnly_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Validate the request without actually transferring the domain.
     * </pre>
     *
     * <code>bool validate_only = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearValidateOnly() {

      validateOnly_ = 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.domains.v1alpha2.TransferDomainRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.domains.v1alpha2.TransferDomainRequest)
  private static final com.google.cloud.domains.v1alpha2.TransferDomainRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.domains.v1alpha2.TransferDomainRequest();
  }

  public static com.google.cloud.domains.v1alpha2.TransferDomainRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.domains.v1alpha2.TransferDomainRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
