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

namespace Google\Ads\GoogleAds\V23\Services;

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

/**
 * A conversion rate suggestion.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.services.ConversionRateSuggestion</code>
 */
class ConversionRateSuggestion extends \Google\Protobuf\Internal\Message
{
    /**
     * Model type used to calculate the suggested conversion rate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.ReachPlanConversionRateModelEnum.ReachPlanConversionRateModel conversion_rate_model = 1;</code>
     */
    protected $conversion_rate_model = 0;
    /**
     * The code associated with the plannable product (for example: DEMAND_GEN).
     * To list all plannable product codes, use
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v23.services.ReachPlanService.ListPlannableProducts].
     *
     * Generated from protobuf field <code>string plannable_product_code = 2;</code>
     */
    protected $plannable_product_code = '';
    /**
     * The surfaces associated with the plannable product.
     * If not present, the conversion rate is considered surface agnostic for this
     * product.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.services.SurfaceTargeting surface_targeting = 4;</code>
     */
    protected $surface_targeting = null;
    /**
     * The suggested conversion rate. The value is between 0 and 1 (exclusive).
     *
     * Generated from protobuf field <code>double conversion_rate = 3;</code>
     */
    protected $conversion_rate = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $conversion_rate_model
     *           Model type used to calculate the suggested conversion rate.
     *     @type string $plannable_product_code
     *           The code associated with the plannable product (for example: DEMAND_GEN).
     *           To list all plannable product codes, use
     *           [ReachPlanService.ListPlannableProducts][google.ads.googleads.v23.services.ReachPlanService.ListPlannableProducts].
     *     @type \Google\Ads\GoogleAds\V23\Services\SurfaceTargeting $surface_targeting
     *           The surfaces associated with the plannable product.
     *           If not present, the conversion rate is considered surface agnostic for this
     *           product.
     *     @type float $conversion_rate
     *           The suggested conversion rate. The value is between 0 and 1 (exclusive).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Services\ReachPlanService::initOnce();
        parent::__construct($data);
    }

    /**
     * Model type used to calculate the suggested conversion rate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.ReachPlanConversionRateModelEnum.ReachPlanConversionRateModel conversion_rate_model = 1;</code>
     * @return int
     */
    public function getConversionRateModel()
    {
        return $this->conversion_rate_model;
    }

    /**
     * Model type used to calculate the suggested conversion rate.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.ReachPlanConversionRateModelEnum.ReachPlanConversionRateModel conversion_rate_model = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setConversionRateModel($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\ReachPlanConversionRateModelEnum\ReachPlanConversionRateModel::class);
        $this->conversion_rate_model = $var;

        return $this;
    }

    /**
     * The code associated with the plannable product (for example: DEMAND_GEN).
     * To list all plannable product codes, use
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v23.services.ReachPlanService.ListPlannableProducts].
     *
     * Generated from protobuf field <code>string plannable_product_code = 2;</code>
     * @return string
     */
    public function getPlannableProductCode()
    {
        return $this->plannable_product_code;
    }

    /**
     * The code associated with the plannable product (for example: DEMAND_GEN).
     * To list all plannable product codes, use
     * [ReachPlanService.ListPlannableProducts][google.ads.googleads.v23.services.ReachPlanService.ListPlannableProducts].
     *
     * Generated from protobuf field <code>string plannable_product_code = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPlannableProductCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->plannable_product_code = $var;

        return $this;
    }

    /**
     * The surfaces associated with the plannable product.
     * If not present, the conversion rate is considered surface agnostic for this
     * product.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.services.SurfaceTargeting surface_targeting = 4;</code>
     * @return \Google\Ads\GoogleAds\V23\Services\SurfaceTargeting|null
     */
    public function getSurfaceTargeting()
    {
        return $this->surface_targeting;
    }

    public function hasSurfaceTargeting()
    {
        return isset($this->surface_targeting);
    }

    public function clearSurfaceTargeting()
    {
        unset($this->surface_targeting);
    }

    /**
     * The surfaces associated with the plannable product.
     * If not present, the conversion rate is considered surface agnostic for this
     * product.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.services.SurfaceTargeting surface_targeting = 4;</code>
     * @param \Google\Ads\GoogleAds\V23\Services\SurfaceTargeting $var
     * @return $this
     */
    public function setSurfaceTargeting($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Services\SurfaceTargeting::class);
        $this->surface_targeting = $var;

        return $this;
    }

    /**
     * The suggested conversion rate. The value is between 0 and 1 (exclusive).
     *
     * Generated from protobuf field <code>double conversion_rate = 3;</code>
     * @return float
     */
    public function getConversionRate()
    {
        return $this->conversion_rate;
    }

    /**
     * The suggested conversion rate. The value is between 0 and 1 (exclusive).
     *
     * Generated from protobuf field <code>double conversion_rate = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setConversionRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->conversion_rate = $var;

        return $this;
    }

}

