<?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.Resource</code>
 */
class Resource extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\TelemetryControl\V1\Building $building
     *           Объект строительства
     *     @type \Keyapis\TelemetryControl\V1\Device $device
     *           Идентификатор ПУ
     *     @type \Keyapis\TelemetryControl\V1\Device\MetricPoint $metric_point
     *           Точка учета
     *     @type \Keyapis\TelemetryControl\V1\Indicator $indicator
     *           Индикатор
     *     @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>.keyapis.telemetry_control.v1.Building building = 1;</code>
     * @return \Keyapis\TelemetryControl\V1\Building|null
     */
    public function getBuilding()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Объект строительства
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Building building = 1;</code>
     * @param \Keyapis\TelemetryControl\V1\Building $var
     * @return $this
     */
    public function setBuilding($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Building::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Идентификатор ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device device = 2;</code>
     * @return \Keyapis\TelemetryControl\V1\Device|null
     */
    public function getDevice()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Идентификатор ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device device = 2;</code>
     * @param \Keyapis\TelemetryControl\V1\Device $var
     * @return $this
     */
    public function setDevice($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Device::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Точка учета
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device.MetricPoint metric_point = 3;</code>
     * @return \Keyapis\TelemetryControl\V1\Device\MetricPoint|null
     */
    public function getMetricPoint()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Точка учета
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device.MetricPoint metric_point = 3;</code>
     * @param \Keyapis\TelemetryControl\V1\Device\MetricPoint $var
     * @return $this
     */
    public function setMetricPoint($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Device\MetricPoint::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Индикатор
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Indicator indicator = 4;</code>
     * @return \Keyapis\TelemetryControl\V1\Indicator|null
     */
    public function getIndicator()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Индикатор
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Indicator indicator = 4;</code>
     * @param \Keyapis\TelemetryControl\V1\Indicator $var
     * @return $this
     */
    public function setIndicator($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Indicator::class);
        $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");
    }

}

