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

namespace Keyapis\Dial\V1;

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

/**
 *Ответ на запрос на получение списка устройств
 *
 * Generated from protobuf message <code>keyapis.dial.v1.GetSipLoginResponse</code>
 */
class GetSipLoginResponse extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $sip_account
     *           SIP-Логин устройства
     *     @type \Keyapis\Dial\V1\GetSipLoginResponse\Error $error
     *           Ошибка
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Dial\V1\KeyapisDialEmergencyV1::initOnce();
        parent::__construct($data);
    }

    /**
     * SIP-Логин устройства
     *
     * Generated from protobuf field <code>string sip_account = 1;</code>
     * @return string
     */
    public function getSipAccount()
    {
        return $this->readOneof(1);
    }

    public function hasSipAccount()
    {
        return $this->hasOneof(1);
    }

    /**
     * SIP-Логин устройства
     *
     * Generated from protobuf field <code>string sip_account = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSipAccount($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.dial.v1.GetSipLoginResponse.Error error = 2;</code>
     * @return \Keyapis\Dial\V1\GetSipLoginResponse\Error|null
     */
    public function getError()
    {
        return $this->readOneof(2);
    }

    public function hasError()
    {
        return $this->hasOneof(2);
    }

    /**
     * Ошибка
     *
     * Generated from protobuf field <code>.keyapis.dial.v1.GetSipLoginResponse.Error error = 2;</code>
     * @param \Keyapis\Dial\V1\GetSipLoginResponse\Error $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Dial\V1\GetSipLoginResponse\Error::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return $this->whichOneof("type");
    }

}

