@@ -49,12 +49,13 @@ func (c *RoomConfiguration) UnmarshalJSON(data []byte) error {
4949}
5050
5151type ClaimGrants struct {
52- Identity string `json:"-"`
53- Name string `json:"name,omitempty"`
54- Kind string `json:"kind,omitempty"`
55- Video * VideoGrant `json:"video,omitempty"`
56- SIP * SIPGrant `json:"sip,omitempty"`
57- Agent * AgentGrant `json:"agent,omitempty"`
52+ Identity string `json:"-"`
53+ Name string `json:"name,omitempty"`
54+ Kind string `json:"kind,omitempty"`
55+ KindDetail string `json:"kindDetail,omitempty"`
56+ Video * VideoGrant `json:"video,omitempty"`
57+ SIP * SIPGrant `json:"sip,omitempty"`
58+ Agent * AgentGrant `json:"agent,omitempty"`
5859 // Room configuration to use if this participant initiates the room
5960 RoomConfig * RoomConfiguration `json:"roomConfig,omitempty"`
6061 // Cloud-only, config preset to use
@@ -71,10 +72,18 @@ func (c *ClaimGrants) SetParticipantKind(kind livekit.ParticipantInfo_Kind) {
7172 c .Kind = kindFromProto (kind )
7273}
7374
75+ func (c * ClaimGrants ) SetParticipantKindDetail (kindDetail livekit.ParticipantInfo_KindDetail ) {
76+ c .KindDetail = kindDetailFromProto (kindDetail )
77+ }
78+
7479func (c * ClaimGrants ) GetParticipantKind () livekit.ParticipantInfo_Kind {
7580 return kindToProto (c .Kind )
7681}
7782
83+ func (c * ClaimGrants ) GetParticipantKindDetail () livekit.ParticipantInfo_KindDetail {
84+ return kindDetailToProto (c .KindDetail )
85+ }
86+
7887func (c * ClaimGrants ) GetRoomConfiguration () * livekit.RoomConfiguration {
7988 if c .RoomConfig == nil {
8089 return nil
@@ -464,6 +473,10 @@ func kindFromProto(source livekit.ParticipantInfo_Kind) string {
464473 return strings .ToLower (source .String ())
465474}
466475
476+ func kindDetailFromProto (source livekit.ParticipantInfo_KindDetail ) string {
477+ return strings .ToLower (source .String ())
478+ }
479+
467480func kindToProto (sourceStr string ) livekit.ParticipantInfo_Kind {
468481 switch strings .ToLower (sourceStr ) {
469482 case "" , "standard" :
@@ -480,3 +493,14 @@ func kindToProto(sourceStr string) livekit.ParticipantInfo_Kind {
480493 return livekit .ParticipantInfo_STANDARD
481494 }
482495}
496+
497+ func kindDetailToProto (sourceStr string ) livekit.ParticipantInfo_KindDetail {
498+ switch strings .ToLower (sourceStr ) {
499+ case "cloud_agent" :
500+ return livekit .ParticipantInfo_CLOUD_AGENT
501+ case "forwarded" :
502+ return livekit .ParticipantInfo_FORWARDED
503+ default :
504+ return livekit .ParticipantInfo_CLOUD_AGENT
505+ }
506+ }
0 commit comments