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

namespace Keyapis\TelemetryStatus\V1;

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

/**
 * Статус доступности устройства
 *
 * Generated from protobuf message <code>keyapis.telemetry_status.v1.DeviceStatus</code>
 */
class DeviceStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_id = 0;
    /**
     * IP-адрес устройства
     *
     * Generated from protobuf field <code>string ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $ip = '';
    /**
     * Момент проверки статуса
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp checked_at = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $checked_at = null;
    /**
     * Тип статуса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_status.v1.DeviceStatus.StatusType status_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $status_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $device_id
     *           Идентификатор устройства
     *     @type string $ip
     *           IP-адрес устройства
     *     @type \Google\Protobuf\Timestamp $checked_at
     *           Момент проверки статуса
     *     @type int $status_type
     *           Тип статуса
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryStatus\V1\KeyapisTelemetryStatusDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDeviceId()
    {
        return $this->device_id;
    }

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkInt32($var);
        $this->device_id = $var;

        return $this;
    }

    /**
     * IP-адрес устройства
     *
     * Generated from protobuf field <code>string ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getIp()
    {
        return $this->ip;
    }

    /**
     * IP-адрес устройства
     *
     * Generated from protobuf field <code>string ip = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip = $var;

        return $this;
    }

    /**
     * Момент проверки статуса
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp checked_at = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCheckedAt()
    {
        return $this->checked_at;
    }

    public function hasCheckedAt()
    {
        return isset($this->checked_at);
    }

    public function clearCheckedAt()
    {
        unset($this->checked_at);
    }

    /**
     * Момент проверки статуса
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp checked_at = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCheckedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->checked_at = $var;

        return $this;
    }

    /**
     * Тип статуса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_status.v1.DeviceStatus.StatusType status_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getStatusType()
    {
        return $this->status_type;
    }

    /**
     * Тип статуса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_status.v1.DeviceStatus.StatusType status_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryStatus\V1\DeviceStatus\StatusType::class);
        $this->status_type = $var;

        return $this;
    }

}

