// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// GroupCallDiscarded represents TL type `groupCallDiscarded#7780bcb4`.
// An ended group call
//
// See https://core.telegram.org/constructor/groupCallDiscarded for reference.
type GroupCallDiscarded struct {
	// Group call ID
	ID int64
	// Group call access hash
	AccessHash int64
	// Group call duration
	Duration int
}

// GroupCallDiscardedTypeID is TL type id of GroupCallDiscarded.
const GroupCallDiscardedTypeID = 0x7780bcb4

// construct implements constructor of GroupCallClass.
func ( GroupCallDiscarded) () GroupCallClass { return & }

// Ensuring interfaces in compile-time for GroupCallDiscarded.
var (
	_ bin.Encoder     = &GroupCallDiscarded{}
	_ bin.Decoder     = &GroupCallDiscarded{}
	_ bin.BareEncoder = &GroupCallDiscarded{}
	_ bin.BareDecoder = &GroupCallDiscarded{}

	_ GroupCallClass = &GroupCallDiscarded{}
)

func ( *GroupCallDiscarded) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}
	if !(.Duration == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *GroupCallDiscarded) () string {
	if  == nil {
		return "GroupCallDiscarded(nil)"
	}
	type  GroupCallDiscarded
	return fmt.Sprintf("GroupCallDiscarded%+v", (*))
}

// FillFrom fills GroupCallDiscarded from given interface.
func ( *GroupCallDiscarded) ( interface {
	() ( int64)
	() ( int64)
	() ( int)
}) {
	.ID = .()
	.AccessHash = .()
	.Duration = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*GroupCallDiscarded) () uint32 {
	return GroupCallDiscardedTypeID
}

// TypeName returns name of type in TL schema.
func (*GroupCallDiscarded) () string {
	return "groupCallDiscarded"
}

// TypeInfo returns info about TL type.
func ( *GroupCallDiscarded) () tdp.Type {
	 := tdp.Type{
		Name: "groupCallDiscarded",
		ID:   GroupCallDiscardedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
		{
			Name:       "Duration",
			SchemaName: "duration",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *GroupCallDiscarded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode groupCallDiscarded#7780bcb4 as nil")
	}
	.PutID(GroupCallDiscardedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *GroupCallDiscarded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode groupCallDiscarded#7780bcb4 as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	.PutInt(.Duration)
	return nil
}

// Decode implements bin.Decoder.
func ( *GroupCallDiscarded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode groupCallDiscarded#7780bcb4 to nil")
	}
	if  := .ConsumeID(GroupCallDiscardedTypeID);  != nil {
		return fmt.Errorf("unable to decode groupCallDiscarded#7780bcb4: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *GroupCallDiscarded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode groupCallDiscarded#7780bcb4 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCallDiscarded#7780bcb4: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCallDiscarded#7780bcb4: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCallDiscarded#7780bcb4: field duration: %w", )
		}
		.Duration = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *GroupCallDiscarded) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *GroupCallDiscarded) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// GetDuration returns value of Duration field.
func ( *GroupCallDiscarded) () ( int) {
	if  == nil {
		return
	}
	return .Duration
}

// GroupCall represents TL type `groupCall#d597650c`.
// Info about a group call or livestream
//
// See https://core.telegram.org/constructor/groupCall for reference.
type GroupCall struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the user should be muted upon joining the call
	JoinMuted bool
	// Whether the current user can change the value of the join_muted flag using phone
	// toggleGroupCallSettings¹
	//
	// Links:
	//  1) https://core.telegram.org/method/phone.toggleGroupCallSettings
	CanChangeJoinMuted bool
	// Specifies the ordering to use when locally sorting by date and displaying in the UI
	// group call participants.
	JoinDateAsc bool
	// Whether we subscribed to the scheduled call
	ScheduleStartSubscribed bool
	// Whether you can start streaming video into the call
	CanStartVideo bool
	// Whether the group call is currently being recorded
	RecordVideoActive bool
	// Whether RTMP streams are allowed
	RtmpStream bool
	// Whether the listeners list is hidden and cannot be fetched using phone
	// getGroupParticipants¹. The phone.groupParticipants.count and groupCall
	// participants_count counters will still include listeners.
	//
	// Links:
	//  1) https://core.telegram.org/method/phone.getGroupParticipants
	ListenersHidden bool
	// Group call ID
	ID int64
	// Group call access hash
	AccessHash int64
	// Participant count
	ParticipantsCount int
	// Group call title
	//
	// Use SetTitle and GetTitle helpers.
	Title string
	// DC ID to be used for livestream chunks
	//
	// Use SetStreamDCID and GetStreamDCID helpers.
	StreamDCID int
	// When was the recording started
	//
	// Use SetRecordStartDate and GetRecordStartDate helpers.
	RecordStartDate int
	// When is the call scheduled to start
	//
	// Use SetScheduleDate and GetScheduleDate helpers.
	ScheduleDate int
	// Number of people currently streaming video into the call
	//
	// Use SetUnmutedVideoCount and GetUnmutedVideoCount helpers.
	UnmutedVideoCount int
	// Maximum number of people allowed to stream video into the call
	UnmutedVideoLimit int
	// Version
	Version int
}

// GroupCallTypeID is TL type id of GroupCall.
const GroupCallTypeID = 0xd597650c

// construct implements constructor of GroupCallClass.
func ( GroupCall) () GroupCallClass { return & }

// Ensuring interfaces in compile-time for GroupCall.
var (
	_ bin.Encoder     = &GroupCall{}
	_ bin.Decoder     = &GroupCall{}
	_ bin.BareEncoder = &GroupCall{}
	_ bin.BareDecoder = &GroupCall{}

	_ GroupCallClass = &GroupCall{}
)

func ( *GroupCall) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.JoinMuted == false) {
		return false
	}
	if !(.CanChangeJoinMuted == false) {
		return false
	}
	if !(.JoinDateAsc == false) {
		return false
	}
	if !(.ScheduleStartSubscribed == false) {
		return false
	}
	if !(.CanStartVideo == false) {
		return false
	}
	if !(.RecordVideoActive == false) {
		return false
	}
	if !(.RtmpStream == false) {
		return false
	}
	if !(.ListenersHidden == false) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}
	if !(.ParticipantsCount == 0) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.StreamDCID == 0) {
		return false
	}
	if !(.RecordStartDate == 0) {
		return false
	}
	if !(.ScheduleDate == 0) {
		return false
	}
	if !(.UnmutedVideoCount == 0) {
		return false
	}
	if !(.UnmutedVideoLimit == 0) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *GroupCall) () string {
	if  == nil {
		return "GroupCall(nil)"
	}
	type  GroupCall
	return fmt.Sprintf("GroupCall%+v", (*))
}

// FillFrom fills GroupCall from given interface.
func ( *GroupCall) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int64)
	() ( int64)
	() ( int)
	() ( string,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int)
	() ( int)
}) {
	.JoinMuted = .()
	.CanChangeJoinMuted = .()
	.JoinDateAsc = .()
	.ScheduleStartSubscribed = .()
	.CanStartVideo = .()
	.RecordVideoActive = .()
	.RtmpStream = .()
	.ListenersHidden = .()
	.ID = .()
	.AccessHash = .()
	.ParticipantsCount = .()
	if ,  := .();  {
		.Title = 
	}

	if ,  := .();  {
		.StreamDCID = 
	}

	if ,  := .();  {
		.RecordStartDate = 
	}

	if ,  := .();  {
		.ScheduleDate = 
	}

	if ,  := .();  {
		.UnmutedVideoCount = 
	}

	.UnmutedVideoLimit = .()
	.Version = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*GroupCall) () uint32 {
	return GroupCallTypeID
}

// TypeName returns name of type in TL schema.
func (*GroupCall) () string {
	return "groupCall"
}

// TypeInfo returns info about TL type.
func ( *GroupCall) () tdp.Type {
	 := tdp.Type{
		Name: "groupCall",
		ID:   GroupCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "JoinMuted",
			SchemaName: "join_muted",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "CanChangeJoinMuted",
			SchemaName: "can_change_join_muted",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "JoinDateAsc",
			SchemaName: "join_date_asc",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "ScheduleStartSubscribed",
			SchemaName: "schedule_start_subscribed",
			Null:       !.Flags.Has(8),
		},
		{
			Name:       "CanStartVideo",
			SchemaName: "can_start_video",
			Null:       !.Flags.Has(9),
		},
		{
			Name:       "RecordVideoActive",
			SchemaName: "record_video_active",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "RtmpStream",
			SchemaName: "rtmp_stream",
			Null:       !.Flags.Has(12),
		},
		{
			Name:       "ListenersHidden",
			SchemaName: "listeners_hidden",
			Null:       !.Flags.Has(13),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
		{
			Name:       "ParticipantsCount",
			SchemaName: "participants_count",
		},
		{
			Name:       "Title",
			SchemaName: "title",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "StreamDCID",
			SchemaName: "stream_dc_id",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "RecordStartDate",
			SchemaName: "record_start_date",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "ScheduleDate",
			SchemaName: "schedule_date",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "UnmutedVideoCount",
			SchemaName: "unmuted_video_count",
			Null:       !.Flags.Has(10),
		},
		{
			Name:       "UnmutedVideoLimit",
			SchemaName: "unmuted_video_limit",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *GroupCall) () {
	if !(.JoinMuted == false) {
		.Flags.Set(1)
	}
	if !(.CanChangeJoinMuted == false) {
		.Flags.Set(2)
	}
	if !(.JoinDateAsc == false) {
		.Flags.Set(6)
	}
	if !(.ScheduleStartSubscribed == false) {
		.Flags.Set(8)
	}
	if !(.CanStartVideo == false) {
		.Flags.Set(9)
	}
	if !(.RecordVideoActive == false) {
		.Flags.Set(11)
	}
	if !(.RtmpStream == false) {
		.Flags.Set(12)
	}
	if !(.ListenersHidden == false) {
		.Flags.Set(13)
	}
	if !(.Title == "") {
		.Flags.Set(3)
	}
	if !(.StreamDCID == 0) {
		.Flags.Set(4)
	}
	if !(.RecordStartDate == 0) {
		.Flags.Set(5)
	}
	if !(.ScheduleDate == 0) {
		.Flags.Set(7)
	}
	if !(.UnmutedVideoCount == 0) {
		.Flags.Set(10)
	}
}

// Encode implements bin.Encoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode groupCall#d597650c as nil")
	}
	.PutID(GroupCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode groupCall#d597650c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode groupCall#d597650c: field flags: %w", )
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	.PutInt(.ParticipantsCount)
	if .Flags.Has(3) {
		.PutString(.Title)
	}
	if .Flags.Has(4) {
		.PutInt(.StreamDCID)
	}
	if .Flags.Has(5) {
		.PutInt(.RecordStartDate)
	}
	if .Flags.Has(7) {
		.PutInt(.ScheduleDate)
	}
	if .Flags.Has(10) {
		.PutInt(.UnmutedVideoCount)
	}
	.PutInt(.UnmutedVideoLimit)
	.PutInt(.Version)
	return nil
}

// Decode implements bin.Decoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode groupCall#d597650c to nil")
	}
	if  := .ConsumeID(GroupCallTypeID);  != nil {
		return fmt.Errorf("unable to decode groupCall#d597650c: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode groupCall#d597650c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field flags: %w", )
		}
	}
	.JoinMuted = .Flags.Has(1)
	.CanChangeJoinMuted = .Flags.Has(2)
	.JoinDateAsc = .Flags.Has(6)
	.ScheduleStartSubscribed = .Flags.Has(8)
	.CanStartVideo = .Flags.Has(9)
	.RecordVideoActive = .Flags.Has(11)
	.RtmpStream = .Flags.Has(12)
	.ListenersHidden = .Flags.Has(13)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field participants_count: %w", )
		}
		.ParticipantsCount = 
	}
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field title: %w", )
		}
		.Title = 
	}
	if .Flags.Has(4) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field stream_dc_id: %w", )
		}
		.StreamDCID = 
	}
	if .Flags.Has(5) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field record_start_date: %w", )
		}
		.RecordStartDate = 
	}
	if .Flags.Has(7) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field schedule_date: %w", )
		}
		.ScheduleDate = 
	}
	if .Flags.Has(10) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field unmuted_video_count: %w", )
		}
		.UnmutedVideoCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field unmuted_video_limit: %w", )
		}
		.UnmutedVideoLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#d597650c: field version: %w", )
		}
		.Version = 
	}
	return nil
}

// SetJoinMuted sets value of JoinMuted conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(1)
		.JoinMuted = true
	} else {
		.Flags.Unset(1)
		.JoinMuted = false
	}
}

// GetJoinMuted returns value of JoinMuted conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetCanChangeJoinMuted sets value of CanChangeJoinMuted conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(2)
		.CanChangeJoinMuted = true
	} else {
		.Flags.Unset(2)
		.CanChangeJoinMuted = false
	}
}

// GetCanChangeJoinMuted returns value of CanChangeJoinMuted conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetJoinDateAsc sets value of JoinDateAsc conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(6)
		.JoinDateAsc = true
	} else {
		.Flags.Unset(6)
		.JoinDateAsc = false
	}
}

// GetJoinDateAsc returns value of JoinDateAsc conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(6)
}

// SetScheduleStartSubscribed sets value of ScheduleStartSubscribed conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(8)
		.ScheduleStartSubscribed = true
	} else {
		.Flags.Unset(8)
		.ScheduleStartSubscribed = false
	}
}

// GetScheduleStartSubscribed returns value of ScheduleStartSubscribed conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(8)
}

// SetCanStartVideo sets value of CanStartVideo conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(9)
		.CanStartVideo = true
	} else {
		.Flags.Unset(9)
		.CanStartVideo = false
	}
}

// GetCanStartVideo returns value of CanStartVideo conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(9)
}

// SetRecordVideoActive sets value of RecordVideoActive conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(11)
		.RecordVideoActive = true
	} else {
		.Flags.Unset(11)
		.RecordVideoActive = false
	}
}

// GetRecordVideoActive returns value of RecordVideoActive conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(11)
}

// SetRtmpStream sets value of RtmpStream conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(12)
		.RtmpStream = true
	} else {
		.Flags.Unset(12)
		.RtmpStream = false
	}
}

// GetRtmpStream returns value of RtmpStream conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(12)
}

// SetListenersHidden sets value of ListenersHidden conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(13)
		.ListenersHidden = true
	} else {
		.Flags.Unset(13)
		.ListenersHidden = false
	}
}

// GetListenersHidden returns value of ListenersHidden conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(13)
}

// GetID returns value of ID field.
func ( *GroupCall) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *GroupCall) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// GetParticipantsCount returns value of ParticipantsCount field.
func ( *GroupCall) () ( int) {
	if  == nil {
		return
	}
	return .ParticipantsCount
}

// SetTitle sets value of Title conditional field.
func ( *GroupCall) ( string) {
	.Flags.Set(3)
	.Title = 
}

// GetTitle returns value of Title conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .Title, true
}

// SetStreamDCID sets value of StreamDCID conditional field.
func ( *GroupCall) ( int) {
	.Flags.Set(4)
	.StreamDCID = 
}

// GetStreamDCID returns value of StreamDCID conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .StreamDCID, true
}

// SetRecordStartDate sets value of RecordStartDate conditional field.
func ( *GroupCall) ( int) {
	.Flags.Set(5)
	.RecordStartDate = 
}

// GetRecordStartDate returns value of RecordStartDate conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(5) {
		return , false
	}
	return .RecordStartDate, true
}

// SetScheduleDate sets value of ScheduleDate conditional field.
func ( *GroupCall) ( int) {
	.Flags.Set(7)
	.ScheduleDate = 
}

// GetScheduleDate returns value of ScheduleDate conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .ScheduleDate, true
}

// SetUnmutedVideoCount sets value of UnmutedVideoCount conditional field.
func ( *GroupCall) ( int) {
	.Flags.Set(10)
	.UnmutedVideoCount = 
}

// GetUnmutedVideoCount returns value of UnmutedVideoCount conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(10) {
		return , false
	}
	return .UnmutedVideoCount, true
}

// GetUnmutedVideoLimit returns value of UnmutedVideoLimit field.
func ( *GroupCall) () ( int) {
	if  == nil {
		return
	}
	return .UnmutedVideoLimit
}

// GetVersion returns value of Version field.
func ( *GroupCall) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// GroupCallClassName is schema name of GroupCallClass.
const GroupCallClassName = "GroupCall"

// GroupCallClass represents GroupCall generic type.
//
// See https://core.telegram.org/type/GroupCall for reference.
//
// Example:
//
//	g, err := tg.DecodeGroupCall(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.GroupCallDiscarded: // groupCallDiscarded#7780bcb4
//	case *tg.GroupCall: // groupCall#d597650c
//	default: panic(v)
//	}
type GroupCallClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() GroupCallClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool

	// Group call ID
	GetID() (value int64)

	// Group call access hash
	GetAccessHash() (value int64)
}

// AsInput tries to map GroupCall to InputGroupCall.
func ( *GroupCall) () *InputGroupCall {
	 := new(InputGroupCall)
	.ID = .GetID()
	.AccessHash = .GetAccessHash()

	return 
}

// DecodeGroupCall implements binary de-serialization for GroupCallClass.
func ( *bin.Buffer) (GroupCallClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case GroupCallDiscardedTypeID:
		// Decoding groupCallDiscarded#7780bcb4.
		 := GroupCallDiscarded{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode GroupCallClass: %w", )
		}
		return &, nil
	case GroupCallTypeID:
		// Decoding groupCall#d597650c.
		 := GroupCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode GroupCallClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode GroupCallClass: %w", bin.NewUnexpectedID())
	}
}

// GroupCall boxes the GroupCallClass providing a helper.
type GroupCallBox struct {
	GroupCall GroupCallClass
}

// Decode implements bin.Decoder for GroupCallBox.
func ( *GroupCallBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode GroupCallBox to nil")
	}
	,  := DecodeGroupCall()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.GroupCall = 
	return nil
}

// Encode implements bin.Encode for GroupCallBox.
func ( *GroupCallBox) ( *bin.Buffer) error {
	if  == nil || .GroupCall == nil {
		return fmt.Errorf("unable to encode GroupCallClass as nil")
	}
	return .GroupCall.Encode()
}