/*
 * 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.cloudbuild.v1.model;

/**
 * The configuration of a trigger that creates a build whenever an event from Repo API is received.
 *
 * <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 Build 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 RepositoryEventConfig extends com.google.api.client.json.GenericJson {

  /**
   * Filter to match changes in pull requests.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PullRequestFilter pullRequest;

  /**
   * Filter to match changes in refs like branches, tags.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private PushFilter push;

  /**
   * The resource name of the Repo API resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String repository;

  /**
   * Output only. The type of the SCM vendor the repository points to.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String repositoryType;

  /**
   * Filter to match changes in pull requests.
   * @return value or {@code null} for none
   */
  public PullRequestFilter getPullRequest() {
    return pullRequest;
  }

  /**
   * Filter to match changes in pull requests.
   * @param pullRequest pullRequest or {@code null} for none
   */
  public RepositoryEventConfig setPullRequest(PullRequestFilter pullRequest) {
    this.pullRequest = pullRequest;
    return this;
  }

  /**
   * Filter to match changes in refs like branches, tags.
   * @return value or {@code null} for none
   */
  public PushFilter getPush() {
    return push;
  }

  /**
   * Filter to match changes in refs like branches, tags.
   * @param push push or {@code null} for none
   */
  public RepositoryEventConfig setPush(PushFilter push) {
    this.push = push;
    return this;
  }

  /**
   * The resource name of the Repo API resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getRepository() {
    return repository;
  }

  /**
   * The resource name of the Repo API resource.
   * @param repository repository or {@code null} for none
   */
  public RepositoryEventConfig setRepository(java.lang.String repository) {
    this.repository = repository;
    return this;
  }

  /**
   * Output only. The type of the SCM vendor the repository points to.
   * @return value or {@code null} for none
   */
  public java.lang.String getRepositoryType() {
    return repositoryType;
  }

  /**
   * Output only. The type of the SCM vendor the repository points to.
   * @param repositoryType repositoryType or {@code null} for none
   */
  public RepositoryEventConfig setRepositoryType(java.lang.String repositoryType) {
    this.repositoryType = repositoryType;
    return this;
  }

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

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

}
