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

namespace Google\Ads\GoogleAds\V22\Services;

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

/**
 * A single mutate operation on the campaign goal config.
 *
 * Generated from protobuf message <code>google.ads.googleads.v22.services.CampaignGoalConfigOperation</code>
 */
class CampaignGoalConfigOperation extends \Google\Protobuf\Internal\Message
{
    /**
     * FieldMask that determines which fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</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 fields are modified in an update.
     *     @type \Google\Ads\GoogleAds\V22\Resources\CampaignGoalConfig $create
     *           Create a new campaign goal config.
     *     @type \Google\Ads\GoogleAds\V22\Resources\CampaignGoalConfig $update
     *           Update an existing campaign goal config.
     *     @type string $remove
     *           Remove an existing campaign goal config.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V22\Services\CampaignGoalConfigService::initOnce();
        parent::__construct($data);
    }

    /**
     * FieldMask that determines which fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</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 fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4;</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 campaign goal config.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v22.resources.CampaignGoalConfig create = 1;</code>
     * @return \Google\Ads\GoogleAds\V22\Resources\CampaignGoalConfig|null
     */
    public function getCreate()
    {
        return $this->readOneof(1);
    }

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

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

        return $this;
    }

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

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

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

        return $this;
    }

    /**
     * Remove an existing campaign goal config.
     *
     * Generated from protobuf field <code>string remove = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getRemove()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Remove an existing campaign goal config.
     *
     * Generated from protobuf field <code>string remove = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setRemove($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

