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

namespace Keyapis\TelemetryMetric\V1;

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

/**
 * Измерение.
 * Очередь key.telemetry_consumer.measurement_stream_request.v1
 *
 * Generated from protobuf message <code>keyapis.telemetry_metric.v1.Measurement</code>
 */
class Measurement extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 indicator_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $indicator_id = 0;
    /**
     * Значение
     *
     * Generated from protobuf field <code>float value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $value = 0.0;
    /**
     * Временная метка сбора счётчиком.
     * Если не передано берётся серверное время
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp synced_at = 3;</code>
     */
    protected $synced_at = null;
    /**
     * ФИАС
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue fias_id = 4;</code>
     */
    protected $fias_id = null;
    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_id = 5;</code>
     */
    protected $device_id = null;
    /**
     * Идентификатор родительского устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_parent_id = 6;</code>
     */
    protected $device_parent_id = null;
    /**
     * Модель устройства
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue device_model = 7;</code>
     */
    protected $device_model = null;
    /**
     * Тип устройства
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.DeviceType device_type = 8;</code>
     */
    protected $device_type = 0;
    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.MetricType metric_type = 9;</code>
     */
    protected $metric_type = 0;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;
    /**
     * Сдвиг таймзоны относительно UTC для даты synced_at
     *
     * Generated from protobuf field <code>int32 utc_offset = 11;</code>
     */
    protected $utc_offset = 0;
    /**
     * Тип единицы измерения, в которой представлено, получаемое измерение
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.UnitType unit_type = 12;</code>
     */
    protected $unit_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $indicator_id
     *           Идентификатор
     *     @type float $value
     *           Значение
     *     @type \Google\Protobuf\Timestamp $synced_at
     *           Временная метка сбора счётчиком.
     *           Если не передано берётся серверное время
     *     @type \Google\Protobuf\StringValue $fias_id
     *           ФИАС
     *     @type \Google\Protobuf\Int32Value $device_id
     *           Идентификатор устройства
     *     @type \Google\Protobuf\Int32Value $device_parent_id
     *           Идентификатор родительского устройства
     *     @type \Google\Protobuf\StringValue $device_model
     *           Модель устройства
     *     @type int $device_type
     *           Тип устройства
     *     @type int $metric_type
     *           Тип энергоресурса
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта
     *     @type int $utc_offset
     *           Сдвиг таймзоны относительно UTC для даты synced_at
     *     @type int $unit_type
     *           Тип единицы измерения, в которой представлено, получаемое измерение
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryMetric\V1\KeyapisTelemetryMetricMeasurementV1::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Значение
     *
     * Generated from protobuf field <code>float value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Значение
     *
     * Generated from protobuf field <code>float value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkFloat($var);
        $this->value = $var;

        return $this;
    }

    /**
     * Временная метка сбора счётчиком.
     * Если не передано берётся серверное время
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp synced_at = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getSyncedAt()
    {
        return $this->synced_at;
    }

    public function hasSyncedAt()
    {
        return isset($this->synced_at);
    }

    public function clearSyncedAt()
    {
        unset($this->synced_at);
    }

    /**
     * Временная метка сбора счётчиком.
     * Если не передано берётся серверное время
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp synced_at = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setSyncedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->synced_at = $var;

        return $this;
    }

    /**
     * ФИАС
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue fias_id = 4;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getFiasId()
    {
        return $this->fias_id;
    }

    public function hasFiasId()
    {
        return isset($this->fias_id);
    }

    public function clearFiasId()
    {
        unset($this->fias_id);
    }

    /**
     * Returns the unboxed value from <code>getFiasId()</code>

     * ФИАС
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue fias_id = 4;</code>
     * @return string|null
     */
    public function getFiasIdUnwrapped()
    {
        return $this->readWrapperValue("fias_id");
    }

    /**
     * ФИАС
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue fias_id = 4;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setFiasId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->fias_id = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * ФИАС
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue fias_id = 4;</code>
     * @param string|null $var
     * @return $this
     */
    public function setFiasIdUnwrapped($var)
    {
        $this->writeWrapperValue("fias_id", $var);
        return $this;}

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_id = 5;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getDeviceId()
    {
        return $this->device_id;
    }

    public function hasDeviceId()
    {
        return isset($this->device_id);
    }

    public function clearDeviceId()
    {
        unset($this->device_id);
    }

    /**
     * Returns the unboxed value from <code>getDeviceId()</code>

     * Идентификатор устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_id = 5;</code>
     * @return int|null
     */
    public function getDeviceIdUnwrapped()
    {
        return $this->readWrapperValue("device_id");
    }

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_id = 5;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->device_id = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Идентификатор устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_id = 5;</code>
     * @param int|null $var
     * @return $this
     */
    public function setDeviceIdUnwrapped($var)
    {
        $this->writeWrapperValue("device_id", $var);
        return $this;}

    /**
     * Идентификатор родительского устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_parent_id = 6;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getDeviceParentId()
    {
        return $this->device_parent_id;
    }

    public function hasDeviceParentId()
    {
        return isset($this->device_parent_id);
    }

    public function clearDeviceParentId()
    {
        unset($this->device_parent_id);
    }

    /**
     * Returns the unboxed value from <code>getDeviceParentId()</code>

     * Идентификатор родительского устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_parent_id = 6;</code>
     * @return int|null
     */
    public function getDeviceParentIdUnwrapped()
    {
        return $this->readWrapperValue("device_parent_id");
    }

    /**
     * Идентификатор родительского устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_parent_id = 6;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setDeviceParentId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->device_parent_id = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Идентификатор родительского устройства
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value device_parent_id = 6;</code>
     * @param int|null $var
     * @return $this
     */
    public function setDeviceParentIdUnwrapped($var)
    {
        $this->writeWrapperValue("device_parent_id", $var);
        return $this;}

    /**
     * Модель устройства
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue device_model = 7;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getDeviceModel()
    {
        return $this->device_model;
    }

    public function hasDeviceModel()
    {
        return isset($this->device_model);
    }

    public function clearDeviceModel()
    {
        unset($this->device_model);
    }

    /**
     * Returns the unboxed value from <code>getDeviceModel()</code>

     * Модель устройства
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue device_model = 7;</code>
     * @return string|null
     */
    public function getDeviceModelUnwrapped()
    {
        return $this->readWrapperValue("device_model");
    }

    /**
     * Модель устройства
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue device_model = 7;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setDeviceModel($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->device_model = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Модель устройства
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue device_model = 7;</code>
     * @param string|null $var
     * @return $this
     */
    public function setDeviceModelUnwrapped($var)
    {
        $this->writeWrapperValue("device_model", $var);
        return $this;}

    /**
     * Тип устройства
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.DeviceType device_type = 8;</code>
     * @return int
     */
    public function getDeviceType()
    {
        return $this->device_type;
    }

    /**
     * Тип устройства
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.DeviceType device_type = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryMetric\V1\Measurement\DeviceType::class);
        $this->device_type = $var;

        return $this;
    }

    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.MetricType metric_type = 9;</code>
     * @return int
     */
    public function getMetricType()
    {
        return $this->metric_type;
    }

    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.MetricType metric_type = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setMetricType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryMetric\V1\Measurement\MetricType::class);
        $this->metric_type = $var;

        return $this;
    }

    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getChangedAt()
    {
        return $this->changed_at;
    }

    public function hasChangedAt()
    {
        return isset($this->changed_at);
    }

    public function clearChangedAt()
    {
        unset($this->changed_at);
    }

    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setChangedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->changed_at = $var;

        return $this;
    }

    /**
     * Сдвиг таймзоны относительно UTC для даты synced_at
     *
     * Generated from protobuf field <code>int32 utc_offset = 11;</code>
     * @return int
     */
    public function getUtcOffset()
    {
        return $this->utc_offset;
    }

    /**
     * Сдвиг таймзоны относительно UTC для даты synced_at
     *
     * Generated from protobuf field <code>int32 utc_offset = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setUtcOffset($var)
    {
        GPBUtil::checkInt32($var);
        $this->utc_offset = $var;

        return $this;
    }

    /**
     * Тип единицы измерения, в которой представлено, получаемое измерение
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.UnitType unit_type = 12;</code>
     * @return int
     */
    public function getUnitType()
    {
        return $this->unit_type;
    }

    /**
     * Тип единицы измерения, в которой представлено, получаемое измерение
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.UnitType unit_type = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setUnitType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryMetric\V1\Measurement\UnitType::class);
        $this->unit_type = $var;

        return $this;
    }

}

