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

namespace Google\Ads\GoogleAds\V24\Resources;

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

/**
 * A link between a campaign and a goal enabling campaign-specific optimization.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.resources.CampaignGoalConfig</code>
 */
class CampaignGoalConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the campaign goal config.
     * campaign goal config resource names have the form:
     * `customers/{customer_id}/campaignGoalConfigs/{campaign_id}~{goal_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $resource_name = '';
    /**
     * Immutable. The resource name of the campaign for this link.
     *
     * Generated from protobuf field <code>string campaign = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $campaign = '';
    /**
     * Immutable. The resource name of the goal this link is attached to.
     *
     * Generated from protobuf field <code>string goal = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $goal = '';
    /**
     * Output only. The goal type this link is attached to.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.GoalTypeEnum.GoalType goal_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $goal_type = 0;
    protected $campaign_goal_config_settings;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $resource_name
     *           Immutable. The resource name of the campaign goal config.
     *           campaign goal config resource names have the form:
     *           `customers/{customer_id}/campaignGoalConfigs/{campaign_id}~{goal_id}`
     * @type string $campaign
     *           Immutable. The resource name of the campaign for this link.
     * @type string $goal
     *           Immutable. The resource name of the goal this link is attached to.
     * @type int $goal_type
     *           Output only. The goal type this link is attached to.
     * @type \Google\Ads\GoogleAds\V24\Common\CampaignGoalSettings\CampaignRetentionGoalSettings $campaign_retention_settings
     *           Retention goal campaign settings.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Resources\CampaignGoalConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the campaign goal config.
     * campaign goal config resource names have the form:
     * `customers/{customer_id}/campaignGoalConfigs/{campaign_id}~{goal_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getResourceName()
    {
        return $this->resource_name;
    }

    /**
     * Immutable. The resource name of the campaign goal config.
     * campaign goal config resource names have the form:
     * `customers/{customer_id}/campaignGoalConfigs/{campaign_id}~{goal_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setResourceName($var)
    {
        GPBUtil::checkString($var, true);
        $this->resource_name = $var;

        return $this;
    }

    /**
     * Immutable. The resource name of the campaign for this link.
     *
     * Generated from protobuf field <code>string campaign = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getCampaign()
    {
        return $this->campaign;
    }

    /**
     * Immutable. The resource name of the campaign for this link.
     *
     * Generated from protobuf field <code>string campaign = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setCampaign($var)
    {
        GPBUtil::checkString($var, true);
        $this->campaign = $var;

        return $this;
    }

    /**
     * Immutable. The resource name of the goal this link is attached to.
     *
     * Generated from protobuf field <code>string goal = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getGoal()
    {
        return $this->goal;
    }

    /**
     * Immutable. The resource name of the goal this link is attached to.
     *
     * Generated from protobuf field <code>string goal = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setGoal($var)
    {
        GPBUtil::checkString($var, true);
        $this->goal = $var;

        return $this;
    }

    /**
     * Output only. The goal type this link is attached to.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.GoalTypeEnum.GoalType goal_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return int
     */
    public function getGoalType()
    {
        return $this->goal_type;
    }

    /**
     * Output only. The goal type this link is attached to.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.GoalTypeEnum.GoalType goal_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param  int $var
     * @return $this
     */
    public function setGoalType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V24\Enums\GoalTypeEnum\GoalType::class);
        $this->goal_type = $var;

        return $this;
    }

    /**
     * Retention goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.CampaignGoalSettings.CampaignRetentionGoalSettings campaign_retention_settings = 5;</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\CampaignGoalSettings\CampaignRetentionGoalSettings|null
     */
    public function getCampaignRetentionSettings()
    {
        return $this->readOneof(5);
    }

    public function hasCampaignRetentionSettings()
    {
        return $this->hasOneof(5);
    }

    /**
     * Retention goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.CampaignGoalSettings.CampaignRetentionGoalSettings campaign_retention_settings = 5;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\CampaignGoalSettings\CampaignRetentionGoalSettings $var
     * @return $this
     */
    public function setCampaignRetentionSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\CampaignGoalSettings\CampaignRetentionGoalSettings::class);
        $this->writeOneof(5, $var);

        return $this;
    }

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

}

