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

namespace Google\Ads\GoogleAds\V25\Common;

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

/**
 * Fixed CPM (cost per thousand impression) bidding strategy. A manual bidding
 * strategy with a fixed CPM.
 *
 * Generated from protobuf message <code>google.ads.googleads.v25.common.FixedCpm</code>
 */
class FixedCpm extends \Google\Protobuf\Internal\Message
{
    /**
     * Fixed CPM bidding goal. Determines the exact bidding optimization
     * parameters.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.FixedCpmGoalEnum.FixedCpmGoal goal = 1;</code>
     */
    protected $goal = 0;
    protected $goal_info;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $goal
     *           Fixed CPM bidding goal. Determines the exact bidding optimization
     *           parameters.
     *     @type \Google\Ads\GoogleAds\V25\Common\FixedCpmTargetFrequencyGoalInfo $target_frequency_info
     *           Target frequency bidding goal details.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\Common\Bidding::initOnce();
        parent::__construct($data);
    }

    /**
     * Fixed CPM bidding goal. Determines the exact bidding optimization
     * parameters.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.FixedCpmGoalEnum.FixedCpmGoal goal = 1;</code>
     * @return int
     */
    public function getGoal()
    {
        return $this->goal;
    }

    /**
     * Fixed CPM bidding goal. Determines the exact bidding optimization
     * parameters.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.FixedCpmGoalEnum.FixedCpmGoal goal = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setGoal($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V25\Enums\FixedCpmGoalEnum\FixedCpmGoal::class);
        $this->goal = $var;

        return $this;
    }

    /**
     * Target frequency bidding goal details.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.FixedCpmTargetFrequencyGoalInfo target_frequency_info = 2;</code>
     * @return \Google\Ads\GoogleAds\V25\Common\FixedCpmTargetFrequencyGoalInfo|null
     */
    public function getTargetFrequencyInfo()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Target frequency bidding goal details.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.common.FixedCpmTargetFrequencyGoalInfo target_frequency_info = 2;</code>
     * @param \Google\Ads\GoogleAds\V25\Common\FixedCpmTargetFrequencyGoalInfo $var
     * @return $this
     */
    public function setTargetFrequencyInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V25\Common\FixedCpmTargetFrequencyGoalInfo::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

