<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/telemetry_control/v1/keyapis_telemetry_control_stream_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.ResourceId</code>
 */
class ResourceId extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $building_id
     *           Идентификатор объекта строительства
     *     @type int $device_id
     *           Идентификатор ПУ
     *     @type string $metric_point_id
     *           Идентификатор ТУ
     *     @type int $indicator_id
     *           Идентификатор индикатора
     *     @type \Keyapis\TelemetryControl\V1\DeviceIndicatorMetricPoint $indicator_metric_point
     *           Связка индикатора и ТУ
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryControl\V1\KeyapisTelemetryControlStreamV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор объекта строительства
     *
     * Generated from protobuf field <code>int32 building_id = 1;</code>
     * @return int
     */
    public function getBuildingId()
    {
        return $this->readOneof(1);
    }

    public function hasBuildingId()
    {
        return $this->hasOneof(1);
    }

    /**
     * Идентификатор объекта строительства
     *
     * Generated from protobuf field <code>int32 building_id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setBuildingId($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Идентификатор ПУ
     *
     * Generated from protobuf field <code>int32 device_id = 2;</code>
     * @return int
     */
    public function getDeviceId()
    {
        return $this->readOneof(2);
    }

    public function hasDeviceId()
    {
        return $this->hasOneof(2);
    }

    /**
     * Идентификатор ПУ
     *
     * Generated from protobuf field <code>int32 device_id = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Идентификатор ТУ
     *
     * Generated from protobuf field <code>string metric_point_id = 3;</code>
     * @return string
     */
    public function getMetricPointId()
    {
        return $this->readOneof(3);
    }

    public function hasMetricPointId()
    {
        return $this->hasOneof(3);
    }

    /**
     * Идентификатор ТУ
     *
     * Generated from protobuf field <code>string metric_point_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMetricPointId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

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

    public function hasIndicatorId()
    {
        return $this->hasOneof(4);
    }

    /**
     * Идентификатор индикатора
     *
     * Generated from protobuf field <code>int32 indicator_id = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setIndicatorId($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Связка индикатора и ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.DeviceIndicatorMetricPoint indicator_metric_point = 5;</code>
     * @return \Keyapis\TelemetryControl\V1\DeviceIndicatorMetricPoint|null
     */
    public function getIndicatorMetricPoint()
    {
        return $this->readOneof(5);
    }

    public function hasIndicatorMetricPoint()
    {
        return $this->hasOneof(5);
    }

    /**
     * Связка индикатора и ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.DeviceIndicatorMetricPoint indicator_metric_point = 5;</code>
     * @param \Keyapis\TelemetryControl\V1\DeviceIndicatorMetricPoint $var
     * @return $this
     */
    public function setIndicatorMetricPoint($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\DeviceIndicatorMetricPoint::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return $this->whichOneof("type");
    }

}

