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

namespace Keyapis\Device\V1;

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

/**
 * SIP-трубка.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.device.v1.SipPhone</code>
 */
class SipPhone 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>int32 room_id = 2;</code>
     */
    protected $room_id = 0;
    /**
     * SIP номер.
     * # Диапазон: 1..200
     *
     * Generated from protobuf field <code>string sip_number = 3;</code>
     */
    protected $sip_number = '';
    /**
     * Статус SIP-трубки
     *
     * Generated from protobuf field <code>.keyapis.device.v1.SipPhone.StatusType status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $status_type = 0;
    /**
     * Дата создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор трубки.
     *           # Диапазон: 0..2147483647
     *     @type int $room_id
     *           Идентификатор квартиры.
     *           # Диапазон: 0..2147483647
     *     @type string $sip_number
     *           SIP номер.
     *           # Диапазон: 1..200
     *     @type int $status_type
     *           Статус SIP-трубки
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта.
     *           # Тип: DateTime
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceSipPhoneV1::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>int32 room_id = 2;</code>
     * @return int
     */
    public function getRoomId()
    {
        return $this->room_id;
    }

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

        return $this;
    }

    /**
     * SIP номер.
     * # Диапазон: 1..200
     *
     * Generated from protobuf field <code>string sip_number = 3;</code>
     * @return string
     */
    public function getSipNumber()
    {
        return $this->sip_number;
    }

    /**
     * SIP номер.
     * # Диапазон: 1..200
     *
     * Generated from protobuf field <code>string sip_number = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSipNumber($var)
    {
        GPBUtil::checkString($var, True);
        $this->sip_number = $var;

        return $this;
    }

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

    /**
     * Статус SIP-трубки
     *
     * Generated from protobuf field <code>.keyapis.device.v1.SipPhone.StatusType status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\SipPhone\StatusType::class);
        $this->status_type = $var;

        return $this;
    }

    /**
     * Дата создания.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 5 [(.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 = 5 [(.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 = 6 [(.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 = 6 [(.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;
    }

}

