<?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;

/**
 * Массив показаний прибора учёта для отчёта
 *
 * Generated from protobuf message <code>keyapis.telemetry_metric.v1.MeasurementReportEntry</code>
 */
class MeasurementReportEntry extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор прибора учёта
     *
     * Generated from protobuf field <code>int32 device_id = 1;</code>
     */
    protected $device_id = 0;
    /**
     * Номер канала для многоканального ПУ
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue channel_number = 2;</code>
     */
    protected $channel_number = null;
    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.MetricType metric_type = 3;</code>
     */
    protected $metric_type = 0;
    /**
     * Наименование индикатора
     *
     * Generated from protobuf field <code>string indicator_title = 4;</code>
     */
    protected $indicator_title = '';
    /**
     * Список индикаторов с показаниями.
     * Сортировка по возрастанию даты
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_metric.v1.IndicatorValue values = 5;</code>
     */
    private $values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $device_id
     *           Идентификатор прибора учёта
     *     @type \Google\Protobuf\StringValue $channel_number
     *           Номер канала для многоканального ПУ
     *     @type int $metric_type
     *           Тип энергоресурса
     *     @type string $indicator_title
     *           Наименование индикатора
     *     @type array<\Keyapis\TelemetryMetric\V1\IndicatorValue>|\Google\Protobuf\Internal\RepeatedField $values
     *           Список индикаторов с показаниями.
     *           Сортировка по возрастанию даты
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryMetric\V1\KeyapisTelemetryMetricMeasurementV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор прибора учёта
     *
     * Generated from protobuf field <code>int32 device_id = 1;</code>
     * @return int
     */
    public function getDeviceId()
    {
        return $this->device_id;
    }

    /**
     * Идентификатор прибора учёта
     *
     * Generated from protobuf field <code>int32 device_id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkInt32($var);
        $this->device_id = $var;

        return $this;
    }

    /**
     * Номер канала для многоканального ПУ
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue channel_number = 2;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getChannelNumber()
    {
        return $this->channel_number;
    }

    public function hasChannelNumber()
    {
        return isset($this->channel_number);
    }

    public function clearChannelNumber()
    {
        unset($this->channel_number);
    }

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

     * Номер канала для многоканального ПУ
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue channel_number = 2;</code>
     * @return string|null
     */
    public function getChannelNumberUnwrapped()
    {
        return $this->readWrapperValue("channel_number");
    }

    /**
     * Номер канала для многоканального ПУ
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue channel_number = 2;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setChannelNumber($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->channel_number = $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 channel_number = 2;</code>
     * @param string|null $var
     * @return $this
     */
    public function setChannelNumberUnwrapped($var)
    {
        $this->writeWrapperValue("channel_number", $var);
        return $this;}

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

    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_metric.v1.Measurement.MetricType metric_type = 3;</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>string indicator_title = 4;</code>
     * @return string
     */
    public function getIndicatorTitle()
    {
        return $this->indicator_title;
    }

    /**
     * Наименование индикатора
     *
     * Generated from protobuf field <code>string indicator_title = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setIndicatorTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->indicator_title = $var;

        return $this;
    }

    /**
     * Список индикаторов с показаниями.
     * Сортировка по возрастанию даты
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_metric.v1.IndicatorValue values = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getValues()
    {
        return $this->values;
    }

    /**
     * Список индикаторов с показаниями.
     * Сортировка по возрастанию даты
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_metric.v1.IndicatorValue values = 5;</code>
     * @param array<\Keyapis\TelemetryMetric\V1\IndicatorValue>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Keyapis\TelemetryMetric\V1\IndicatorValue::class);
        $this->values = $arr;

        return $this;
    }

}

