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

namespace Google\Ads\GoogleAds\V20\Common;

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

/**
 * A business message asset.
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.common.BusinessMessageAsset</code>
 */
class BusinessMessageAsset extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Message provider of the business message asset.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.enums.BusinessMessageProviderEnum.BusinessMessageProvider message_provider = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $message_provider = 0;
    /**
     * Required. A welcome message to prompt the user to initiate a conversation.
     *
     * Generated from protobuf field <code>string starter_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $starter_message = '';
    /**
     * A call to action for the business message asset.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v20.common.BusinessMessageCallToActionInfo call_to_action = 3;</code>
     */
    protected $call_to_action = null;
    protected $message_provider_data;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $message_provider
     *           Required. Message provider of the business message asset.
     *     @type string $starter_message
     *           Required. A welcome message to prompt the user to initiate a conversation.
     *     @type \Google\Ads\GoogleAds\V20\Common\BusinessMessageCallToActionInfo $call_to_action
     *           A call to action for the business message asset.
     *     @type \Google\Ads\GoogleAds\V20\Common\WhatsappBusinessMessageInfo $whatsapp_info
     *           Whatsapp.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Common\AssetTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Message provider of the business message asset.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.enums.BusinessMessageProviderEnum.BusinessMessageProvider message_provider = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getMessageProvider()
    {
        return $this->message_provider;
    }

    /**
     * Required. Message provider of the business message asset.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.enums.BusinessMessageProviderEnum.BusinessMessageProvider message_provider = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setMessageProvider($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V20\Enums\BusinessMessageProviderEnum\BusinessMessageProvider::class);
        $this->message_provider = $var;

        return $this;
    }

    /**
     * Required. A welcome message to prompt the user to initiate a conversation.
     *
     * Generated from protobuf field <code>string starter_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getStarterMessage()
    {
        return $this->starter_message;
    }

    /**
     * Required. A welcome message to prompt the user to initiate a conversation.
     *
     * Generated from protobuf field <code>string starter_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setStarterMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->starter_message = $var;

        return $this;
    }

    /**
     * A call to action for the business message asset.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v20.common.BusinessMessageCallToActionInfo call_to_action = 3;</code>
     * @return \Google\Ads\GoogleAds\V20\Common\BusinessMessageCallToActionInfo|null
     */
    public function getCallToAction()
    {
        return $this->call_to_action;
    }

    public function hasCallToAction()
    {
        return isset($this->call_to_action);
    }

    public function clearCallToAction()
    {
        unset($this->call_to_action);
    }

    /**
     * A call to action for the business message asset.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v20.common.BusinessMessageCallToActionInfo call_to_action = 3;</code>
     * @param \Google\Ads\GoogleAds\V20\Common\BusinessMessageCallToActionInfo $var
     * @return $this
     */
    public function setCallToAction($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Common\BusinessMessageCallToActionInfo::class);
        $this->call_to_action = $var;

        return $this;
    }

    /**
     * Whatsapp.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.WhatsappBusinessMessageInfo whatsapp_info = 5;</code>
     * @return \Google\Ads\GoogleAds\V20\Common\WhatsappBusinessMessageInfo|null
     */
    public function getWhatsappInfo()
    {
        return $this->readOneof(5);
    }

    public function hasWhatsappInfo()
    {
        return $this->hasOneof(5);
    }

    /**
     * Whatsapp.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.WhatsappBusinessMessageInfo whatsapp_info = 5;</code>
     * @param \Google\Ads\GoogleAds\V20\Common\WhatsappBusinessMessageInfo $var
     * @return $this
     */
    public function setWhatsappInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Common\WhatsappBusinessMessageInfo::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getMessageProviderData()
    {
        return $this->whichOneof("message_provider_data");
    }

}

