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

namespace Google\Ads\GoogleAds\V25\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.v25.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.v25.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\V25\Common\CampaignGoalSettings\CampaignRetentionGoalSettings $campaign_retention_settings
     *           Retention goal campaign settings.
     *     @type \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignNewCustomerAcquisitionGoalSettings $campaign_new_customer_acquisition_settings
     *           New customer acquisition goal campaign settings.
     *     @type \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignLoyaltyRetentionGoalSettings $campaign_loyalty_retention_settings
     *           Loyalty retention goal campaign settings.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\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.v25.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.v25.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\V25\Enums\GoalTypeEnum\GoalType::class);
        $this->goal_type = $var;

        return $this;
    }

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

        return $this;
    }

    /**
     * New customer acquisition goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.CampaignGoalSettings.CampaignNewCustomerAcquisitionGoalSettings campaign_new_customer_acquisition_settings = 6;</code>
     * @return \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignNewCustomerAcquisitionGoalSettings|null
     */
    public function getCampaignNewCustomerAcquisitionSettings()
    {
        return $this->readOneof(6);
    }

    public function hasCampaignNewCustomerAcquisitionSettings()
    {
        return $this->hasOneof(6);
    }

    /**
     * New customer acquisition goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.CampaignGoalSettings.CampaignNewCustomerAcquisitionGoalSettings campaign_new_customer_acquisition_settings = 6;</code>
     * @param \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignNewCustomerAcquisitionGoalSettings $var
     * @return $this
     */
    public function setCampaignNewCustomerAcquisitionSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignNewCustomerAcquisitionGoalSettings::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Loyalty retention goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.CampaignGoalSettings.CampaignLoyaltyRetentionGoalSettings campaign_loyalty_retention_settings = 7;</code>
     * @return \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignLoyaltyRetentionGoalSettings|null
     */
    public function getCampaignLoyaltyRetentionSettings()
    {
        return $this->readOneof(7);
    }

    public function hasCampaignLoyaltyRetentionSettings()
    {
        return $this->hasOneof(7);
    }

    /**
     * Loyalty retention goal campaign settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.CampaignGoalSettings.CampaignLoyaltyRetentionGoalSettings campaign_loyalty_retention_settings = 7;</code>
     * @param \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignLoyaltyRetentionGoalSettings $var
     * @return $this
     */
    public function setCampaignLoyaltyRetentionSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V25\Common\CampaignGoalSettings\CampaignLoyaltyRetentionGoalSettings::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

}

