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

namespace Keyapis\Vc\V1\PostCompanyImpersonationResponse;

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

/**
 * Ошибка генерации имперсонационной ссылки для компании
 *
 * Generated from protobuf message <code>keyapis.vc.v1.PostCompanyImpersonationResponse.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Vc\V1\ValidationError $validation
     *           Ошибка валидации
     *     @type \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\OwnerNotFound $owner_not_found
     *           Владелец компании не найден
     *     @type \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\UserServiceError $user_service_error
     *           Ошибка взаимодействия с сервисом User
     *     @type \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\VcfrontServiceError $vcfront_service_error
     *           Ошибка взаимодействия с сервисом vcfront
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Vc\V1\KeyapisVcCompanyV1::initOnce();
        parent::__construct($data);
    }

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

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

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

        return $this;
    }

    /**
     * Владелец компании не найден
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.OwnerNotFound owner_not_found = 2;</code>
     * @return \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\OwnerNotFound|null
     */
    public function getOwnerNotFound()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Владелец компании не найден
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.OwnerNotFound owner_not_found = 2;</code>
     * @param \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\OwnerNotFound $var
     * @return $this
     */
    public function setOwnerNotFound($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\OwnerNotFound::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Ошибка взаимодействия с сервисом User
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.UserServiceError user_service_error = 3;</code>
     * @return \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\UserServiceError|null
     */
    public function getUserServiceError()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Ошибка взаимодействия с сервисом User
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.UserServiceError user_service_error = 3;</code>
     * @param \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\UserServiceError $var
     * @return $this
     */
    public function setUserServiceError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\UserServiceError::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Ошибка взаимодействия с сервисом vcfront
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.VcfrontServiceError vcfront_service_error = 4;</code>
     * @return \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\VcfrontServiceError|null
     */
    public function getVcfrontServiceError()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Ошибка взаимодействия с сервисом vcfront
     *
     * Generated from protobuf field <code>.keyapis.vc.v1.PostCompanyImpersonationResponse.Error.VcfrontServiceError vcfront_service_error = 4;</code>
     * @param \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\VcfrontServiceError $var
     * @return $this
     */
    public function setVcfrontServiceError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Vc\V1\PostCompanyImpersonationResponse\Error\VcfrontServiceError::class);
        $this->writeOneof(4, $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\Vc\V1\PostCompanyImpersonationResponse_Error::class);

