/*
 * 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
 *
 * http://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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.dlp.v2.model;

/**
 * Message representing a set of files in a Cloud Storage bucket. Regular expressions are used to
 * allow fine-grained control over which files in the bucket to include.
 *
 * Included files are those that match at least one item in `include_regex` and do not match any
 * items in `exclude_regex`. Note that a file that matches items from both lists will _not_ be
 * included. For a match to occur, the entire file path (i.e., everything in the url after the
 * bucket name) must match the regular expression.
 *
 * For example, given the input `{bucket_name: "mybucket", include_regex: ["directory1/.*"],
 * exclude_regex: ["directory1/excluded.*"]}`:
 *
 * * `gs://mybucket/directory1/myfile` will be included *
 * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches across `/`) *
 * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the full path doesn't match
 * any items in `include_regex`) * `gs://mybucket/directory1/excludedfile` will _not_ be included
 * (the path matches an item in `exclude_regex`)
 *
 * If `include_regex` is left empty, it will match all files by default (this is equivalent to
 * setting `include_regex: [".*"]`).
 *
 * Some other common use cases:
 *
 * * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all files in `mybucket`
 * except for .pdf files * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will
 * include all files directly under `gs://mybucket/directory/`, without matching across `/`
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Data Loss Prevention (DLP) API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GooglePrivacyDlpV2CloudStorageRegexFileSet extends com.google.api.client.json.GenericJson {

  /**
   * The name of a Cloud Storage bucket. Required.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String bucketName;

  /**
   * A list of regular expressions matching file paths to exclude. All files in the bucket that
   * match at least one of these regular expressions will be excluded from the scan.
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> excludeRegex;

  /**
   * A list of regular expressions matching file paths to include. All files in the bucket that
   * match at least one of these regular expressions will be included in the set of files, except
   * for those that also match an item in `exclude_regex`. Leaving this field empty will match all
   * files by default (this is equivalent to including `.*` in the list).
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> includeRegex;

  /**
   * The name of a Cloud Storage bucket. Required.
   * @return value or {@code null} for none
   */
  public java.lang.String getBucketName() {
    return bucketName;
  }

  /**
   * The name of a Cloud Storage bucket. Required.
   * @param bucketName bucketName or {@code null} for none
   */
  public GooglePrivacyDlpV2CloudStorageRegexFileSet setBucketName(java.lang.String bucketName) {
    this.bucketName = bucketName;
    return this;
  }

  /**
   * A list of regular expressions matching file paths to exclude. All files in the bucket that
   * match at least one of these regular expressions will be excluded from the scan.
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getExcludeRegex() {
    return excludeRegex;
  }

  /**
   * A list of regular expressions matching file paths to exclude. All files in the bucket that
   * match at least one of these regular expressions will be excluded from the scan.
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * @param excludeRegex excludeRegex or {@code null} for none
   */
  public GooglePrivacyDlpV2CloudStorageRegexFileSet setExcludeRegex(java.util.List<java.lang.String> excludeRegex) {
    this.excludeRegex = excludeRegex;
    return this;
  }

  /**
   * A list of regular expressions matching file paths to include. All files in the bucket that
   * match at least one of these regular expressions will be included in the set of files, except
   * for those that also match an item in `exclude_regex`. Leaving this field empty will match all
   * files by default (this is equivalent to including `.*` in the list).
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getIncludeRegex() {
    return includeRegex;
  }

  /**
   * A list of regular expressions matching file paths to include. All files in the bucket that
   * match at least one of these regular expressions will be included in the set of files, except
   * for those that also match an item in `exclude_regex`. Leaving this field empty will match all
   * files by default (this is equivalent to including `.*` in the list).
   *
   * Regular expressions use RE2 [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
   * found under the google/re2 repository on GitHub.
   * @param includeRegex includeRegex or {@code null} for none
   */
  public GooglePrivacyDlpV2CloudStorageRegexFileSet setIncludeRegex(java.util.List<java.lang.String> includeRegex) {
    this.includeRegex = includeRegex;
    return this;
  }

  @Override
  public GooglePrivacyDlpV2CloudStorageRegexFileSet set(String fieldName, Object value) {
    return (GooglePrivacyDlpV2CloudStorageRegexFileSet) super.set(fieldName, value);
  }

  @Override
  public GooglePrivacyDlpV2CloudStorageRegexFileSet clone() {
    return (GooglePrivacyDlpV2CloudStorageRegexFileSet) super.clone();
  }

}
