livekit-protocol 0.7.5

Livekit protocol and utilities for the Rust SDK
Documentation
// Copyright 2025 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v4.23.4
// source: livekit_token_source.proto

package livekit

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type TokenSourceRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The name of the room being requested when generating credentials
	RoomName *string `protobuf:"bytes,1,opt,name=room_name,json=roomName,proto3,oneof" json:"room_name,omitempty"`
	// The name of the participant being requested for this client when generating credentials
	ParticipantName *string `protobuf:"bytes,2,opt,name=participant_name,json=participantName,proto3,oneof" json:"participant_name,omitempty"`
	// The identity of the participant being requested for this client when generating credentials
	ParticipantIdentity *string `protobuf:"bytes,3,opt,name=participant_identity,json=participantIdentity,proto3,oneof" json:"participant_identity,omitempty"`
	// Any participant metadata being included along with the credentials generation operation
	ParticipantMetadata *string `protobuf:"bytes,4,opt,name=participant_metadata,json=participantMetadata,proto3,oneof" json:"participant_metadata,omitempty"`
	// Any participant attributes being included along with the credentials generation operation
	ParticipantAttributes map[string]string `protobuf:"bytes,5,rep,name=participant_attributes,json=participantAttributes,proto3" json:"participant_attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// A RoomConfiguration object can be passed to request extra parameters should be included when
	// generating connection credentials - dispatching agents, defining egress settings, etc
	// More info: https://docs.livekit.io/home/get-started/authentication/#room-configuration
	RoomConfig    *RoomConfiguration `protobuf:"bytes,6,opt,name=room_config,json=roomConfig,proto3,oneof" json:"room_config,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *TokenSourceRequest) Reset() {
	*x = TokenSourceRequest{}
	mi := &file_livekit_token_source_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *TokenSourceRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*TokenSourceRequest) ProtoMessage() {}

func (x *TokenSourceRequest) ProtoReflect() protoreflect.Message {
	mi := &file_livekit_token_source_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use TokenSourceRequest.ProtoReflect.Descriptor instead.
func (*TokenSourceRequest) Descriptor() ([]byte, []int) {
	return file_livekit_token_source_proto_rawDescGZIP(), []int{0}
}

func (x *TokenSourceRequest) GetRoomName() string {
	if x != nil && x.RoomName != nil {
		return *x.RoomName
	}
	return ""
}

func (x *TokenSourceRequest) GetParticipantName() string {
	if x != nil && x.ParticipantName != nil {
		return *x.ParticipantName
	}
	return ""
}

func (x *TokenSourceRequest) GetParticipantIdentity() string {
	if x != nil && x.ParticipantIdentity != nil {
		return *x.ParticipantIdentity
	}
	return ""
}

func (x *TokenSourceRequest) GetParticipantMetadata() string {
	if x != nil && x.ParticipantMetadata != nil {
		return *x.ParticipantMetadata
	}
	return ""
}

func (x *TokenSourceRequest) GetParticipantAttributes() map[string]string {
	if x != nil {
		return x.ParticipantAttributes
	}
	return nil
}

func (x *TokenSourceRequest) GetRoomConfig() *RoomConfiguration {
	if x != nil {
		return x.RoomConfig
	}
	return nil
}

type TokenSourceResponse struct {
	state            protoimpl.MessageState `protogen:"open.v1"`
	ServerUrl        string                 `protobuf:"bytes,1,opt,name=server_url,json=serverUrl,proto3" json:"server_url,omitempty"`
	ParticipantToken string                 `protobuf:"bytes,2,opt,name=participant_token,json=participantToken,proto3" json:"participant_token,omitempty"`
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

func (x *TokenSourceResponse) Reset() {
	*x = TokenSourceResponse{}
	mi := &file_livekit_token_source_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *TokenSourceResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*TokenSourceResponse) ProtoMessage() {}

func (x *TokenSourceResponse) ProtoReflect() protoreflect.Message {
	mi := &file_livekit_token_source_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use TokenSourceResponse.ProtoReflect.Descriptor instead.
func (*TokenSourceResponse) Descriptor() ([]byte, []int) {
	return file_livekit_token_source_proto_rawDescGZIP(), []int{1}
}

func (x *TokenSourceResponse) GetServerUrl() string {
	if x != nil {
		return x.ServerUrl
	}
	return ""
}

func (x *TokenSourceResponse) GetParticipantToken() string {
	if x != nil {
		return x.ParticipantToken
	}
	return ""
}

var File_livekit_token_source_proto protoreflect.FileDescriptor

const file_livekit_token_source_proto_rawDesc = "" +
	"\n" +
	"\x1alivekit_token_source.proto\x12\alivekit\x1a\x12livekit_room.proto\"\xb6\x04\n" +
	"\x12TokenSourceRequest\x12 \n" +
	"\troom_name\x18\x01 \x01(\tH\x00R\broomName\x88\x01\x01\x12.\n" +
	"\x10participant_name\x18\x02 \x01(\tH\x01R\x0fparticipantName\x88\x01\x01\x126\n" +
	"\x14participant_identity\x18\x03 \x01(\tH\x02R\x13participantIdentity\x88\x01\x01\x126\n" +
	"\x14participant_metadata\x18\x04 \x01(\tH\x03R\x13participantMetadata\x88\x01\x01\x12m\n" +
	"\x16participant_attributes\x18\x05 \x03(\v26.livekit.TokenSourceRequest.ParticipantAttributesEntryR\x15participantAttributes\x12@\n" +
	"\vroom_config\x18\x06 \x01(\v2\x1a.livekit.RoomConfigurationH\x04R\n" +
	"roomConfig\x88\x01\x01\x1aH\n" +
	"\x1aParticipantAttributesEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\f\n" +
	"\n" +
	"_room_nameB\x13\n" +
	"\x11_participant_nameB\x17\n" +
	"\x15_participant_identityB\x17\n" +
	"\x15_participant_metadataB\x0e\n" +
	"\f_room_config\"a\n" +
	"\x13TokenSourceResponse\x12\x1d\n" +
	"\n" +
	"server_url\x18\x01 \x01(\tR\tserverUrl\x12+\n" +
	"\x11participant_token\x18\x02 \x01(\tR\x10participantTokenBFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3"

var (
	file_livekit_token_source_proto_rawDescOnce sync.Once
	file_livekit_token_source_proto_rawDescData []byte
)

func file_livekit_token_source_proto_rawDescGZIP() []byte {
	file_livekit_token_source_proto_rawDescOnce.Do(func() {
		file_livekit_token_source_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_livekit_token_source_proto_rawDesc), len(file_livekit_token_source_proto_rawDesc)))
	})
	return file_livekit_token_source_proto_rawDescData
}

var file_livekit_token_source_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_livekit_token_source_proto_goTypes = []any{
	(*TokenSourceRequest)(nil),  // 0: livekit.TokenSourceRequest
	(*TokenSourceResponse)(nil), // 1: livekit.TokenSourceResponse
	nil,                         // 2: livekit.TokenSourceRequest.ParticipantAttributesEntry
	(*RoomConfiguration)(nil),   // 3: livekit.RoomConfiguration
}
var file_livekit_token_source_proto_depIdxs = []int32{
	2, // 0: livekit.TokenSourceRequest.participant_attributes:type_name -> livekit.TokenSourceRequest.ParticipantAttributesEntry
	3, // 1: livekit.TokenSourceRequest.room_config:type_name -> livekit.RoomConfiguration
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_livekit_token_source_proto_init() }
func file_livekit_token_source_proto_init() {
	if File_livekit_token_source_proto != nil {
		return
	}
	file_livekit_room_proto_init()
	file_livekit_token_source_proto_msgTypes[0].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_livekit_token_source_proto_rawDesc), len(file_livekit_token_source_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_livekit_token_source_proto_goTypes,
		DependencyIndexes: file_livekit_token_source_proto_depIdxs,
		MessageInfos:      file_livekit_token_source_proto_msgTypes,
	}.Build()
	File_livekit_token_source_proto = out.File
	file_livekit_token_source_proto_goTypes = nil
	file_livekit_token_source_proto_depIdxs = nil
}