<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudbuild/v1/cloudbuild.proto

namespace Google\Cloud\Build\V1;

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

/**
 * Request to update an existing `BuildTrigger`.
 *
 * Generated from protobuf message <code>google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest</code>
 */
class UpdateBuildTriggerRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. ID of the project that owns the trigger.
     *
     * Generated from protobuf field <code>string project_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $project_id = '';
    /**
     * Required. ID of the `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $trigger_id = '';
    /**
     * Required. `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $trigger = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $project_id
     *           Required. ID of the project that owns the trigger.
     *     @type string $trigger_id
     *           Required. ID of the `BuildTrigger` to update.
     *     @type \Google\Cloud\Build\V1\BuildTrigger $trigger
     *           Required. `BuildTrigger` to update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. ID of the project that owns the trigger.
     *
     * Generated from protobuf field <code>string project_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getProjectId()
    {
        return $this->project_id;
    }

    /**
     * Required. ID of the project that owns the trigger.
     *
     * Generated from protobuf field <code>string project_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setProjectId($var)
    {
        GPBUtil::checkString($var, True);
        $this->project_id = $var;

        return $this;
    }

    /**
     * Required. ID of the `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTriggerId()
    {
        return $this->trigger_id;
    }

    /**
     * Required. ID of the `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTriggerId($var)
    {
        GPBUtil::checkString($var, True);
        $this->trigger_id = $var;

        return $this;
    }

    /**
     * Required. `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Build\V1\BuildTrigger|null
     */
    public function getTrigger()
    {
        return isset($this->trigger) ? $this->trigger : null;
    }

    public function hasTrigger()
    {
        return isset($this->trigger);
    }

    public function clearTrigger()
    {
        unset($this->trigger);
    }

    /**
     * Required. `BuildTrigger` to update.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Build\V1\BuildTrigger $var
     * @return $this
     */
    public function setTrigger($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildTrigger::class);
        $this->trigger = $var;

        return $this;
    }

}

