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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.PublishDataTrackRequest</code>
 */
class PublishDataTrackRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Client-assigned, 16-bit identifier that will be attached to packets sent by the publisher.
     * This must be non-zero and unique for each data track published by the publisher.
     *
     * Generated from protobuf field <code>uint32 pub_handle = 1;</code>
     */
    protected $pub_handle = 0;
    /**
     * Human-readable identifier (e.g., `geoLocation`, `servoPosition.x`, etc.), unique per publisher.
     * This must be non-empty and no longer than 256 characters.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    protected $name = '';
    /**
     * Method used for end-to-end encryption (E2EE) on frame payloads.
     *
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 3;</code>
     */
    protected $encryption = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $pub_handle
     *           Client-assigned, 16-bit identifier that will be attached to packets sent by the publisher.
     *           This must be non-zero and unique for each data track published by the publisher.
     *     @type string $name
     *           Human-readable identifier (e.g., `geoLocation`, `servoPosition.x`, etc.), unique per publisher.
     *           This must be non-empty and no longer than 256 characters.
     *     @type int $encryption
     *           Method used for end-to-end encryption (E2EE) on frame payloads.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * Client-assigned, 16-bit identifier that will be attached to packets sent by the publisher.
     * This must be non-zero and unique for each data track published by the publisher.
     *
     * Generated from protobuf field <code>uint32 pub_handle = 1;</code>
     * @return int
     */
    public function getPubHandle()
    {
        return $this->pub_handle;
    }

    /**
     * Client-assigned, 16-bit identifier that will be attached to packets sent by the publisher.
     * This must be non-zero and unique for each data track published by the publisher.
     *
     * Generated from protobuf field <code>uint32 pub_handle = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setPubHandle($var)
    {
        GPBUtil::checkUint32($var);
        $this->pub_handle = $var;

        return $this;
    }

    /**
     * Human-readable identifier (e.g., `geoLocation`, `servoPosition.x`, etc.), unique per publisher.
     * This must be non-empty and no longer than 256 characters.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Human-readable identifier (e.g., `geoLocation`, `servoPosition.x`, etc.), unique per publisher.
     * This must be non-empty and no longer than 256 characters.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Method used for end-to-end encryption (E2EE) on frame payloads.
     *
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 3;</code>
     * @return int
     */
    public function getEncryption()
    {
        return $this->encryption;
    }

    /**
     * Method used for end-to-end encryption (E2EE) on frame payloads.
     *
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setEncryption($var)
    {
        GPBUtil::checkEnum($var, \Livekit\Encryption\Type::class);
        $this->encryption = $var;

        return $this;
    }

}

