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

namespace Keyapis\Notification\V1;

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

/**
 * Пуш-токен.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.notification.v1.PushToken</code>
 */
class PushToken extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * Тип
     *
     * Generated from protobuf field <code>.keyapis.notification.v1.PushToken.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * Токен.
     * # Диапазон: 16..256
     *
     * Generated from protobuf field <code>string token = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $token = '';
    /**
     * Идентификатор устройства пользователя.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string user_app_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $user_app_id = '';
    /**
     * Идентификатор пользователя.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $user_id = null;
    /**
     * Дата и время создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;
    /**
     * Версия приложения.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string app_version = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $app_version = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор.
     *           # Диапазон: 0..2147483647
     *     @type int $type
     *           Тип
     *     @type string $token
     *           Токен.
     *           # Диапазон: 16..256
     *     @type string $user_app_id
     *           Идентификатор устройства пользователя.
     *           # Тип: Guid
     *     @type \Google\Protobuf\Int32Value $user_id
     *           Идентификатор пользователя.
     *           # Диапазон: 1..2147483647
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата и время создания.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта.
     *           # Тип: DateTime
     *     @type string $app_version
     *           Версия приложения.
     *           # Диапазон: 3..256
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Notification\V1\KeyapisNotificationPushTokenV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Тип
     *
     * Generated from protobuf field <code>.keyapis.notification.v1.PushToken.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Тип
     *
     * Generated from protobuf field <code>.keyapis.notification.v1.PushToken.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Notification\V1\PushToken\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Токен.
     * # Диапазон: 16..256
     *
     * Generated from protobuf field <code>string token = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Токен.
     * # Диапазон: 16..256
     *
     * Generated from protobuf field <code>string token = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->token = $var;

        return $this;
    }

    /**
     * Идентификатор устройства пользователя.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string user_app_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getUserAppId()
    {
        return $this->user_app_id;
    }

    /**
     * Идентификатор устройства пользователя.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string user_app_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setUserAppId($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_app_id = $var;

        return $this;
    }

    /**
     * Идентификатор пользователя.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    public function hasUserId()
    {
        return isset($this->user_id);
    }

    public function clearUserId()
    {
        unset($this->user_id);
    }

    /**
     * Returns the unboxed value from <code>getUserId()</code>

     * Идентификатор пользователя.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|null
     */
    public function getUserIdUnwrapped()
    {
        return $this->readWrapperValue("user_id");
    }

    /**
     * Идентификатор пользователя.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->user_id = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Идентификатор пользователя.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value user_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|null $var
     * @return $this
     */
    public function setUserIdUnwrapped($var)
    {
        $this->writeWrapperValue("user_id", $var);
        return $this;}

    /**
     * Дата и время создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 changed_at = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getChangedAt()
    {
        return $this->changed_at;
    }

    public function hasChangedAt()
    {
        return isset($this->changed_at);
    }

    public function clearChangedAt()
    {
        unset($this->changed_at);
    }

    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setChangedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->changed_at = $var;

        return $this;
    }

    /**
     * Версия приложения.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string app_version = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getAppVersion()
    {
        return $this->app_version;
    }

    /**
     * Версия приложения.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string app_version = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setAppVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->app_version = $var;

        return $this;
    }

}

