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

namespace RoadRunner\Lock\DTO\V1BETA1;

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

/**
 * Generated from protobuf message <code>lock.v1beta1.Request</code>
 */
class Request extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string resource = 1;</code>
     */
    protected $resource = '';
    /**
     * Generated from protobuf field <code>string id = 2;</code>
     */
    protected $id = '';
    /**
     * Generated from protobuf field <code>optional int64 ttl = 3;</code>
     */
    protected $ttl = null;
    /**
     * Generated from protobuf field <code>optional int64 wait = 4;</code>
     */
    protected $wait = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $resource
     *     @type string $id
     *     @type int|string $ttl
     *     @type int|string $wait
     * }
     */
    public function __construct($data = NULL) {
        \RoadRunner\Lock\DTO\V1BETA1\GPBMetadata\Lock::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string resource = 1;</code>
     * @return string
     */
    public function getResource()
    {
        return $this->resource;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string id = 2;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

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

        return $this;
    }

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

    public function hasTtl()
    {
        return isset($this->ttl);
    }

    public function clearTtl()
    {
        unset($this->ttl);
    }

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

        return $this;
    }

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

    public function hasWait()
    {
        return isset($this->wait);
    }

    public function clearWait()
    {
        unset($this->wait);
    }

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

        return $this;
    }

}

