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

namespace Keyapis\Subscription\V1;

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

/**
 * Сообщение об изменении состояния привилегии.
 * Очередь key.subscription.privilege_state_change
 *
 * Generated from protobuf message <code>keyapis.subscription.v1.PrivilegeStateChangeTask</code>
 */
class PrivilegeStateChangeTask extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $request_id = '';
    /**
     * Идентификатор ОРПОН дома 
     *
     * Generated from protobuf field <code>int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $orpon_id = 0;
    /**
     * Номер квартиры
     *
     * Generated from protobuf field <code>string room_number = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $room_number = '';
    /**
     * Тип привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $privilege_type = 0;
    /**
     * Тип состояния привилегий
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $state_type = 0;
    /**
     * Предыдущий тип состояния привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;</code>
     */
    protected $previous_state_type = 0;
    /**
     * Дата обновления состояния привилегии
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $updated_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $request_id
     *           Идентификатор запроса
     *     @type int|string $orpon_id
     *           Идентификатор ОРПОН дома 
     *     @type string $room_number
     *           Номер квартиры
     *     @type int $privilege_type
     *           Тип привилегии
     *     @type int $state_type
     *           Тип состояния привилегий
     *     @type int $previous_state_type
     *           Предыдущий тип состояния привилегии
     *     @type \Google\Protobuf\Timestamp $updated_at
     *           Дата обновления состояния привилегии
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Subscription\V1\KeyapisSubscriptionEventsV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

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

        return $this;
    }

    /**
     * Идентификатор ОРПОН дома 
     *
     * Generated from protobuf field <code>int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int|string
     */
    public function getOrponId()
    {
        return $this->orpon_id;
    }

    /**
     * Идентификатор ОРПОН дома 
     *
     * Generated from protobuf field <code>int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int|string $var
     * @return $this
     */
    public function setOrponId($var)
    {
        GPBUtil::checkInt64($var);
        $this->orpon_id = $var;

        return $this;
    }

    /**
     * Номер квартиры
     *
     * Generated from protobuf field <code>string room_number = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRoomNumber()
    {
        return $this->room_number;
    }

    /**
     * Номер квартиры
     *
     * Generated from protobuf field <code>string room_number = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRoomNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->room_number = $var;

        return $this;
    }

    /**
     * Тип привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getPrivilegeType()
    {
        return $this->privilege_type;
    }

    /**
     * Тип привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.Type privilege_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setPrivilegeType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\Privilege\Type::class);
        $this->privilege_type = $var;

        return $this;
    }

    /**
     * Тип состояния привилегий
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getStateType()
    {
        return $this->state_type;
    }

    /**
     * Тип состояния привилегий
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType state_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setStateType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\Privilege\StateType::class);
        $this->state_type = $var;

        return $this;
    }

    /**
     * Предыдущий тип состояния привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;</code>
     * @return int
     */
    public function getPreviousStateType()
    {
        return $this->previous_state_type;
    }

    /**
     * Предыдущий тип состояния привилегии
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Privilege.StateType previous_state_type = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setPreviousStateType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\Privilege\StateType::class);
        $this->previous_state_type = $var;

        return $this;
    }

    /**
     * Дата обновления состояния привилегии
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 7 [(.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);
    }

    /**
     * Дата обновления состояния привилегии
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 7 [(.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;
    }

}

