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

namespace Keyapis\Invoice\V1;

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

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

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\Error $error
     *           Ошибка валидации
     *     @type \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\RegisterData $data
     *           Данные регистрации
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Invoice\V1\KeyapisInvoicePaymethodV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Ошибка валидации
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.PostPayMethodBankcardResponse.Error error = 1;</code>
     * @return \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\Error|null
     */
    public function getError()
    {
        return $this->readOneof(1);
    }

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

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

        return $this;
    }

    /**
     * Данные регистрации
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.PostPayMethodBankcardResponse.RegisterData data = 2;</code>
     * @return \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\RegisterData|null
     */
    public function getData()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Данные регистрации
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.PostPayMethodBankcardResponse.RegisterData data = 2;</code>
     * @param \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\RegisterData $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Invoice\V1\PostPayMethodBankcardResponse\RegisterData::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

