<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/device/v1/keyapis_device_device_v1.proto

namespace Keyapis\Device\V1;

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

/**
 * Облегчённое устройство.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.device.v1.DeviceLite</code>
 */
class DeviceLite extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * Тип назначения устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $title = '';
    /**
     * Координаты
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Location location = 4;</code>
     */
    protected $location = null;
    /**
     * Статус устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.StatusType status_type = 5;</code>
     */
    protected $status_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор.
     *           # Диапазон: 0..2147483647
     *     @type int $type
     *           Тип назначения устройства
     *     @type string $title
     *           # Диапазон: 3..256
     *     @type \Keyapis\Device\V1\Device\Location $location
     *           Координаты
     *     @type int $status_type
     *           Статус устройства
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Тип назначения устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Тип назначения устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\Device\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->title = $var;

        return $this;
    }

    /**
     * Координаты
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Location location = 4;</code>
     * @return \Keyapis\Device\V1\Device\Location|null
     */
    public function getLocation()
    {
        return $this->location;
    }

    public function hasLocation()
    {
        return isset($this->location);
    }

    public function clearLocation()
    {
        unset($this->location);
    }

    /**
     * Координаты
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.Location location = 4;</code>
     * @param \Keyapis\Device\V1\Device\Location $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\Device\Location::class);
        $this->location = $var;

        return $this;
    }

    /**
     * Статус устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.StatusType status_type = 5;</code>
     * @return int
     */
    public function getStatusType()
    {
        return $this->status_type;
    }

    /**
     * Статус устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.Device.StatusType status_type = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\Device\StatusType::class);
        $this->status_type = $var;

        return $this;
    }

}

