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

namespace Google\Ads\GoogleAds\V23\Resources;

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

/**
 * Representation of goals.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.resources.Goal</code>
 */
class Goal extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the goal.
     * Goal resource names have the form:
     * `customers/{customer_id}/goals/{goal_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $resource_name = '';
    /**
     * Output only. The ID of this goal.
     *
     * Generated from protobuf field <code>optional int64 goal_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $goal_id = null;
    /**
     * Output only. The type of this goal.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.GoalTypeEnum.GoalType goal_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $goal_type = 0;
    /**
     * Output only. The resource name of the goal owner customer.
     *
     * Generated from protobuf field <code>optional string owner_customer = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    protected $owner_customer = null;
    /**
     * Output only. Indicates if this goal is eligible for campaign optimization.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.GoalOptimizationEligibilityEnum.GoalOptimizationEligibility optimization_eligibility = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $optimization_eligibility = 0;
    protected $goal_settings;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $resource_name
     *           Immutable. The resource name of the goal.
     *           Goal resource names have the form:
     *           `customers/{customer_id}/goals/{goal_id}`
     *     @type int|string $goal_id
     *           Output only. The ID of this goal.
     *     @type int $goal_type
     *           Output only. The type of this goal.
     *     @type string $owner_customer
     *           Output only. The resource name of the goal owner customer.
     *     @type int $optimization_eligibility
     *           Output only. Indicates if this goal is eligible for campaign optimization.
     *     @type \Google\Ads\GoogleAds\V23\Common\GoalSetting\RetentionGoal $retention_goal_settings
     *           Retention goal settings.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Resources\Goal::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the goal.
     * Goal resource names have the form:
     * `customers/{customer_id}/goals/{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 goal.
     * Goal resource names have the form:
     * `customers/{customer_id}/goals/{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;
    }

    /**
     * Output only. The ID of this goal.
     *
     * Generated from protobuf field <code>optional int64 goal_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getGoalId()
    {
        return isset($this->goal_id) ? $this->goal_id : 0;
    }

    public function hasGoalId()
    {
        return isset($this->goal_id);
    }

    public function clearGoalId()
    {
        unset($this->goal_id);
    }

    /**
     * Output only. The ID of this goal.
     *
     * Generated from protobuf field <code>optional int64 goal_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setGoalId($var)
    {
        GPBUtil::checkInt64($var);
        $this->goal_id = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Output only. The resource name of the goal owner customer.
     *
     * Generated from protobuf field <code>optional string owner_customer = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getOwnerCustomer()
    {
        return isset($this->owner_customer) ? $this->owner_customer : '';
    }

    public function hasOwnerCustomer()
    {
        return isset($this->owner_customer);
    }

    public function clearOwnerCustomer()
    {
        unset($this->owner_customer);
    }

    /**
     * Output only. The resource name of the goal owner customer.
     *
     * Generated from protobuf field <code>optional string owner_customer = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setOwnerCustomer($var)
    {
        GPBUtil::checkString($var, True);
        $this->owner_customer = $var;

        return $this;
    }

    /**
     * Output only. Indicates if this goal is eligible for campaign optimization.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.GoalOptimizationEligibilityEnum.GoalOptimizationEligibility optimization_eligibility = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getOptimizationEligibility()
    {
        return $this->optimization_eligibility;
    }

    /**
     * Output only. Indicates if this goal is eligible for campaign optimization.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.GoalOptimizationEligibilityEnum.GoalOptimizationEligibility optimization_eligibility = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setOptimizationEligibility($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\GoalOptimizationEligibilityEnum\GoalOptimizationEligibility::class);
        $this->optimization_eligibility = $var;

        return $this;
    }

    /**
     * Retention goal settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.GoalSetting.RetentionGoal retention_goal_settings = 7;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\GoalSetting\RetentionGoal|null
     */
    public function getRetentionGoalSettings()
    {
        return $this->readOneof(7);
    }

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

    /**
     * Retention goal settings.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.GoalSetting.RetentionGoal retention_goal_settings = 7;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\GoalSetting\RetentionGoal $var
     * @return $this
     */
    public function setRetentionGoalSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\GoalSetting\RetentionGoal::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

}

