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

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

/**
 * Ошибка замены ПУ
 *
 * Generated from protobuf message <code>keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\TelemetryControl\V1\Device\ValidationError $validation
     *           Ошибка валидации
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\ReplaceDeviceNotFound $replace_device_not_found
     *           Не найден заменяемый ПУ
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\CreateIndicatorsFail $create_indicators_fail
     *           Не удалось создать индикаторы нового ПУ
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MultiLinkedMetricPoint $multi_linked_metric_point
     *           Попытка замены ПУ, привязанного ко многим ТУ
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\WrongBuilding $wrong_building
     *           Заменяющий ПУ не привязан к дому заменяемого ПУ
     *     @type \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MetricPointNotFound $metric_point_not_found
     *           Заменяемый ПУ не привязан к ТУ
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\TelemetryControl\V1\KeyapisTelemetryControlDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка валидации
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device.ValidationError validation = 1;</code>
     * @return \Keyapis\TelemetryControl\V1\Device\ValidationError|null
     */
    public function getValidation()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Ошибка валидации
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.Device.ValidationError validation = 1;</code>
     * @param \Keyapis\TelemetryControl\V1\Device\ValidationError $var
     * @return $this
     */
    public function setValidation($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\Device\ValidationError::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Не найден заменяемый ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.ReplaceDeviceNotFound replace_device_not_found = 2;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\ReplaceDeviceNotFound|null
     */
    public function getReplaceDeviceNotFound()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Не найден заменяемый ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.ReplaceDeviceNotFound replace_device_not_found = 2;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\ReplaceDeviceNotFound $var
     * @return $this
     */
    public function setReplaceDeviceNotFound($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\ReplaceDeviceNotFound::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Не удалось создать индикаторы нового ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.CreateIndicatorsFail create_indicators_fail = 3;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\CreateIndicatorsFail|null
     */
    public function getCreateIndicatorsFail()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Не удалось создать индикаторы нового ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.CreateIndicatorsFail create_indicators_fail = 3;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\CreateIndicatorsFail $var
     * @return $this
     */
    public function setCreateIndicatorsFail($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\CreateIndicatorsFail::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Попытка замены ПУ, привязанного ко многим ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.MultiLinkedMetricPoint multi_linked_metric_point = 4;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MultiLinkedMetricPoint|null
     */
    public function getMultiLinkedMetricPoint()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Попытка замены ПУ, привязанного ко многим ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.MultiLinkedMetricPoint multi_linked_metric_point = 4;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MultiLinkedMetricPoint $var
     * @return $this
     */
    public function setMultiLinkedMetricPoint($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MultiLinkedMetricPoint::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Заменяющий ПУ не привязан к дому заменяемого ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.WrongBuilding wrong_building = 5;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\WrongBuilding|null
     */
    public function getWrongBuilding()
    {
        return $this->readOneof(5);
    }

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

    /**
     * Заменяющий ПУ не привязан к дому заменяемого ПУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.WrongBuilding wrong_building = 5;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\WrongBuilding $var
     * @return $this
     */
    public function setWrongBuilding($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\WrongBuilding::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Заменяемый ПУ не привязан к ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.MetricPointNotFound metric_point_not_found = 6;</code>
     * @return \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MetricPointNotFound|null
     */
    public function getMetricPointNotFound()
    {
        return $this->readOneof(6);
    }

    public function hasMetricPointNotFound()
    {
        return $this->hasOneof(6);
    }

    /**
     * Заменяемый ПУ не привязан к ТУ
     *
     * Generated from protobuf field <code>.keyapis.telemetry_control.v1.PostDeviceReplaceResponse.Error.MetricPointNotFound metric_point_not_found = 6;</code>
     * @param \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MetricPointNotFound $var
     * @return $this
     */
    public function setMetricPointNotFound($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse\Error\MetricPointNotFound::class);
        $this->writeOneof(6, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Error::class, \Keyapis\TelemetryControl\V1\PostDeviceReplaceResponse_Error::class);

