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

namespace Keyapis\Vc\V1;

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

/**
 * Ответ на запрос получения камеры
 *
 * Generated from protobuf message <code>keyapis.vc.v1.GetCameraResponse</code>
 */
class GetCameraResponse extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Vc\V1\Camera $data
     *           Камера
     *     @type \Keyapis\Vc\V1\GetCameraResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Vc\V1\KeyapisVcCameraV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Камера
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.Camera data = 1;</code>
     * @return \Keyapis\Vc\V1\Camera|null
     */
    public function getData()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Камера
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.Camera data = 1;</code>
     * @param \Keyapis\Vc\V1\Camera $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Vc\V1\Camera::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

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

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

        return $this;
    }

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

}

