<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2\JobTrigger;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * What event needs to occur for a new job to be started.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.JobTrigger.Trigger</code>
 */
class Trigger extends \Google\Protobuf\Internal\Message
{
    protected $trigger;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\Schedule $schedule
     *           Create a job on a repeating basis based on the elapse of time.
     *     @type \Google\Cloud\Dlp\V2\Manual $manual
     *           For use with hybrid jobs. Jobs must be manually created and finished.
     *           Early access feature is in a pre-release state and might change or have
     *           limited support. For more information, see
     *           https://cloud.google.com/products#product-launch-stages.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Create a job on a repeating basis based on the elapse of time.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Schedule schedule = 1;</code>
     * @return \Google\Cloud\Dlp\V2\Schedule
     */
    public function getSchedule()
    {
        return $this->readOneof(1);
    }

    /**
     * Create a job on a repeating basis based on the elapse of time.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Schedule schedule = 1;</code>
     * @param \Google\Cloud\Dlp\V2\Schedule $var
     * @return $this
     */
    public function setSchedule($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Schedule::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * For use with hybrid jobs. Jobs must be manually created and finished.
     * Early access feature is in a pre-release state and might change or have
     * limited support. For more information, see
     * https://cloud.google.com/products#product-launch-stages.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Manual manual = 2;</code>
     * @return \Google\Cloud\Dlp\V2\Manual
     */
    public function getManual()
    {
        return $this->readOneof(2);
    }

    /**
     * For use with hybrid jobs. Jobs must be manually created and finished.
     * Early access feature is in a pre-release state and might change or have
     * limited support. For more information, see
     * https://cloud.google.com/products#product-launch-stages.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Manual manual = 2;</code>
     * @param \Google\Cloud\Dlp\V2\Manual $var
     * @return $this
     */
    public function setManual($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Manual::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getTrigger()
    {
        return $this->whichOneof("trigger");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Trigger::class, \Google\Cloud\Dlp\V2\JobTrigger_Trigger::class);

