<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/invoice/v1/keyapis_invoice_invoice_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.Invoice</code>
 */
class Invoice extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор платежа.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';
    /**
     * Описание платежа
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $title = '';
    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $user_id = 0;
    /**
     * Статус платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $invoice_status_type = 0;
    /**
     * Дата создания платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $created_at = null;
    /**
     * Дата обновления платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $updated_at = null;
    /**
     * Позиция счета
     *
     * Generated from protobuf field <code>repeated .keyapis.invoice.v1.Invoice.Position positions = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $positions;
    /**
     * Метод платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;</code>
     */
    protected $pay_interface_type = 0;
    /**
     * Способ оплаты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PaywayType payway_type = 9;</code>
     */
    protected $payway_type = 0;
    /**
     * Дата изменения статуса платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp status_changed_at = 10;</code>
     */
    protected $status_changed_at = null;
    /**
     * Дата платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp paid_at = 11;</code>
     */
    protected $paid_at = null;
    /**
     * Платежная ссылка
     *
     * Generated from protobuf field <code>string pay_url = 12;</code>
     */
    protected $pay_url = '';
    /**
     * Маскированный номер карты при платеже
     *
     * Generated from protobuf field <code>string paid_by_card_masked = 13;</code>
     */
    protected $paid_by_card_masked = '';
    /**
     * Идентификатор платежного средства в внешней системы
     *
     * Generated from protobuf field <code>string paid_by_card_espp_id = 14;</code>
     */
    protected $paid_by_card_espp_id = '';
    /**
     * Тип банковской карты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.CardType card_type = 15;</code>
     */
    protected $card_type = 0;
    /**
     * Код ошибки внешней системы
     *
     * Generated from protobuf field <code>int32 espp_req_status = 16;</code>
     */
    protected $espp_req_status = 0;
    /**
     * Комментарий к статусу платежа из внешней системы
     *
     * Generated from protobuf field <code>string espp_req_user_msg = 17;</code>
     */
    protected $espp_req_user_msg = '';
    /**
     * Уникальный номер транзакции в внешней системы
     *
     * Generated from protobuf field <code>string espp_invoice_id = 18;</code>
     */
    protected $espp_invoice_id = '';
    /**
     * Номер телефона
     *
     * Generated from protobuf field <code>string phone_number = 19;</code>
     */
    protected $phone_number = '';
    /**
     * Электронная почта
     *
     * Generated from protobuf field <code>string email = 20;</code>
     */
    protected $email = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Идентификатор платежа.
     *           # Тип: Guid
     *     @type string $title
     *           Описание платежа
     *     @type int $user_id
     *           Идентификатор пользователя
     *     @type int $invoice_status_type
     *           Статус платежа
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания платежа.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $updated_at
     *           Дата обновления платежа.
     *           # Тип: DateTime
     *     @type array<\Keyapis\Invoice\V1\Invoice\Position>|\Google\Protobuf\Internal\RepeatedField $positions
     *           Позиция счета
     *     @type int $pay_interface_type
     *           Метод платежа
     *     @type int $payway_type
     *           Способ оплаты
     *     @type \Google\Protobuf\Timestamp $status_changed_at
     *           Дата изменения статуса платежа.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $paid_at
     *           Дата платежа.
     *           # Тип: DateTime
     *     @type string $pay_url
     *           Платежная ссылка
     *     @type string $paid_by_card_masked
     *           Маскированный номер карты при платеже
     *     @type string $paid_by_card_espp_id
     *           Идентификатор платежного средства в внешней системы
     *     @type int $card_type
     *           Тип банковской карты
     *     @type int $espp_req_status
     *           Код ошибки внешней системы
     *     @type string $espp_req_user_msg
     *           Комментарий к статусу платежа из внешней системы
     *     @type string $espp_invoice_id
     *           Уникальный номер транзакции в внешней системы
     *     @type string $phone_number
     *           Номер телефона
     *     @type string $email
     *           Электронная почта
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Invoice\V1\KeyapisInvoiceInvoiceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор платежа.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор платежа.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Описание платежа
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Описание платежа
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->title = $var;

        return $this;
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    /**
     * Идентификатор пользователя
     *
     * Generated from protobuf field <code>int32 user_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkInt32($var);
        $this->user_id = $var;

        return $this;
    }

    /**
     * Статус платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getInvoiceStatusType()
    {
        return $this->invoice_status_type;
    }

    /**
     * Статус платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.InvoiceStatusType invoice_status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setInvoiceStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Invoice\V1\Invoice\InvoiceStatusType::class);
        $this->invoice_status_type = $var;

        return $this;
    }

    /**
     * Дата создания платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    public function hasCreatedAt()
    {
        return isset($this->created_at);
    }

    public function clearCreatedAt()
    {
        unset($this->created_at);
    }

    /**
     * Дата создания платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Дата обновления платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    public function hasUpdatedAt()
    {
        return isset($this->updated_at);
    }

    public function clearUpdatedAt()
    {
        unset($this->updated_at);
    }

    /**
     * Дата обновления платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->updated_at = $var;

        return $this;
    }

    /**
     * Позиция счета
     *
     * Generated from protobuf field <code>repeated .keyapis.invoice.v1.Invoice.Position positions = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPositions()
    {
        return $this->positions;
    }

    /**
     * Позиция счета
     *
     * Generated from protobuf field <code>repeated .keyapis.invoice.v1.Invoice.Position positions = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Keyapis\Invoice\V1\Invoice\Position>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPositions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Keyapis\Invoice\V1\Invoice\Position::class);
        $this->positions = $arr;

        return $this;
    }

    /**
     * Метод платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;</code>
     * @return int
     */
    public function getPayInterfaceType()
    {
        return $this->pay_interface_type;
    }

    /**
     * Метод платежа
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PayInterfaceType pay_interface_type = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setPayInterfaceType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Invoice\V1\Invoice\PayInterfaceType::class);
        $this->pay_interface_type = $var;

        return $this;
    }

    /**
     * Способ оплаты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PaywayType payway_type = 9;</code>
     * @return int
     */
    public function getPaywayType()
    {
        return $this->payway_type;
    }

    /**
     * Способ оплаты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.PaywayType payway_type = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setPaywayType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Invoice\V1\Invoice\PaywayType::class);
        $this->payway_type = $var;

        return $this;
    }

    /**
     * Дата изменения статуса платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp status_changed_at = 10;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStatusChangedAt()
    {
        return $this->status_changed_at;
    }

    public function hasStatusChangedAt()
    {
        return isset($this->status_changed_at);
    }

    public function clearStatusChangedAt()
    {
        unset($this->status_changed_at);
    }

    /**
     * Дата изменения статуса платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp status_changed_at = 10;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStatusChangedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->status_changed_at = $var;

        return $this;
    }

    /**
     * Дата платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp paid_at = 11;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getPaidAt()
    {
        return $this->paid_at;
    }

    public function hasPaidAt()
    {
        return isset($this->paid_at);
    }

    public function clearPaidAt()
    {
        unset($this->paid_at);
    }

    /**
     * Дата платежа.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp paid_at = 11;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setPaidAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->paid_at = $var;

        return $this;
    }

    /**
     * Платежная ссылка
     *
     * Generated from protobuf field <code>string pay_url = 12;</code>
     * @return string
     */
    public function getPayUrl()
    {
        return $this->pay_url;
    }

    /**
     * Платежная ссылка
     *
     * Generated from protobuf field <code>string pay_url = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setPayUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->pay_url = $var;

        return $this;
    }

    /**
     * Маскированный номер карты при платеже
     *
     * Generated from protobuf field <code>string paid_by_card_masked = 13;</code>
     * @return string
     */
    public function getPaidByCardMasked()
    {
        return $this->paid_by_card_masked;
    }

    /**
     * Маскированный номер карты при платеже
     *
     * Generated from protobuf field <code>string paid_by_card_masked = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setPaidByCardMasked($var)
    {
        GPBUtil::checkString($var, True);
        $this->paid_by_card_masked = $var;

        return $this;
    }

    /**
     * Идентификатор платежного средства в внешней системы
     *
     * Generated from protobuf field <code>string paid_by_card_espp_id = 14;</code>
     * @return string
     */
    public function getPaidByCardEsppId()
    {
        return $this->paid_by_card_espp_id;
    }

    /**
     * Идентификатор платежного средства в внешней системы
     *
     * Generated from protobuf field <code>string paid_by_card_espp_id = 14;</code>
     * @param string $var
     * @return $this
     */
    public function setPaidByCardEsppId($var)
    {
        GPBUtil::checkString($var, True);
        $this->paid_by_card_espp_id = $var;

        return $this;
    }

    /**
     * Тип банковской карты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.CardType card_type = 15;</code>
     * @return int
     */
    public function getCardType()
    {
        return $this->card_type;
    }

    /**
     * Тип банковской карты
     *
     * Generated from protobuf field <code>.keyapis.invoice.v1.Invoice.CardType card_type = 15;</code>
     * @param int $var
     * @return $this
     */
    public function setCardType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Invoice\V1\Invoice\CardType::class);
        $this->card_type = $var;

        return $this;
    }

    /**
     * Код ошибки внешней системы
     *
     * Generated from protobuf field <code>int32 espp_req_status = 16;</code>
     * @return int
     */
    public function getEsppReqStatus()
    {
        return $this->espp_req_status;
    }

    /**
     * Код ошибки внешней системы
     *
     * Generated from protobuf field <code>int32 espp_req_status = 16;</code>
     * @param int $var
     * @return $this
     */
    public function setEsppReqStatus($var)
    {
        GPBUtil::checkInt32($var);
        $this->espp_req_status = $var;

        return $this;
    }

    /**
     * Комментарий к статусу платежа из внешней системы
     *
     * Generated from protobuf field <code>string espp_req_user_msg = 17;</code>
     * @return string
     */
    public function getEsppReqUserMsg()
    {
        return $this->espp_req_user_msg;
    }

    /**
     * Комментарий к статусу платежа из внешней системы
     *
     * Generated from protobuf field <code>string espp_req_user_msg = 17;</code>
     * @param string $var
     * @return $this
     */
    public function setEsppReqUserMsg($var)
    {
        GPBUtil::checkString($var, True);
        $this->espp_req_user_msg = $var;

        return $this;
    }

    /**
     * Уникальный номер транзакции в внешней системы
     *
     * Generated from protobuf field <code>string espp_invoice_id = 18;</code>
     * @return string
     */
    public function getEsppInvoiceId()
    {
        return $this->espp_invoice_id;
    }

    /**
     * Уникальный номер транзакции в внешней системы
     *
     * Generated from protobuf field <code>string espp_invoice_id = 18;</code>
     * @param string $var
     * @return $this
     */
    public function setEsppInvoiceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->espp_invoice_id = $var;

        return $this;
    }

    /**
     * Номер телефона
     *
     * Generated from protobuf field <code>string phone_number = 19;</code>
     * @return string
     */
    public function getPhoneNumber()
    {
        return $this->phone_number;
    }

    /**
     * Номер телефона
     *
     * Generated from protobuf field <code>string phone_number = 19;</code>
     * @param string $var
     * @return $this
     */
    public function setPhoneNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->phone_number = $var;

        return $this;
    }

    /**
     * Электронная почта
     *
     * Generated from protobuf field <code>string email = 20;</code>
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Электронная почта
     *
     * Generated from protobuf field <code>string email = 20;</code>
     * @param string $var
     * @return $this
     */
    public function setEmail($var)
    {
        GPBUtil::checkString($var, True);
        $this->email = $var;

        return $this;
    }

}

