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

namespace PhpWA\Protocol\Proto;

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

/**
 * Generated from protobuf message <code>proto.LimitSharing</code>
 */
class LimitSharing extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional bool sharingLimited = 1;</code>
     */
    protected $sharingLimited = null;
    /**
     * Generated from protobuf field <code>optional .proto.LimitSharing.TriggerType trigger = 2;</code>
     */
    protected $trigger = null;
    /**
     * Generated from protobuf field <code>optional int64 limitSharingSettingTimestamp = 3;</code>
     */
    protected $limitSharingSettingTimestamp = null;
    /**
     * Generated from protobuf field <code>optional bool initiatedByMe = 4;</code>
     */
    protected $initiatedByMe = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $sharingLimited
     *     @type int $trigger
     *     @type int|string $limitSharingSettingTimestamp
     *     @type bool $initiatedByMe
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional bool sharingLimited = 1;</code>
     * @return bool
     */
    public function getSharingLimited()
    {
        return isset($this->sharingLimited) ? $this->sharingLimited : false;
    }

    public function hasSharingLimited()
    {
        return isset($this->sharingLimited);
    }

    public function clearSharingLimited()
    {
        unset($this->sharingLimited);
    }

    /**
     * Generated from protobuf field <code>optional bool sharingLimited = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setSharingLimited($var)
    {
        GPBUtil::checkBool($var);
        $this->sharingLimited = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.LimitSharing.TriggerType trigger = 2;</code>
     * @return int
     */
    public function getTrigger()
    {
        return isset($this->trigger) ? $this->trigger : 0;
    }

    public function hasTrigger()
    {
        return isset($this->trigger);
    }

    public function clearTrigger()
    {
        unset($this->trigger);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int64 limitSharingSettingTimestamp = 3;</code>
     * @return int|string
     */
    public function getLimitSharingSettingTimestamp()
    {
        return isset($this->limitSharingSettingTimestamp) ? $this->limitSharingSettingTimestamp : 0;
    }

    public function hasLimitSharingSettingTimestamp()
    {
        return isset($this->limitSharingSettingTimestamp);
    }

    public function clearLimitSharingSettingTimestamp()
    {
        unset($this->limitSharingSettingTimestamp);
    }

    /**
     * Generated from protobuf field <code>optional int64 limitSharingSettingTimestamp = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setLimitSharingSettingTimestamp($var)
    {
        GPBUtil::checkInt64($var);
        $this->limitSharingSettingTimestamp = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool initiatedByMe = 4;</code>
     * @return bool
     */
    public function getInitiatedByMe()
    {
        return isset($this->initiatedByMe) ? $this->initiatedByMe : false;
    }

    public function hasInitiatedByMe()
    {
        return isset($this->initiatedByMe);
    }

    public function clearInitiatedByMe()
    {
        unset($this->initiatedByMe);
    }

    /**
     * Generated from protobuf field <code>optional bool initiatedByMe = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setInitiatedByMe($var)
    {
        GPBUtil::checkBool($var);
        $this->initiatedByMe = $var;

        return $this;
    }

}

