/*
 * 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.trafficdirector.v2.model;

/**
 * Google's `RE2 `_ regex engine. The regex string must adhere to the documented `syntax `_. The
 * engine is designed to complete execution in linear time as well as limit the amount of memory
 * used. Envoy supports program size checking via runtime. The runtime keys
 * ``re2.max_program_size.error_level`` and ``re2.max_program_size.warn_level`` can be set to
 * integers as the maximum program size or complexity that a compiled regex can have before an
 * exception is thrown or a warning is logged, respectively. ``re2.max_program_size.error_level``
 * defaults to 100, and ``re2.max_program_size.warn_level`` has no default if unset (will not
 * check/log a warning). Envoy emits two stats for tracking the program size of regexes: the
 * histogram `re2.program_size`, which records the program size, and the counter
 * `re2.exceeded_warn_level`, which is incremented each time the program size exceeds the warn level
 * threshold.
 *
 * <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 Traffic Director 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 GoogleRE2 extends com.google.api.client.json.GenericJson {

  /**
   * This field controls the RE2 "program size" which is a rough estimate of how complex a compiled
   * regex is to evaluate. A regex that has a program size greater than the configured value will
   * fail to compile. In this case, the configured max program size can be increased or the regex
   * can be simplified. If not specified, the default is 100. This field is deprecated; regexp
   * validation should be performed on the management server instead of being done by each
   * individual client.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long maxProgramSize;

  /**
   * This field controls the RE2 "program size" which is a rough estimate of how complex a compiled
   * regex is to evaluate. A regex that has a program size greater than the configured value will
   * fail to compile. In this case, the configured max program size can be increased or the regex
   * can be simplified. If not specified, the default is 100. This field is deprecated; regexp
   * validation should be performed on the management server instead of being done by each
   * individual client.
   * @return value or {@code null} for none
   */
  public java.lang.Long getMaxProgramSize() {
    return maxProgramSize;
  }

  /**
   * This field controls the RE2 "program size" which is a rough estimate of how complex a compiled
   * regex is to evaluate. A regex that has a program size greater than the configured value will
   * fail to compile. In this case, the configured max program size can be increased or the regex
   * can be simplified. If not specified, the default is 100. This field is deprecated; regexp
   * validation should be performed on the management server instead of being done by each
   * individual client.
   * @param maxProgramSize maxProgramSize or {@code null} for none
   */
  public GoogleRE2 setMaxProgramSize(java.lang.Long maxProgramSize) {
    this.maxProgramSize = maxProgramSize;
    return this;
  }

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

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

}
