<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/telemetry_control/v1/keyapis_telemetry_control_device_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.PostDeviceQueryListResponse</code>
 */
class PostDeviceQueryListResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Прибор учета
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_control.v1.Device data = 1;</code>
     */
    private $data;
    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceQueryListResponse.Error error = 2;</code>
     */
    protected $error = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Keyapis\TelemetryControl\V1\Device>|\Google\Protobuf\Internal\RepeatedField $data
     *           Прибор учета
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceQueryListResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryControl\V1\KeyapisTelemetryControlDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Прибор учета
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_control.v1.Device data = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * Прибор учета
     *
     * Generated from protobuf field <code>repeated .keyapis.telemetry_control.v1.Device data = 1;</code>
     * @param array<\Keyapis\TelemetryControl\V1\Device>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setData($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Keyapis\TelemetryControl\V1\Device::class);
        $this->data = $arr;

        return $this;
    }

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceQueryListResponse.Error error = 2;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceQueryListResponse\Error|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceQueryListResponse.Error error = 2;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceQueryListResponse\Error $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceQueryListResponse\Error::class);
        $this->error = $var;

        return $this;
    }

}

