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

namespace Google\Ads\GoogleAds\V20\Resources\Recommendation;

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

/**
 * The keyword recommendation.
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.resources.Recommendation.KeywordRecommendation</code>
 */
class KeywordRecommendation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The recommended keyword.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.KeywordInfo keyword = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $keyword = null;
    /**
     * Output only. A list of search terms this keyword matches. The same search
     * term may be repeated for multiple keywords.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v20.resources.Recommendation.KeywordRecommendation.SearchTerm search_terms = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $search_terms;
    /**
     * Output only. The recommended CPC (cost-per-click) bid.
     *
     * Generated from protobuf field <code>optional int64 recommended_cpc_bid_micros = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $recommended_cpc_bid_micros = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V20\Common\KeywordInfo $keyword
     *           Output only. The recommended keyword.
     *     @type array<\Google\Ads\GoogleAds\V20\Resources\Recommendation\KeywordRecommendation\SearchTerm>|\Google\Protobuf\Internal\RepeatedField $search_terms
     *           Output only. A list of search terms this keyword matches. The same search
     *           term may be repeated for multiple keywords.
     *     @type int|string $recommended_cpc_bid_micros
     *           Output only. The recommended CPC (cost-per-click) bid.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Resources\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The recommended keyword.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.KeywordInfo keyword = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Ads\GoogleAds\V20\Common\KeywordInfo|null
     */
    public function getKeyword()
    {
        return $this->keyword;
    }

    public function hasKeyword()
    {
        return isset($this->keyword);
    }

    public function clearKeyword()
    {
        unset($this->keyword);
    }

    /**
     * Output only. The recommended keyword.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.KeywordInfo keyword = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Ads\GoogleAds\V20\Common\KeywordInfo $var
     * @return $this
     */
    public function setKeyword($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Common\KeywordInfo::class);
        $this->keyword = $var;

        return $this;
    }

    /**
     * Output only. A list of search terms this keyword matches. The same search
     * term may be repeated for multiple keywords.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v20.resources.Recommendation.KeywordRecommendation.SearchTerm search_terms = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSearchTerms()
    {
        return $this->search_terms;
    }

    /**
     * Output only. A list of search terms this keyword matches. The same search
     * term may be repeated for multiple keywords.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v20.resources.Recommendation.KeywordRecommendation.SearchTerm search_terms = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Ads\GoogleAds\V20\Resources\Recommendation\KeywordRecommendation\SearchTerm>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSearchTerms($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V20\Resources\Recommendation\KeywordRecommendation\SearchTerm::class);
        $this->search_terms = $arr;

        return $this;
    }

    /**
     * Output only. The recommended CPC (cost-per-click) bid.
     *
     * Generated from protobuf field <code>optional int64 recommended_cpc_bid_micros = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getRecommendedCpcBidMicros()
    {
        return isset($this->recommended_cpc_bid_micros) ? $this->recommended_cpc_bid_micros : 0;
    }

    public function hasRecommendedCpcBidMicros()
    {
        return isset($this->recommended_cpc_bid_micros);
    }

    public function clearRecommendedCpcBidMicros()
    {
        unset($this->recommended_cpc_bid_micros);
    }

    /**
     * Output only. The recommended CPC (cost-per-click) bid.
     *
     * Generated from protobuf field <code>optional int64 recommended_cpc_bid_micros = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setRecommendedCpcBidMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->recommended_cpc_bid_micros = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(KeywordRecommendation::class, \Google\Ads\GoogleAds\V20\Resources\Recommendation_KeywordRecommendation::class);

