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

namespace Keyapis\IdentityB2b\V1;

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

/**
 * Ошибки сервисов ключа
 *
 * Generated from protobuf message <code>keyapis.identity_b2b.v1.KeyError</code>
 */
class KeyError extends \Google\Protobuf\Internal\Message
{
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\IdentityB2b\V1\KeyError\UserCreation $user_creation
     *           Ошибка создания пользователя
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\IdentityB2B\V1\KeyapisIdentityB2BAuthorizationV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка создания пользователя
     *
     * Generated from protobuf field <code>.keyapis.identity_b2b.v1.KeyError.UserCreation user_creation = 1;</code>
     * @return \Keyapis\IdentityB2b\V1\KeyError\UserCreation|null
     */
    public function getUserCreation()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Ошибка создания пользователя
     *
     * Generated from protobuf field <code>.keyapis.identity_b2b.v1.KeyError.UserCreation user_creation = 1;</code>
     * @param \Keyapis\IdentityB2b\V1\KeyError\UserCreation $var
     * @return $this
     */
    public function setUserCreation($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\IdentityB2b\V1\KeyError\UserCreation::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

