/*
 * 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/asset/v1/asset_service.proto

package com.google.cloud.asset.v1;

/**
 *
 *
 * <pre>
 * A request message for
 * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
 * </pre>
 *
 * Protobuf type {@code google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest}
 */
public final class AnalyzeIamPolicyLongrunningRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest)
    AnalyzeIamPolicyLongrunningRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use AnalyzeIamPolicyLongrunningRequest.newBuilder() to construct.
  private AnalyzeIamPolicyLongrunningRequest(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private AnalyzeIamPolicyLongrunningRequest() {
    savedAnalysisQuery_ = "";
  }

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

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.asset.v1.AssetServiceProto
        .internal_static_google_cloud_asset_v1_AnalyzeIamPolicyLongrunningRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.asset.v1.AssetServiceProto
        .internal_static_google_cloud_asset_v1_AnalyzeIamPolicyLongrunningRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.class,
            com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.Builder.class);
  }

  public static final int ANALYSIS_QUERY_FIELD_NUMBER = 1;
  private com.google.cloud.asset.v1.IamPolicyAnalysisQuery analysisQuery_;
  /**
   *
   *
   * <pre>
   * Required. The request query.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the analysisQuery field is set.
   */
  @java.lang.Override
  public boolean hasAnalysisQuery() {
    return analysisQuery_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. The request query.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The analysisQuery.
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.IamPolicyAnalysisQuery getAnalysisQuery() {
    return analysisQuery_ == null
        ? com.google.cloud.asset.v1.IamPolicyAnalysisQuery.getDefaultInstance()
        : analysisQuery_;
  }
  /**
   *
   *
   * <pre>
   * Required. The request query.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.IamPolicyAnalysisQueryOrBuilder getAnalysisQueryOrBuilder() {
    return analysisQuery_ == null
        ? com.google.cloud.asset.v1.IamPolicyAnalysisQuery.getDefaultInstance()
        : analysisQuery_;
  }

  public static final int SAVED_ANALYSIS_QUERY_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object savedAnalysisQuery_ = "";
  /**
   *
   *
   * <pre>
   * Optional. The name of a saved query, which must be in the format of:
   * * projects/project_number/savedQueries/saved_query_id
   * * folders/folder_number/savedQueries/saved_query_id
   * * organizations/organization_number/savedQueries/saved_query_id
   * If both `analysis_query` and `saved_analysis_query` are provided, they
   * will be merged together with the `saved_analysis_query` as base and
   * the `analysis_query` as overrides. For more details of the merge behavior,
   * please refer to the
   * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
   * doc.
   * Note that you cannot override primitive fields with default value, such as
   * 0 or empty string, etc., because we use proto3, which doesn't support field
   * presence yet.
   * </pre>
   *
   * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The savedAnalysisQuery.
   */
  @java.lang.Override
  public java.lang.String getSavedAnalysisQuery() {
    java.lang.Object ref = savedAnalysisQuery_;
    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();
      savedAnalysisQuery_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The name of a saved query, which must be in the format of:
   * * projects/project_number/savedQueries/saved_query_id
   * * folders/folder_number/savedQueries/saved_query_id
   * * organizations/organization_number/savedQueries/saved_query_id
   * If both `analysis_query` and `saved_analysis_query` are provided, they
   * will be merged together with the `saved_analysis_query` as base and
   * the `analysis_query` as overrides. For more details of the merge behavior,
   * please refer to the
   * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
   * doc.
   * Note that you cannot override primitive fields with default value, such as
   * 0 or empty string, etc., because we use proto3, which doesn't support field
   * presence yet.
   * </pre>
   *
   * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for savedAnalysisQuery.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSavedAnalysisQueryBytes() {
    java.lang.Object ref = savedAnalysisQuery_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      savedAnalysisQuery_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2;
  private com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig outputConfig_;
  /**
   *
   *
   * <pre>
   * Required. Output configuration indicating where the results will be output
   * to.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the outputConfig field is set.
   */
  @java.lang.Override
  public boolean hasOutputConfig() {
    return outputConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Output configuration indicating where the results will be output
   * to.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The outputConfig.
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig getOutputConfig() {
    return outputConfig_ == null
        ? com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.getDefaultInstance()
        : outputConfig_;
  }
  /**
   *
   *
   * <pre>
   * Required. Output configuration indicating where the results will be output
   * to.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfigOrBuilder
      getOutputConfigOrBuilder() {
    return outputConfig_ == null
        ? com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.getDefaultInstance()
        : outputConfig_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (analysisQuery_ != null) {
      output.writeMessage(1, getAnalysisQuery());
    }
    if (outputConfig_ != null) {
      output.writeMessage(2, getOutputConfig());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(savedAnalysisQuery_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, savedAnalysisQuery_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (analysisQuery_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAnalysisQuery());
    }
    if (outputConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputConfig());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(savedAnalysisQuery_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, savedAnalysisQuery_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (hasAnalysisQuery() != other.hasAnalysisQuery()) return false;
    if (hasAnalysisQuery()) {
      if (!getAnalysisQuery().equals(other.getAnalysisQuery())) return false;
    }
    if (!getSavedAnalysisQuery().equals(other.getSavedAnalysisQuery())) return false;
    if (hasOutputConfig() != other.hasOutputConfig()) return false;
    if (hasOutputConfig()) {
      if (!getOutputConfig().equals(other.getOutputConfig())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasAnalysisQuery()) {
      hash = (37 * hash) + ANALYSIS_QUERY_FIELD_NUMBER;
      hash = (53 * hash) + getAnalysisQuery().hashCode();
    }
    hash = (37 * hash) + SAVED_ANALYSIS_QUERY_FIELD_NUMBER;
    hash = (53 * hash) + getSavedAnalysisQuery().hashCode();
    if (hasOutputConfig()) {
      hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getOutputConfig().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest 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.asset.v1.AnalyzeIamPolicyLongrunningRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * A request message for
   * [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
   * </pre>
   *
   * Protobuf type {@code google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest)
      com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_AnalyzeIamPolicyLongrunningRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_AnalyzeIamPolicyLongrunningRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.class,
              com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.Builder.class);
    }

    // Construct using com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      analysisQuery_ = null;
      if (analysisQueryBuilder_ != null) {
        analysisQueryBuilder_.dispose();
        analysisQueryBuilder_ = null;
      }
      savedAnalysisQuery_ = "";
      outputConfig_ = null;
      if (outputConfigBuilder_ != null) {
        outputConfigBuilder_.dispose();
        outputConfigBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_AnalyzeIamPolicyLongrunningRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest
        getDefaultInstanceForType() {
      return com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.getDefaultInstance();
    }

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

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

    private void buildPartial0(
        com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.analysisQuery_ =
            analysisQueryBuilder_ == null ? analysisQuery_ : analysisQueryBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.savedAnalysisQuery_ = savedAnalysisQuery_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.outputConfig_ =
            outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build();
      }
    }

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

    public Builder mergeFrom(com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest other) {
      if (other
          == com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.getDefaultInstance())
        return this;
      if (other.hasAnalysisQuery()) {
        mergeAnalysisQuery(other.getAnalysisQuery());
      }
      if (!other.getSavedAnalysisQuery().isEmpty()) {
        savedAnalysisQuery_ = other.savedAnalysisQuery_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.hasOutputConfig()) {
        mergeOutputConfig(other.getOutputConfig());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                input.readMessage(getAnalysisQueryFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 18
            case 26:
              {
                savedAnalysisQuery_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 26
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private com.google.cloud.asset.v1.IamPolicyAnalysisQuery analysisQuery_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.IamPolicyAnalysisQuery,
            com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Builder,
            com.google.cloud.asset.v1.IamPolicyAnalysisQueryOrBuilder>
        analysisQueryBuilder_;
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the analysisQuery field is set.
     */
    public boolean hasAnalysisQuery() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The analysisQuery.
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisQuery getAnalysisQuery() {
      if (analysisQueryBuilder_ == null) {
        return analysisQuery_ == null
            ? com.google.cloud.asset.v1.IamPolicyAnalysisQuery.getDefaultInstance()
            : analysisQuery_;
      } else {
        return analysisQueryBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setAnalysisQuery(com.google.cloud.asset.v1.IamPolicyAnalysisQuery value) {
      if (analysisQueryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        analysisQuery_ = value;
      } else {
        analysisQueryBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setAnalysisQuery(
        com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Builder builderForValue) {
      if (analysisQueryBuilder_ == null) {
        analysisQuery_ = builderForValue.build();
      } else {
        analysisQueryBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeAnalysisQuery(com.google.cloud.asset.v1.IamPolicyAnalysisQuery value) {
      if (analysisQueryBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && analysisQuery_ != null
            && analysisQuery_
                != com.google.cloud.asset.v1.IamPolicyAnalysisQuery.getDefaultInstance()) {
          getAnalysisQueryBuilder().mergeFrom(value);
        } else {
          analysisQuery_ = value;
        }
      } else {
        analysisQueryBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearAnalysisQuery() {
      bitField0_ = (bitField0_ & ~0x00000001);
      analysisQuery_ = null;
      if (analysisQueryBuilder_ != null) {
        analysisQueryBuilder_.dispose();
        analysisQueryBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Builder getAnalysisQueryBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getAnalysisQueryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisQueryOrBuilder getAnalysisQueryOrBuilder() {
      if (analysisQueryBuilder_ != null) {
        return analysisQueryBuilder_.getMessageOrBuilder();
      } else {
        return analysisQuery_ == null
            ? com.google.cloud.asset.v1.IamPolicyAnalysisQuery.getDefaultInstance()
            : analysisQuery_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The request query.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisQuery analysis_query = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.IamPolicyAnalysisQuery,
            com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Builder,
            com.google.cloud.asset.v1.IamPolicyAnalysisQueryOrBuilder>
        getAnalysisQueryFieldBuilder() {
      if (analysisQueryBuilder_ == null) {
        analysisQueryBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.asset.v1.IamPolicyAnalysisQuery,
                com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Builder,
                com.google.cloud.asset.v1.IamPolicyAnalysisQueryOrBuilder>(
                getAnalysisQuery(), getParentForChildren(), isClean());
        analysisQuery_ = null;
      }
      return analysisQueryBuilder_;
    }

    private java.lang.Object savedAnalysisQuery_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The name of a saved query, which must be in the format of:
     * * projects/project_number/savedQueries/saved_query_id
     * * folders/folder_number/savedQueries/saved_query_id
     * * organizations/organization_number/savedQueries/saved_query_id
     * If both `analysis_query` and `saved_analysis_query` are provided, they
     * will be merged together with the `saved_analysis_query` as base and
     * the `analysis_query` as overrides. For more details of the merge behavior,
     * please refer to the
     * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
     * doc.
     * Note that you cannot override primitive fields with default value, such as
     * 0 or empty string, etc., because we use proto3, which doesn't support field
     * presence yet.
     * </pre>
     *
     * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The savedAnalysisQuery.
     */
    public java.lang.String getSavedAnalysisQuery() {
      java.lang.Object ref = savedAnalysisQuery_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        savedAnalysisQuery_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of a saved query, which must be in the format of:
     * * projects/project_number/savedQueries/saved_query_id
     * * folders/folder_number/savedQueries/saved_query_id
     * * organizations/organization_number/savedQueries/saved_query_id
     * If both `analysis_query` and `saved_analysis_query` are provided, they
     * will be merged together with the `saved_analysis_query` as base and
     * the `analysis_query` as overrides. For more details of the merge behavior,
     * please refer to the
     * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
     * doc.
     * Note that you cannot override primitive fields with default value, such as
     * 0 or empty string, etc., because we use proto3, which doesn't support field
     * presence yet.
     * </pre>
     *
     * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for savedAnalysisQuery.
     */
    public com.google.protobuf.ByteString getSavedAnalysisQueryBytes() {
      java.lang.Object ref = savedAnalysisQuery_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        savedAnalysisQuery_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of a saved query, which must be in the format of:
     * * projects/project_number/savedQueries/saved_query_id
     * * folders/folder_number/savedQueries/saved_query_id
     * * organizations/organization_number/savedQueries/saved_query_id
     * If both `analysis_query` and `saved_analysis_query` are provided, they
     * will be merged together with the `saved_analysis_query` as base and
     * the `analysis_query` as overrides. For more details of the merge behavior,
     * please refer to the
     * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
     * doc.
     * Note that you cannot override primitive fields with default value, such as
     * 0 or empty string, etc., because we use proto3, which doesn't support field
     * presence yet.
     * </pre>
     *
     * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The savedAnalysisQuery to set.
     * @return This builder for chaining.
     */
    public Builder setSavedAnalysisQuery(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      savedAnalysisQuery_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of a saved query, which must be in the format of:
     * * projects/project_number/savedQueries/saved_query_id
     * * folders/folder_number/savedQueries/saved_query_id
     * * organizations/organization_number/savedQueries/saved_query_id
     * If both `analysis_query` and `saved_analysis_query` are provided, they
     * will be merged together with the `saved_analysis_query` as base and
     * the `analysis_query` as overrides. For more details of the merge behavior,
     * please refer to the
     * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
     * doc.
     * Note that you cannot override primitive fields with default value, such as
     * 0 or empty string, etc., because we use proto3, which doesn't support field
     * presence yet.
     * </pre>
     *
     * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSavedAnalysisQuery() {
      savedAnalysisQuery_ = getDefaultInstance().getSavedAnalysisQuery();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The name of a saved query, which must be in the format of:
     * * projects/project_number/savedQueries/saved_query_id
     * * folders/folder_number/savedQueries/saved_query_id
     * * organizations/organization_number/savedQueries/saved_query_id
     * If both `analysis_query` and `saved_analysis_query` are provided, they
     * will be merged together with the `saved_analysis_query` as base and
     * the `analysis_query` as overrides. For more details of the merge behavior,
     * please refer to the
     * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
     * doc.
     * Note that you cannot override primitive fields with default value, such as
     * 0 or empty string, etc., because we use proto3, which doesn't support field
     * presence yet.
     * </pre>
     *
     * <code>string saved_analysis_query = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for savedAnalysisQuery to set.
     * @return This builder for chaining.
     */
    public Builder setSavedAnalysisQueryBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      savedAnalysisQuery_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig outputConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig,
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.Builder,
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfigOrBuilder>
        outputConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the outputConfig field is set.
     */
    public boolean hasOutputConfig() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The outputConfig.
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig getOutputConfig() {
      if (outputConfigBuilder_ == null) {
        return outputConfig_ == null
            ? com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.getDefaultInstance()
            : outputConfig_;
      } else {
        return outputConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setOutputConfig(com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig value) {
      if (outputConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        outputConfig_ = value;
      } else {
        outputConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setOutputConfig(
        com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.Builder builderForValue) {
      if (outputConfigBuilder_ == null) {
        outputConfig_ = builderForValue.build();
      } else {
        outputConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeOutputConfig(
        com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig value) {
      if (outputConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && outputConfig_ != null
            && outputConfig_
                != com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.getDefaultInstance()) {
          getOutputConfigBuilder().mergeFrom(value);
        } else {
          outputConfig_ = value;
        }
      } else {
        outputConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearOutputConfig() {
      bitField0_ = (bitField0_ & ~0x00000004);
      outputConfig_ = null;
      if (outputConfigBuilder_ != null) {
        outputConfigBuilder_.dispose();
        outputConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.Builder
        getOutputConfigBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getOutputConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfigOrBuilder
        getOutputConfigOrBuilder() {
      if (outputConfigBuilder_ != null) {
        return outputConfigBuilder_.getMessageOrBuilder();
      } else {
        return outputConfig_ == null
            ? com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.getDefaultInstance()
            : outputConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Output configuration indicating where the results will be output
     * to.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.IamPolicyAnalysisOutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig,
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.Builder,
            com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfigOrBuilder>
        getOutputConfigFieldBuilder() {
      if (outputConfigBuilder_ == null) {
        outputConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig,
                com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.Builder,
                com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfigOrBuilder>(
                getOutputConfig(), getParentForChildren(), isClean());
        outputConfig_ = null;
      }
      return outputConfigBuilder_;
    }

    @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.asset.v1.AnalyzeIamPolicyLongrunningRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest)
  private static final com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest();
  }

  public static com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
