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

namespace Keyapis\TelemetryControl\V1;

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

/**
 * Шаблон ПУ
 *
 * Generated from protobuf message <code>keyapis.telemetry_control.v1.TemplateDevice</code>
 */
class TemplateDevice extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * Дата создания
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;
    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.MetricType metric_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $metric_type = 0;
    /**
     * ID Модели счетчика
     *
     * Generated from protobuf field <code>int32 model_id = 5;</code>
     */
    protected $model_id = 0;
    /**
     * Шаблоны индикаторов
     *
     * Generated from protobuf field <code>repeated int32 indicator_template_ids = 6;</code>
     */
    private $indicator_template_ids;
    /**
     * Тип тарифного плана.
     * Для ПУ электроэнергии
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.PlanType plan_type = 7;</code>
     */
    protected $plan_type = 0;
    /**
     * Посредник получения показаний
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateIndicator.VendorType indicator_vendor_type = 8;</code>
     */
    protected $indicator_vendor_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении
     *     @type int $metric_type
     *           Тип энергоресурса
     *     @type int $model_id
     *           ID Модели счетчика
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $indicator_template_ids
     *           Шаблоны индикаторов
     *     @type int $plan_type
     *           Тип тарифного плана.
     *           Для ПУ электроэнергии
     *     @type int $indicator_vendor_type
     *           Посредник получения показаний
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryControl\V1\KeyapisTelemetryControlTemplateV1::initOnce();
        parent::__construct($data);
    }

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

    /**
     * Идентификатор
     *
     * 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>.google.protobuf.Timestamp created_at = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    public function hasCreatedAt()
    {
        return isset($this->created_at);
    }

    public function clearCreatedAt()
    {
        unset($this->created_at);
    }

    /**
     * Дата создания
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 3 [(.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 = 3 [(.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;
    }

    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.MetricType metric_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getMetricType()
    {
        return $this->metric_type;
    }

    /**
     * Тип энергоресурса
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.MetricType metric_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setMetricType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryControl\V1\TemplateDevice\MetricType::class);
        $this->metric_type = $var;

        return $this;
    }

    /**
     * ID Модели счетчика
     *
     * Generated from protobuf field <code>int32 model_id = 5;</code>
     * @return int
     */
    public function getModelId()
    {
        return $this->model_id;
    }

    /**
     * ID Модели счетчика
     *
     * Generated from protobuf field <code>int32 model_id = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setModelId($var)
    {
        GPBUtil::checkInt32($var);
        $this->model_id = $var;

        return $this;
    }

    /**
     * Шаблоны индикаторов
     *
     * Generated from protobuf field <code>repeated int32 indicator_template_ids = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIndicatorTemplateIds()
    {
        return $this->indicator_template_ids;
    }

    /**
     * Шаблоны индикаторов
     *
     * Generated from protobuf field <code>repeated int32 indicator_template_ids = 6;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIndicatorTemplateIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->indicator_template_ids = $arr;

        return $this;
    }

    /**
     * Тип тарифного плана.
     * Для ПУ электроэнергии
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.PlanType plan_type = 7;</code>
     * @return int
     */
    public function getPlanType()
    {
        return $this->plan_type;
    }

    /**
     * Тип тарифного плана.
     * Для ПУ электроэнергии
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateDevice.PlanType plan_type = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setPlanType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryControl\V1\TemplateDevice\PlanType::class);
        $this->plan_type = $var;

        return $this;
    }

    /**
     * Посредник получения показаний
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateIndicator.VendorType indicator_vendor_type = 8;</code>
     * @return int
     */
    public function getIndicatorVendorType()
    {
        return $this->indicator_vendor_type;
    }

    /**
     * Посредник получения показаний
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.TemplateIndicator.VendorType indicator_vendor_type = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setIndicatorVendorType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\TelemetryControl\V1\TemplateIndicator\VendorType::class);
        $this->indicator_vendor_type = $var;

        return $this;
    }

}

