// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto

package com.google.cloud.securitycenter.v1beta1;

/**
 *
 *
 * <pre>
 * Request message for creating a finding.
 * </pre>
 *
 * Protobuf type {@code google.cloud.securitycenter.v1beta1.CreateFindingRequest}
 */
public final class CreateFindingRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.CreateFindingRequest)
    CreateFindingRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CreateFindingRequest.newBuilder() to construct.
  private CreateFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CreateFindingRequest() {
    parent_ = "";
    findingId_ = "";
  }

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

  private CreateFindingRequest(
      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:
            {
              java.lang.String s = input.readStringRequireUtf8();

              findingId_ = s;
              break;
            }
          case 26:
            {
              com.google.cloud.securitycenter.v1beta1.Finding.Builder subBuilder = null;
              if (finding_ != null) {
                subBuilder = finding_.toBuilder();
              }
              finding_ =
                  input.readMessage(
                      com.google.cloud.securitycenter.v1beta1.Finding.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(finding_);
                finding_ = 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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.securitycenter.v1beta1.SecuritycenterService
        .internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.securitycenter.v1beta1.SecuritycenterService
        .internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.class,
            com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.Builder.class);
  }

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Resource name of the new finding's parent. Its format should be
   * "organizations/[organization_id]/sources/[source_id]".
   * </pre>
   *
   * <code>string parent = 1;</code>
   */
  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>
   * Resource name of the new finding's parent. Its format should be
   * "organizations/[organization_id]/sources/[source_id]".
   * </pre>
   *
   * <code>string parent = 1;</code>
   */
  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 FINDING_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object findingId_;
  /**
   *
   *
   * <pre>
   * Unique identifier provided by the client within the parent scope.
   * It must be alphanumeric and less than or equal to 32 characters and
   * greater than 0 characters in length.
   * </pre>
   *
   * <code>string finding_id = 2;</code>
   */
  public java.lang.String getFindingId() {
    java.lang.Object ref = findingId_;
    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();
      findingId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Unique identifier provided by the client within the parent scope.
   * It must be alphanumeric and less than or equal to 32 characters and
   * greater than 0 characters in length.
   * </pre>
   *
   * <code>string finding_id = 2;</code>
   */
  public com.google.protobuf.ByteString getFindingIdBytes() {
    java.lang.Object ref = findingId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      findingId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FINDING_FIELD_NUMBER = 3;
  private com.google.cloud.securitycenter.v1beta1.Finding finding_;
  /**
   *
   *
   * <pre>
   * The Finding being created. The name and security_marks will be ignored as
   * they are both output only fields on this resource.
   * </pre>
   *
   * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
   */
  public boolean hasFinding() {
    return finding_ != null;
  }
  /**
   *
   *
   * <pre>
   * The Finding being created. The name and security_marks will be ignored as
   * they are both output only fields on this resource.
   * </pre>
   *
   * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
   */
  public com.google.cloud.securitycenter.v1beta1.Finding getFinding() {
    return finding_ == null
        ? com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance()
        : finding_;
  }
  /**
   *
   *
   * <pre>
   * The Finding being created. The name and security_marks will be ignored as
   * they are both output only fields on this resource.
   * </pre>
   *
   * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
   */
  public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder() {
    return getFinding();
  }

  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 (!getParentBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (!getFindingIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, findingId_);
    }
    if (finding_ != null) {
      output.writeMessage(3, getFinding());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getParentBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (!getFindingIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, findingId_);
    }
    if (finding_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinding());
    }
    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.securitycenter.v1beta1.CreateFindingRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.securitycenter.v1beta1.CreateFindingRequest other =
        (com.google.cloud.securitycenter.v1beta1.CreateFindingRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getFindingId().equals(other.getFindingId())) return false;
    if (hasFinding() != other.hasFinding()) return false;
    if (hasFinding()) {
      if (!getFinding().equals(other.getFinding())) 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();
    hash = (37 * hash) + FINDING_ID_FIELD_NUMBER;
    hash = (53 * hash) + getFindingId().hashCode();
    if (hasFinding()) {
      hash = (37 * hash) + FINDING_FIELD_NUMBER;
      hash = (53 * hash) + getFinding().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.securitycenter.v1beta1.CreateFindingRequest 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.securitycenter.v1beta1.CreateFindingRequest 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 message for creating a finding.
   * </pre>
   *
   * Protobuf type {@code google.cloud.securitycenter.v1beta1.CreateFindingRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.CreateFindingRequest)
      com.google.cloud.securitycenter.v1beta1.CreateFindingRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.securitycenter.v1beta1.SecuritycenterService
          .internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.securitycenter.v1beta1.SecuritycenterService
          .internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.class,
              com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.Builder.class);
    }

    // Construct using com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.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_ = "";

      findingId_ = "";

      if (findingBuilder_ == null) {
        finding_ = null;
      } else {
        finding_ = null;
        findingBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.securitycenter.v1beta1.SecuritycenterService
          .internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest
        getDefaultInstanceForType() {
      return com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest buildPartial() {
      com.google.cloud.securitycenter.v1beta1.CreateFindingRequest result =
          new com.google.cloud.securitycenter.v1beta1.CreateFindingRequest(this);
      result.parent_ = parent_;
      result.findingId_ = findingId_;
      if (findingBuilder_ == null) {
        result.finding_ = finding_;
      } else {
        result.finding_ = findingBuilder_.build();
      }
      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.securitycenter.v1beta1.CreateFindingRequest) {
        return mergeFrom((com.google.cloud.securitycenter.v1beta1.CreateFindingRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.CreateFindingRequest other) {
      if (other
          == com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (!other.getFindingId().isEmpty()) {
        findingId_ = other.findingId_;
        onChanged();
      }
      if (other.hasFinding()) {
        mergeFinding(other.getFinding());
      }
      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.securitycenter.v1beta1.CreateFindingRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.securitycenter.v1beta1.CreateFindingRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Resource name of the new finding's parent. Its format should be
     * "organizations/[organization_id]/sources/[source_id]".
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    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>
     * Resource name of the new finding's parent. Its format should be
     * "organizations/[organization_id]/sources/[source_id]".
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    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>
     * Resource name of the new finding's parent. Its format should be
     * "organizations/[organization_id]/sources/[source_id]".
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Resource name of the new finding's parent. Its format should be
     * "organizations/[organization_id]/sources/[source_id]".
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Resource name of the new finding's parent. Its format should be
     * "organizations/[organization_id]/sources/[source_id]".
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object findingId_ = "";
    /**
     *
     *
     * <pre>
     * Unique identifier provided by the client within the parent scope.
     * It must be alphanumeric and less than or equal to 32 characters and
     * greater than 0 characters in length.
     * </pre>
     *
     * <code>string finding_id = 2;</code>
     */
    public java.lang.String getFindingId() {
      java.lang.Object ref = findingId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        findingId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Unique identifier provided by the client within the parent scope.
     * It must be alphanumeric and less than or equal to 32 characters and
     * greater than 0 characters in length.
     * </pre>
     *
     * <code>string finding_id = 2;</code>
     */
    public com.google.protobuf.ByteString getFindingIdBytes() {
      java.lang.Object ref = findingId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        findingId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Unique identifier provided by the client within the parent scope.
     * It must be alphanumeric and less than or equal to 32 characters and
     * greater than 0 characters in length.
     * </pre>
     *
     * <code>string finding_id = 2;</code>
     */
    public Builder setFindingId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      findingId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unique identifier provided by the client within the parent scope.
     * It must be alphanumeric and less than or equal to 32 characters and
     * greater than 0 characters in length.
     * </pre>
     *
     * <code>string finding_id = 2;</code>
     */
    public Builder clearFindingId() {

      findingId_ = getDefaultInstance().getFindingId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Unique identifier provided by the client within the parent scope.
     * It must be alphanumeric and less than or equal to 32 characters and
     * greater than 0 characters in length.
     * </pre>
     *
     * <code>string finding_id = 2;</code>
     */
    public Builder setFindingIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private com.google.cloud.securitycenter.v1beta1.Finding finding_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.securitycenter.v1beta1.Finding,
            com.google.cloud.securitycenter.v1beta1.Finding.Builder,
            com.google.cloud.securitycenter.v1beta1.FindingOrBuilder>
        findingBuilder_;
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public boolean hasFinding() {
      return findingBuilder_ != null || finding_ != null;
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public com.google.cloud.securitycenter.v1beta1.Finding getFinding() {
      if (findingBuilder_ == null) {
        return finding_ == null
            ? com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance()
            : finding_;
      } else {
        return findingBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public Builder setFinding(com.google.cloud.securitycenter.v1beta1.Finding value) {
      if (findingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        finding_ = value;
        onChanged();
      } else {
        findingBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public Builder setFinding(
        com.google.cloud.securitycenter.v1beta1.Finding.Builder builderForValue) {
      if (findingBuilder_ == null) {
        finding_ = builderForValue.build();
        onChanged();
      } else {
        findingBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public Builder mergeFinding(com.google.cloud.securitycenter.v1beta1.Finding value) {
      if (findingBuilder_ == null) {
        if (finding_ != null) {
          finding_ =
              com.google.cloud.securitycenter.v1beta1.Finding.newBuilder(finding_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          finding_ = value;
        }
        onChanged();
      } else {
        findingBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public Builder clearFinding() {
      if (findingBuilder_ == null) {
        finding_ = null;
        onChanged();
      } else {
        finding_ = null;
        findingBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public com.google.cloud.securitycenter.v1beta1.Finding.Builder getFindingBuilder() {

      onChanged();
      return getFindingFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder() {
      if (findingBuilder_ != null) {
        return findingBuilder_.getMessageOrBuilder();
      } else {
        return finding_ == null
            ? com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance()
            : finding_;
      }
    }
    /**
     *
     *
     * <pre>
     * The Finding being created. The name and security_marks will be ignored as
     * they are both output only fields on this resource.
     * </pre>
     *
     * <code>.google.cloud.securitycenter.v1beta1.Finding finding = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.securitycenter.v1beta1.Finding,
            com.google.cloud.securitycenter.v1beta1.Finding.Builder,
            com.google.cloud.securitycenter.v1beta1.FindingOrBuilder>
        getFindingFieldBuilder() {
      if (findingBuilder_ == null) {
        findingBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.securitycenter.v1beta1.Finding,
                com.google.cloud.securitycenter.v1beta1.Finding.Builder,
                com.google.cloud.securitycenter.v1beta1.FindingOrBuilder>(
                getFinding(), getParentForChildren(), isClean());
        finding_ = null;
      }
      return findingBuilder_;
    }

    @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.securitycenter.v1beta1.CreateFindingRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.CreateFindingRequest)
  private static final com.google.cloud.securitycenter.v1beta1.CreateFindingRequest
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.CreateFindingRequest();
  }

  public static com.google.cloud.securitycenter.v1beta1.CreateFindingRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
