<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\StatusAttribution;

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

/**
 * Generated from protobuf message <code>proto.StatusAttribution.ExternalShare</code>
 */
class ExternalShare extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string actionUrl = 1;</code>
     */
    protected $actionUrl = null;
    /**
     * Generated from protobuf field <code>optional .proto.StatusAttribution.ExternalShare.Source source = 2;</code>
     */
    protected $source = null;
    /**
     * Generated from protobuf field <code>optional int32 duration = 3;</code>
     */
    protected $duration = null;
    /**
     * Generated from protobuf field <code>optional string actionFallbackUrl = 4;</code>
     */
    protected $actionFallbackUrl = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $actionUrl
     *     @type int $source
     *     @type int $duration
     *     @type string $actionFallbackUrl
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional string actionUrl = 1;</code>
     * @return string
     */
    public function getActionUrl()
    {
        return isset($this->actionUrl) ? $this->actionUrl : '';
    }

    public function hasActionUrl()
    {
        return isset($this->actionUrl);
    }

    public function clearActionUrl()
    {
        unset($this->actionUrl);
    }

    /**
     * Generated from protobuf field <code>optional string actionUrl = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setActionUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->actionUrl = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.StatusAttribution.ExternalShare.Source source = 2;</code>
     * @return int
     */
    public function getSource()
    {
        return isset($this->source) ? $this->source : 0;
    }

    public function hasSource()
    {
        return isset($this->source);
    }

    public function clearSource()
    {
        unset($this->source);
    }

    /**
     * Generated from protobuf field <code>optional .proto.StatusAttribution.ExternalShare.Source source = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkEnum($var, \PhpWA\Protocol\Proto\StatusAttribution\ExternalShare\Source::class);
        $this->source = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int32 duration = 3;</code>
     * @return int
     */
    public function getDuration()
    {
        return isset($this->duration) ? $this->duration : 0;
    }

    public function hasDuration()
    {
        return isset($this->duration);
    }

    public function clearDuration()
    {
        unset($this->duration);
    }

    /**
     * Generated from protobuf field <code>optional int32 duration = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkInt32($var);
        $this->duration = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string actionFallbackUrl = 4;</code>
     * @return string
     */
    public function getActionFallbackUrl()
    {
        return isset($this->actionFallbackUrl) ? $this->actionFallbackUrl : '';
    }

    public function hasActionFallbackUrl()
    {
        return isset($this->actionFallbackUrl);
    }

    public function clearActionFallbackUrl()
    {
        unset($this->actionFallbackUrl);
    }

    /**
     * Generated from protobuf field <code>optional string actionFallbackUrl = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setActionFallbackUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->actionFallbackUrl = $var;

        return $this;
    }

}

