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

namespace Keyapis\Device\V1;

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

/**
 * Аналоговая трубка.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.device.v1.CmsPhone</code>
 */
class CmsPhone extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * ОРПОН Дома.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int64 orpon_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $orpon_id = 0;
    /**
     * Номер квартиры.
     * # Диапазон: 1..5
     *
     * Generated from protobuf field <code>string room = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $room = '';
    /**
     * Идентификатор устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 device_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_id = 0;
    /**
     * Статус аналоговой трубки
     *
     * Generated from protobuf field <code>.keyapis.device.v1.CmsPhone.StatusType status_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $status_type = 0;
    /**
     * Дата создания.
     * # Тип: 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;
    /**
     * Счетчик попыток обновления.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 retry_count = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $retry_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор.
     *           # Диапазон: 0..2147483647
     *     @type int|string $orpon_id
     *           ОРПОН Дома.
     *           # Диапазон: 0..2147483647
     *     @type string $room
     *           Номер квартиры.
     *           # Диапазон: 1..5
     *     @type int $device_id
     *           Идентификатор устройства.
     *           # Диапазон: 0..2147483647
     *     @type int $status_type
     *           Статус аналоговой трубки
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта.
     *           # Тип: DateTime
     *     @type int $retry_count
     *           Счетчик попыток обновления.
     *           # Диапазон: 0..2147483647
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceCmsPhoneV1::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;
    }

    /**
     * ОРПОН Дома.
     * # Диапазон: 0..2147483647
     *
     * 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;
    }

    /**
     * ОРПОН Дома.
     * # Диапазон: 0..2147483647
     *
     * 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;
    }

    /**
     * Номер квартиры.
     * # Диапазон: 1..5
     *
     * Generated from protobuf field <code>string room = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRoom()
    {
        return $this->room;
    }

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

        return $this;
    }

    /**
     * Идентификатор устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 device_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDeviceId()
    {
        return $this->device_id;
    }

    /**
     * Идентификатор устройства.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 device_id = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkInt32($var);
        $this->device_id = $var;

        return $this;
    }

    /**
     * Статус аналоговой трубки
     *
     * Generated from protobuf field <code>.keyapis.device.v1.CmsPhone.StatusType status_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getStatusType()
    {
        return $this->status_type;
    }

    /**
     * Статус аналоговой трубки
     *
     * Generated from protobuf field <code>.keyapis.device.v1.CmsPhone.StatusType status_type = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\CmsPhone\StatusType::class);
        $this->status_type = $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;
    }

    /**
     * Счетчик попыток обновления.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 retry_count = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRetryCount()
    {
        return $this->retry_count;
    }

    /**
     * Счетчик попыток обновления.
     * # Диапазон: 0..2147483647
     *
     * Generated from protobuf field <code>int32 retry_count = 8 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRetryCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->retry_count = $var;

        return $this;
    }

}

