// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/talent/v4beta1/tenant_service.proto

package com.google.cloud.talent.v4beta1;

/**
 *
 *
 * <pre>
 * Output only.
 * The List tenants response object.
 * </pre>
 *
 * Protobuf type {@code google.cloud.talent.v4beta1.ListTenantsResponse}
 */
public final class ListTenantsResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.talent.v4beta1.ListTenantsResponse)
    ListTenantsResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListTenantsResponse.newBuilder() to construct.
  private ListTenantsResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListTenantsResponse() {
    tenants_ = java.util.Collections.emptyList();
    nextPageToken_ = "";
  }

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

  private ListTenantsResponse(
      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:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                tenants_ = new java.util.ArrayList<com.google.cloud.talent.v4beta1.Tenant>();
                mutable_bitField0_ |= 0x00000001;
              }
              tenants_.add(
                  input.readMessage(
                      com.google.cloud.talent.v4beta1.Tenant.parser(), extensionRegistry));
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              nextPageToken_ = s;
              break;
            }
          case 26:
            {
              com.google.cloud.talent.v4beta1.ResponseMetadata.Builder subBuilder = null;
              if (metadata_ != null) {
                subBuilder = metadata_.toBuilder();
              }
              metadata_ =
                  input.readMessage(
                      com.google.cloud.talent.v4beta1.ResponseMetadata.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(metadata_);
                metadata_ = subBuilder.buildPartial();
              }

              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)) {
        tenants_ = java.util.Collections.unmodifiableList(tenants_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.talent.v4beta1.TenantServiceProto
        .internal_static_google_cloud_talent_v4beta1_ListTenantsResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.talent.v4beta1.TenantServiceProto
        .internal_static_google_cloud_talent_v4beta1_ListTenantsResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.talent.v4beta1.ListTenantsResponse.class,
            com.google.cloud.talent.v4beta1.ListTenantsResponse.Builder.class);
  }

  private int bitField0_;
  public static final int TENANTS_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.talent.v4beta1.Tenant> tenants_;
  /**
   *
   *
   * <pre>
   * Tenants for the current client.
   * </pre>
   *
   * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
   */
  public java.util.List<com.google.cloud.talent.v4beta1.Tenant> getTenantsList() {
    return tenants_;
  }
  /**
   *
   *
   * <pre>
   * Tenants for the current client.
   * </pre>
   *
   * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
   */
  public java.util.List<? extends com.google.cloud.talent.v4beta1.TenantOrBuilder>
      getTenantsOrBuilderList() {
    return tenants_;
  }
  /**
   *
   *
   * <pre>
   * Tenants for the current client.
   * </pre>
   *
   * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
   */
  public int getTenantsCount() {
    return tenants_.size();
  }
  /**
   *
   *
   * <pre>
   * Tenants for the current client.
   * </pre>
   *
   * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
   */
  public com.google.cloud.talent.v4beta1.Tenant getTenants(int index) {
    return tenants_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Tenants for the current client.
   * </pre>
   *
   * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
   */
  public com.google.cloud.talent.v4beta1.TenantOrBuilder getTenantsOrBuilder(int index) {
    return tenants_.get(index);
  }

  public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
  private volatile java.lang.Object nextPageToken_;
  /**
   *
   *
   * <pre>
   * A token to retrieve the next page of results.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   */
  public java.lang.String getNextPageToken() {
    java.lang.Object ref = nextPageToken_;
    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();
      nextPageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A token to retrieve the next page of results.
   * </pre>
   *
   * <code>string next_page_token = 2;</code>
   */
  public com.google.protobuf.ByteString getNextPageTokenBytes() {
    java.lang.Object ref = nextPageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      nextPageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int METADATA_FIELD_NUMBER = 3;
  private com.google.cloud.talent.v4beta1.ResponseMetadata metadata_;
  /**
   *
   *
   * <pre>
   * Additional information for the API invocation, such as the request
   * tracking id.
   * </pre>
   *
   * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
   */
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   *
   *
   * <pre>
   * Additional information for the API invocation, such as the request
   * tracking id.
   * </pre>
   *
   * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
   */
  public com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata() {
    return metadata_ == null
        ? com.google.cloud.talent.v4beta1.ResponseMetadata.getDefaultInstance()
        : metadata_;
  }
  /**
   *
   *
   * <pre>
   * Additional information for the API invocation, such as the request
   * tracking id.
   * </pre>
   *
   * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
   */
  public com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder getMetadataOrBuilder() {
    return getMetadata();
  }

  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 {
    for (int i = 0; i < tenants_.size(); i++) {
      output.writeMessage(1, tenants_.get(i));
    }
    if (!getNextPageTokenBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    }
    if (metadata_ != null) {
      output.writeMessage(3, getMetadata());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < tenants_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tenants_.get(i));
    }
    if (!getNextPageTokenBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    }
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata());
    }
    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.talent.v4beta1.ListTenantsResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.talent.v4beta1.ListTenantsResponse other =
        (com.google.cloud.talent.v4beta1.ListTenantsResponse) obj;

    if (!getTenantsList().equals(other.getTenantsList())) return false;
    if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    if (hasMetadata() != other.hasMetadata()) return false;
    if (hasMetadata()) {
      if (!getMetadata().equals(other.getMetadata())) 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();
    if (getTenantsCount() > 0) {
      hash = (37 * hash) + TENANTS_FIELD_NUMBER;
      hash = (53 * hash) + getTenantsList().hashCode();
    }
    hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getNextPageToken().hashCode();
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.talent.v4beta1.ListTenantsResponse parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

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

  public static com.google.cloud.talent.v4beta1.ListTenantsResponse 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.talent.v4beta1.ListTenantsResponse 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>
   * Output only.
   * The List tenants response object.
   * </pre>
   *
   * Protobuf type {@code google.cloud.talent.v4beta1.ListTenantsResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.talent.v4beta1.ListTenantsResponse)
      com.google.cloud.talent.v4beta1.ListTenantsResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.TenantServiceProto
          .internal_static_google_cloud_talent_v4beta1_ListTenantsResponse_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.talent.v4beta1.TenantServiceProto
          .internal_static_google_cloud_talent_v4beta1_ListTenantsResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.talent.v4beta1.ListTenantsResponse.class,
              com.google.cloud.talent.v4beta1.ListTenantsResponse.Builder.class);
    }

    // Construct using com.google.cloud.talent.v4beta1.ListTenantsResponse.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (tenantsBuilder_ == null) {
        tenants_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        tenantsBuilder_.clear();
      }
      nextPageToken_ = "";

      if (metadataBuilder_ == null) {
        metadata_ = null;
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.talent.v4beta1.TenantServiceProto
          .internal_static_google_cloud_talent_v4beta1_ListTenantsResponse_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.ListTenantsResponse getDefaultInstanceForType() {
      return com.google.cloud.talent.v4beta1.ListTenantsResponse.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.ListTenantsResponse buildPartial() {
      com.google.cloud.talent.v4beta1.ListTenantsResponse result =
          new com.google.cloud.talent.v4beta1.ListTenantsResponse(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (tenantsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          tenants_ = java.util.Collections.unmodifiableList(tenants_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.tenants_ = tenants_;
      } else {
        result.tenants_ = tenantsBuilder_.build();
      }
      result.nextPageToken_ = nextPageToken_;
      if (metadataBuilder_ == null) {
        result.metadata_ = metadata_;
      } else {
        result.metadata_ = metadataBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      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.talent.v4beta1.ListTenantsResponse) {
        return mergeFrom((com.google.cloud.talent.v4beta1.ListTenantsResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.talent.v4beta1.ListTenantsResponse other) {
      if (other == com.google.cloud.talent.v4beta1.ListTenantsResponse.getDefaultInstance())
        return this;
      if (tenantsBuilder_ == null) {
        if (!other.tenants_.isEmpty()) {
          if (tenants_.isEmpty()) {
            tenants_ = other.tenants_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureTenantsIsMutable();
            tenants_.addAll(other.tenants_);
          }
          onChanged();
        }
      } else {
        if (!other.tenants_.isEmpty()) {
          if (tenantsBuilder_.isEmpty()) {
            tenantsBuilder_.dispose();
            tenantsBuilder_ = null;
            tenants_ = other.tenants_;
            bitField0_ = (bitField0_ & ~0x00000001);
            tenantsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getTenantsFieldBuilder()
                    : null;
          } else {
            tenantsBuilder_.addAllMessages(other.tenants_);
          }
        }
      }
      if (!other.getNextPageToken().isEmpty()) {
        nextPageToken_ = other.nextPageToken_;
        onChanged();
      }
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      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.talent.v4beta1.ListTenantsResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.talent.v4beta1.ListTenantsResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.talent.v4beta1.Tenant> tenants_ =
        java.util.Collections.emptyList();

    private void ensureTenantsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        tenants_ = new java.util.ArrayList<com.google.cloud.talent.v4beta1.Tenant>(tenants_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.talent.v4beta1.Tenant,
            com.google.cloud.talent.v4beta1.Tenant.Builder,
            com.google.cloud.talent.v4beta1.TenantOrBuilder>
        tenantsBuilder_;

    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public java.util.List<com.google.cloud.talent.v4beta1.Tenant> getTenantsList() {
      if (tenantsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(tenants_);
      } else {
        return tenantsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public int getTenantsCount() {
      if (tenantsBuilder_ == null) {
        return tenants_.size();
      } else {
        return tenantsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.Tenant getTenants(int index) {
      if (tenantsBuilder_ == null) {
        return tenants_.get(index);
      } else {
        return tenantsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder setTenants(int index, com.google.cloud.talent.v4beta1.Tenant value) {
      if (tenantsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTenantsIsMutable();
        tenants_.set(index, value);
        onChanged();
      } else {
        tenantsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder setTenants(
        int index, com.google.cloud.talent.v4beta1.Tenant.Builder builderForValue) {
      if (tenantsBuilder_ == null) {
        ensureTenantsIsMutable();
        tenants_.set(index, builderForValue.build());
        onChanged();
      } else {
        tenantsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder addTenants(com.google.cloud.talent.v4beta1.Tenant value) {
      if (tenantsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTenantsIsMutable();
        tenants_.add(value);
        onChanged();
      } else {
        tenantsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder addTenants(int index, com.google.cloud.talent.v4beta1.Tenant value) {
      if (tenantsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTenantsIsMutable();
        tenants_.add(index, value);
        onChanged();
      } else {
        tenantsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder addTenants(com.google.cloud.talent.v4beta1.Tenant.Builder builderForValue) {
      if (tenantsBuilder_ == null) {
        ensureTenantsIsMutable();
        tenants_.add(builderForValue.build());
        onChanged();
      } else {
        tenantsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder addTenants(
        int index, com.google.cloud.talent.v4beta1.Tenant.Builder builderForValue) {
      if (tenantsBuilder_ == null) {
        ensureTenantsIsMutable();
        tenants_.add(index, builderForValue.build());
        onChanged();
      } else {
        tenantsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder addAllTenants(
        java.lang.Iterable<? extends com.google.cloud.talent.v4beta1.Tenant> values) {
      if (tenantsBuilder_ == null) {
        ensureTenantsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tenants_);
        onChanged();
      } else {
        tenantsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder clearTenants() {
      if (tenantsBuilder_ == null) {
        tenants_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        tenantsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public Builder removeTenants(int index) {
      if (tenantsBuilder_ == null) {
        ensureTenantsIsMutable();
        tenants_.remove(index);
        onChanged();
      } else {
        tenantsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.Tenant.Builder getTenantsBuilder(int index) {
      return getTenantsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.TenantOrBuilder getTenantsOrBuilder(int index) {
      if (tenantsBuilder_ == null) {
        return tenants_.get(index);
      } else {
        return tenantsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.talent.v4beta1.TenantOrBuilder>
        getTenantsOrBuilderList() {
      if (tenantsBuilder_ != null) {
        return tenantsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(tenants_);
      }
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.Tenant.Builder addTenantsBuilder() {
      return getTenantsFieldBuilder()
          .addBuilder(com.google.cloud.talent.v4beta1.Tenant.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.Tenant.Builder addTenantsBuilder(int index) {
      return getTenantsFieldBuilder()
          .addBuilder(index, com.google.cloud.talent.v4beta1.Tenant.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Tenants for the current client.
     * </pre>
     *
     * <code>repeated .google.cloud.talent.v4beta1.Tenant tenants = 1;</code>
     */
    public java.util.List<com.google.cloud.talent.v4beta1.Tenant.Builder> getTenantsBuilderList() {
      return getTenantsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.talent.v4beta1.Tenant,
            com.google.cloud.talent.v4beta1.Tenant.Builder,
            com.google.cloud.talent.v4beta1.TenantOrBuilder>
        getTenantsFieldBuilder() {
      if (tenantsBuilder_ == null) {
        tenantsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.talent.v4beta1.Tenant,
                com.google.cloud.talent.v4beta1.Tenant.Builder,
                com.google.cloud.talent.v4beta1.TenantOrBuilder>(
                tenants_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        tenants_ = null;
      }
      return tenantsBuilder_;
    }

    private java.lang.Object nextPageToken_ = "";
    /**
     *
     *
     * <pre>
     * A token to retrieve the next page of results.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     */
    public java.lang.String getNextPageToken() {
      java.lang.Object ref = nextPageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        nextPageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A token to retrieve the next page of results.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     */
    public com.google.protobuf.ByteString getNextPageTokenBytes() {
      java.lang.Object ref = nextPageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        nextPageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A token to retrieve the next page of results.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     */
    public Builder setNextPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      nextPageToken_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A token to retrieve the next page of results.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     */
    public Builder clearNextPageToken() {

      nextPageToken_ = getDefaultInstance().getNextPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A token to retrieve the next page of results.
     * </pre>
     *
     * <code>string next_page_token = 2;</code>
     */
    public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.cloud.talent.v4beta1.ResponseMetadata metadata_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.talent.v4beta1.ResponseMetadata,
            com.google.cloud.talent.v4beta1.ResponseMetadata.Builder,
            com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder>
        metadataBuilder_;
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public boolean hasMetadata() {
      return metadataBuilder_ != null || metadata_ != null;
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null
            ? com.google.cloud.talent.v4beta1.ResponseMetadata.getDefaultInstance()
            : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public Builder setMetadata(com.google.cloud.talent.v4beta1.ResponseMetadata value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
        onChanged();
      } else {
        metadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public Builder setMetadata(
        com.google.cloud.talent.v4beta1.ResponseMetadata.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
        onChanged();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public Builder mergeMetadata(com.google.cloud.talent.v4beta1.ResponseMetadata value) {
      if (metadataBuilder_ == null) {
        if (metadata_ != null) {
          metadata_ =
              com.google.cloud.talent.v4beta1.ResponseMetadata.newBuilder(metadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          metadata_ = value;
        }
        onChanged();
      } else {
        metadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public Builder clearMetadata() {
      if (metadataBuilder_ == null) {
        metadata_ = null;
        onChanged();
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public com.google.cloud.talent.v4beta1.ResponseMetadata.Builder getMetadataBuilder() {

      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    public com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null
            ? com.google.cloud.talent.v4beta1.ResponseMetadata.getDefaultInstance()
            : metadata_;
      }
    }
    /**
     *
     *
     * <pre>
     * Additional information for the API invocation, such as the request
     * tracking id.
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.ResponseMetadata metadata = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.talent.v4beta1.ResponseMetadata,
            com.google.cloud.talent.v4beta1.ResponseMetadata.Builder,
            com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder>
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.talent.v4beta1.ResponseMetadata,
                com.google.cloud.talent.v4beta1.ResponseMetadata.Builder,
                com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder>(
                getMetadata(), getParentForChildren(), isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    @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.talent.v4beta1.ListTenantsResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListTenantsResponse)
  private static final com.google.cloud.talent.v4beta1.ListTenantsResponse DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.talent.v4beta1.ListTenantsResponse();
  }

  public static com.google.cloud.talent.v4beta1.ListTenantsResponse getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.talent.v4beta1.ListTenantsResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
