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

namespace Google\Ads\GoogleAds\V21\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.v21.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.v21.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.v21.services.ReachPlanService.ListPlannableProducts].
     *
     * Generated from protobuf field <code>string plannable_product_code = 2;</code>
     */
    protected $plannable_product_code = '';
    /**
     * 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.v21.services.ReachPlanService.ListPlannableProducts].
     *     @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\V21\Services\ReachPlanService::initOnce();
        parent::__construct($data);
    }

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

}

