<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/services/goal_service.proto

namespace Google\Ads\GoogleAds\V24\Services;

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

/**
 * A single mutate operation on the goal.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.services.GoalOperation</code>
 */
class GoalOperation extends \Google\Protobuf\Internal\Message
{
    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3;</code>
     */
    protected $update_mask = null;
    protected $operation;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type \Google\Protobuf\FieldMask $update_mask
     *           FieldMask that determines which resource fields are modified in an update.
     * @type \Google\Ads\GoogleAds\V24\Resources\Goal $create
     *           Create a new goal.
     * @type \Google\Ads\GoogleAds\V24\Resources\Goal $update
     *           Update an existing goal.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Services\GoalService::initOnce();
        parent::__construct($data);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3;</code>
     *
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3;</code>
     *
     * @param  \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

    /**
     * Create a new goal.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Goal create = 1;</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Resources\Goal|null
     */
    public function getCreate()
    {
        return $this->readOneof(1);
    }

    public function hasCreate()
    {
        return $this->hasOneof(1);
    }

    /**
     * Create a new goal.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Goal create = 1;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Resources\Goal $var
     * @return $this
     */
    public function setCreate($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Resources\Goal::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Update an existing goal.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Goal update = 2;</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Resources\Goal|null
     */
    public function getUpdate()
    {
        return $this->readOneof(2);
    }

    public function hasUpdate()
    {
        return $this->hasOneof(2);
    }

    /**
     * Update an existing goal.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Goal update = 2;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Resources\Goal $var
     * @return $this
     */
    public function setUpdate($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Resources\Goal::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

