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

namespace Google\Ads\GoogleAds\V20\Services;

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

/**
 * The forecast metrics for the planless keyword campaign.
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.services.KeywordForecastMetrics</code>
 */
class KeywordForecastMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * The total number of impressions.
     *
     * Generated from protobuf field <code>optional double impressions = 1;</code>
     */
    protected $impressions = null;
    /**
     * The average click through rate. Available only if impressions > 0.
     *
     * Generated from protobuf field <code>optional double click_through_rate = 2;</code>
     */
    protected $click_through_rate = null;
    /**
     * The average cpc. Available only if clicks > 0.
     *
     * Generated from protobuf field <code>optional int64 average_cpc_micros = 3;</code>
     */
    protected $average_cpc_micros = null;
    /**
     * The total number of clicks.
     *
     * Generated from protobuf field <code>optional double clicks = 4;</code>
     */
    protected $clicks = null;
    /**
     * The total cost.
     *
     * Generated from protobuf field <code>optional int64 cost_micros = 5;</code>
     */
    protected $cost_micros = null;
    /**
     * Forecasted number of conversions: clicks * conversion_rate.
     *
     * Generated from protobuf field <code>optional double conversions = 6;</code>
     */
    protected $conversions = null;
    /**
     * Forecasted conversion rate.
     *
     * Generated from protobuf field <code>optional double conversion_rate = 7;</code>
     */
    protected $conversion_rate = null;
    /**
     * Average cost per acquisition calculated as cost_micros / conversions.
     *
     * Generated from protobuf field <code>optional int64 average_cpa_micros = 8;</code>
     */
    protected $average_cpa_micros = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $impressions
     *           The total number of impressions.
     *     @type float $click_through_rate
     *           The average click through rate. Available only if impressions > 0.
     *     @type int|string $average_cpc_micros
     *           The average cpc. Available only if clicks > 0.
     *     @type float $clicks
     *           The total number of clicks.
     *     @type int|string $cost_micros
     *           The total cost.
     *     @type float $conversions
     *           Forecasted number of conversions: clicks * conversion_rate.
     *     @type float $conversion_rate
     *           Forecasted conversion rate.
     *     @type int|string $average_cpa_micros
     *           Average cost per acquisition calculated as cost_micros / conversions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Services\KeywordPlanIdeaService::initOnce();
        parent::__construct($data);
    }

    /**
     * The total number of impressions.
     *
     * Generated from protobuf field <code>optional double impressions = 1;</code>
     * @return float
     */
    public function getImpressions()
    {
        return isset($this->impressions) ? $this->impressions : 0.0;
    }

    public function hasImpressions()
    {
        return isset($this->impressions);
    }

    public function clearImpressions()
    {
        unset($this->impressions);
    }

    /**
     * The total number of impressions.
     *
     * Generated from protobuf field <code>optional double impressions = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setImpressions($var)
    {
        GPBUtil::checkDouble($var);
        $this->impressions = $var;

        return $this;
    }

    /**
     * The average click through rate. Available only if impressions > 0.
     *
     * Generated from protobuf field <code>optional double click_through_rate = 2;</code>
     * @return float
     */
    public function getClickThroughRate()
    {
        return isset($this->click_through_rate) ? $this->click_through_rate : 0.0;
    }

    public function hasClickThroughRate()
    {
        return isset($this->click_through_rate);
    }

    public function clearClickThroughRate()
    {
        unset($this->click_through_rate);
    }

    /**
     * The average click through rate. Available only if impressions > 0.
     *
     * Generated from protobuf field <code>optional double click_through_rate = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setClickThroughRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->click_through_rate = $var;

        return $this;
    }

    /**
     * The average cpc. Available only if clicks > 0.
     *
     * Generated from protobuf field <code>optional int64 average_cpc_micros = 3;</code>
     * @return int|string
     */
    public function getAverageCpcMicros()
    {
        return isset($this->average_cpc_micros) ? $this->average_cpc_micros : 0;
    }

    public function hasAverageCpcMicros()
    {
        return isset($this->average_cpc_micros);
    }

    public function clearAverageCpcMicros()
    {
        unset($this->average_cpc_micros);
    }

    /**
     * The average cpc. Available only if clicks > 0.
     *
     * Generated from protobuf field <code>optional int64 average_cpc_micros = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAverageCpcMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->average_cpc_micros = $var;

        return $this;
    }

    /**
     * The total number of clicks.
     *
     * Generated from protobuf field <code>optional double clicks = 4;</code>
     * @return float
     */
    public function getClicks()
    {
        return isset($this->clicks) ? $this->clicks : 0.0;
    }

    public function hasClicks()
    {
        return isset($this->clicks);
    }

    public function clearClicks()
    {
        unset($this->clicks);
    }

    /**
     * The total number of clicks.
     *
     * Generated from protobuf field <code>optional double clicks = 4;</code>
     * @param float $var
     * @return $this
     */
    public function setClicks($var)
    {
        GPBUtil::checkDouble($var);
        $this->clicks = $var;

        return $this;
    }

    /**
     * The total cost.
     *
     * Generated from protobuf field <code>optional int64 cost_micros = 5;</code>
     * @return int|string
     */
    public function getCostMicros()
    {
        return isset($this->cost_micros) ? $this->cost_micros : 0;
    }

    public function hasCostMicros()
    {
        return isset($this->cost_micros);
    }

    public function clearCostMicros()
    {
        unset($this->cost_micros);
    }

    /**
     * The total cost.
     *
     * Generated from protobuf field <code>optional int64 cost_micros = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCostMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->cost_micros = $var;

        return $this;
    }

    /**
     * Forecasted number of conversions: clicks * conversion_rate.
     *
     * Generated from protobuf field <code>optional double conversions = 6;</code>
     * @return float
     */
    public function getConversions()
    {
        return isset($this->conversions) ? $this->conversions : 0.0;
    }

    public function hasConversions()
    {
        return isset($this->conversions);
    }

    public function clearConversions()
    {
        unset($this->conversions);
    }

    /**
     * Forecasted number of conversions: clicks * conversion_rate.
     *
     * Generated from protobuf field <code>optional double conversions = 6;</code>
     * @param float $var
     * @return $this
     */
    public function setConversions($var)
    {
        GPBUtil::checkDouble($var);
        $this->conversions = $var;

        return $this;
    }

    /**
     * Forecasted conversion rate.
     *
     * Generated from protobuf field <code>optional double conversion_rate = 7;</code>
     * @return float
     */
    public function getConversionRate()
    {
        return isset($this->conversion_rate) ? $this->conversion_rate : 0.0;
    }

    public function hasConversionRate()
    {
        return isset($this->conversion_rate);
    }

    public function clearConversionRate()
    {
        unset($this->conversion_rate);
    }

    /**
     * Forecasted conversion rate.
     *
     * Generated from protobuf field <code>optional double conversion_rate = 7;</code>
     * @param float $var
     * @return $this
     */
    public function setConversionRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->conversion_rate = $var;

        return $this;
    }

    /**
     * Average cost per acquisition calculated as cost_micros / conversions.
     *
     * Generated from protobuf field <code>optional int64 average_cpa_micros = 8;</code>
     * @return int|string
     */
    public function getAverageCpaMicros()
    {
        return isset($this->average_cpa_micros) ? $this->average_cpa_micros : 0;
    }

    public function hasAverageCpaMicros()
    {
        return isset($this->average_cpa_micros);
    }

    public function clearAverageCpaMicros()
    {
        unset($this->average_cpa_micros);
    }

    /**
     * Average cost per acquisition calculated as cost_micros / conversions.
     *
     * Generated from protobuf field <code>optional int64 average_cpa_micros = 8;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAverageCpaMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->average_cpa_micros = $var;

        return $this;
    }

}

