<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: plugnmeet_nats_msg.proto

namespace Mynaparrot\PlugnmeetProto;

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

/**
 * Generated from protobuf message <code>plugnmeet.TurnCredentials</code>
 */
class TurnCredentials extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string username = 1;</code>
     */
    protected $username = '';
    /**
     * Generated from protobuf field <code>string password = 2;</code>
     */
    protected $password = '';
    /**
     * Generated from protobuf field <code>repeated string uris = 3;</code>
     */
    private $uris;
    /**
     * Generated from protobuf field <code>bool force_turn = 4;</code>
     */
    protected $force_turn = false;
    /**
     * Generated from protobuf field <code>bool fallback_turn = 5;</code>
     */
    protected $fallback_turn = false;
    /**
     * The duration in Seconds to wait with a poor connection before triggering the fallback.
     *
     * Generated from protobuf field <code>int64 fallback_timer_duration = 6;</code>
     */
    protected $fallback_timer_duration = 0;
    /**
     * Generated from protobuf field <code>optional .plugnmeet.FallbackOnFlapping fallback_on_flapping = 7;</code>
     */
    protected $fallback_on_flapping = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $username
     *     @type string $password
     *     @type string[] $uris
     *     @type bool $force_turn
     *     @type bool $fallback_turn
     *     @type int|string $fallback_timer_duration
     *           The duration in Seconds to wait with a poor connection before triggering the fallback.
     *     @type \Mynaparrot\PlugnmeetProto\FallbackOnFlapping $fallback_on_flapping
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\PlugnmeetNatsMsg::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string username = 1;</code>
     * @return string
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * Generated from protobuf field <code>string username = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setUsername($var)
    {
        GPBUtil::checkString($var, True);
        $this->username = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string password = 2;</code>
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * Generated from protobuf field <code>string password = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPassword($var)
    {
        GPBUtil::checkString($var, True);
        $this->password = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated string uris = 3;</code>
     * @return RepeatedField<string>
     */
    public function getUris()
    {
        return $this->uris;
    }

    /**
     * Generated from protobuf field <code>repeated string uris = 3;</code>
     * @param string[] $var
     * @return $this
     */
    public function setUris($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->uris = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool force_turn = 4;</code>
     * @return bool
     */
    public function getForceTurn()
    {
        return $this->force_turn;
    }

    /**
     * Generated from protobuf field <code>bool force_turn = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setForceTurn($var)
    {
        GPBUtil::checkBool($var);
        $this->force_turn = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool fallback_turn = 5;</code>
     * @return bool
     */
    public function getFallbackTurn()
    {
        return $this->fallback_turn;
    }

    /**
     * Generated from protobuf field <code>bool fallback_turn = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setFallbackTurn($var)
    {
        GPBUtil::checkBool($var);
        $this->fallback_turn = $var;

        return $this;
    }

    /**
     * The duration in Seconds to wait with a poor connection before triggering the fallback.
     *
     * Generated from protobuf field <code>int64 fallback_timer_duration = 6;</code>
     * @return int|string
     */
    public function getFallbackTimerDuration()
    {
        return $this->fallback_timer_duration;
    }

    /**
     * The duration in Seconds to wait with a poor connection before triggering the fallback.
     *
     * Generated from protobuf field <code>int64 fallback_timer_duration = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setFallbackTimerDuration($var)
    {
        GPBUtil::checkInt64($var);
        $this->fallback_timer_duration = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .plugnmeet.FallbackOnFlapping fallback_on_flapping = 7;</code>
     * @return \Mynaparrot\PlugnmeetProto\FallbackOnFlapping|null
     */
    public function getFallbackOnFlapping()
    {
        return $this->fallback_on_flapping;
    }

    public function hasFallbackOnFlapping()
    {
        return isset($this->fallback_on_flapping);
    }

    public function clearFallbackOnFlapping()
    {
        unset($this->fallback_on_flapping);
    }

    /**
     * Generated from protobuf field <code>optional .plugnmeet.FallbackOnFlapping fallback_on_flapping = 7;</code>
     * @param \Mynaparrot\PlugnmeetProto\FallbackOnFlapping $var
     * @return $this
     */
    public function setFallbackOnFlapping($var)
    {
        GPBUtil::checkMessage($var, \Mynaparrot\PlugnmeetProto\FallbackOnFlapping::class);
        $this->fallback_on_flapping = $var;

        return $this;
    }

}

