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

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

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

/**
 * The add responsive search ad recommendation.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.resources.Recommendation.ResponsiveSearchAdRecommendation</code>
 */
class ResponsiveSearchAdRecommendation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Recommended ad.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Ad ad = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $ad = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type \Google\Ads\GoogleAds\V24\Resources\Ad $ad
     *           Output only. Recommended ad.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Resources\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Recommended ad.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Ad ad = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Resources\Ad|null
     */
    public function getAd()
    {
        return $this->ad;
    }

    public function hasAd()
    {
        return isset($this->ad);
    }

    public function clearAd()
    {
        unset($this->ad);
    }

    /**
     * Output only. Recommended ad.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.resources.Ad ad = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Resources\Ad $var
     * @return $this
     */
    public function setAd($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Resources\Ad::class);
        $this->ad = $var;

        return $this;
    }

}

