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

namespace Keyapis\Omnichat\V1;

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

/**
 * Ответ на запрос реквезитов для авторизации в Omnichat
 *
 * Generated from protobuf message <code>keyapis.omnichat.v1.PostCredentialsResponse</code>
 */
class PostCredentialsResponse extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Omnichat\V1\Credentials $data
     *           Реквизиты
     *     @type \Keyapis\Omnichat\V1\PostCredentialsResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Omnichat\V1\KeyapisOmnichatCredentialsV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Реквизиты
     *
     * Generated from protobuf field <code>.keyapis.omnichat.v1.Credentials data = 1;</code>
     * @return \Keyapis\Omnichat\V1\Credentials|null
     */
    public function getData()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Реквизиты
     *
     * Generated from protobuf field <code>.keyapis.omnichat.v1.Credentials data = 1;</code>
     * @param \Keyapis\Omnichat\V1\Credentials $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Omnichat\V1\Credentials::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

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

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

        return $this;
    }

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

}

