// 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¹.
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//
// 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#efb2b617`.
// Info about a group call¹.
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//
// 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
	// Whether this is an E2E conference call.
	Conference bool
	// Whether we're created this group call.
	Creator bool
	// MessagesEnabled field of GroupCall.
	MessagesEnabled bool
	// CanChangeMessagesEnabled field of GroupCall.
	CanChangeMessagesEnabled bool
	// Min field of GroupCall.
	Min 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
	// Invitation link for the conference.
	//
	// Use SetInviteLink and GetInviteLink helpers.
	InviteLink string
	// SendPaidMessagesStars field of GroupCall.
	//
	// Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers.
	SendPaidMessagesStars int64
	// DefaultSendAs field of GroupCall.
	//
	// Use SetDefaultSendAs and GetDefaultSendAs helpers.
	DefaultSendAs PeerClass
}

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

// 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 !(.Conference == false) {
		return false
	}
	if !(.Creator == false) {
		return false
	}
	if !(.MessagesEnabled == false) {
		return false
	}
	if !(.CanChangeMessagesEnabled == false) {
		return false
	}
	if !(.Min == 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
	}
	if !(.InviteLink == "") {
		return false
	}
	if !(.SendPaidMessagesStars == 0) {
		return false
	}
	if !(.DefaultSendAs == nil) {
		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)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int64)
	() ( int64)
	() ( int)
	() ( string,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int)
	() ( int)
	() ( string,  bool)
	() ( int64,  bool)
	() ( PeerClass,  bool)
}) {
	.JoinMuted = .()
	.CanChangeJoinMuted = .()
	.JoinDateAsc = .()
	.ScheduleStartSubscribed = .()
	.CanStartVideo = .()
	.RecordVideoActive = .()
	.RtmpStream = .()
	.ListenersHidden = .()
	.Conference = .()
	.Creator = .()
	.MessagesEnabled = .()
	.CanChangeMessagesEnabled = .()
	.Min = .()
	.ID = .()
	.AccessHash = .()
	.ParticipantsCount = .()
	if ,  := .();  {
		.Title = 
	}

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

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

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

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

	.UnmutedVideoLimit = .()
	.Version = .()
	if ,  := .();  {
		.InviteLink = 
	}

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

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

}

// 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:       "Conference",
			SchemaName: "conference",
			Null:       !.Flags.Has(14),
		},
		{
			Name:       "Creator",
			SchemaName: "creator",
			Null:       !.Flags.Has(15),
		},
		{
			Name:       "MessagesEnabled",
			SchemaName: "messages_enabled",
			Null:       !.Flags.Has(17),
		},
		{
			Name:       "CanChangeMessagesEnabled",
			SchemaName: "can_change_messages_enabled",
			Null:       !.Flags.Has(18),
		},
		{
			Name:       "Min",
			SchemaName: "min",
			Null:       !.Flags.Has(19),
		},
		{
			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",
		},
		{
			Name:       "InviteLink",
			SchemaName: "invite_link",
			Null:       !.Flags.Has(16),
		},
		{
			Name:       "SendPaidMessagesStars",
			SchemaName: "send_paid_messages_stars",
			Null:       !.Flags.Has(20),
		},
		{
			Name:       "DefaultSendAs",
			SchemaName: "default_send_as",
			Null:       !.Flags.Has(21),
		},
	}
	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 !(.Conference == false) {
		.Flags.Set(14)
	}
	if !(.Creator == false) {
		.Flags.Set(15)
	}
	if !(.MessagesEnabled == false) {
		.Flags.Set(17)
	}
	if !(.CanChangeMessagesEnabled == false) {
		.Flags.Set(18)
	}
	if !(.Min == false) {
		.Flags.Set(19)
	}
	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)
	}
	if !(.InviteLink == "") {
		.Flags.Set(16)
	}
	if !(.SendPaidMessagesStars == 0) {
		.Flags.Set(20)
	}
	if !(.DefaultSendAs == nil) {
		.Flags.Set(21)
	}
}

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

// EncodeBare implements bin.BareEncoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode groupCall#efb2b617 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode groupCall#efb2b617: 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)
	if .Flags.Has(16) {
		.PutString(.InviteLink)
	}
	if .Flags.Has(20) {
		.PutLong(.SendPaidMessagesStars)
	}
	if .Flags.Has(21) {
		if .DefaultSendAs == nil {
			return fmt.Errorf("unable to encode groupCall#efb2b617: field default_send_as is nil")
		}
		if  := .DefaultSendAs.Encode();  != nil {
			return fmt.Errorf("unable to encode groupCall#efb2b617: field default_send_as: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *GroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode groupCall#efb2b617 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: 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)
	.Conference = .Flags.Has(14)
	.Creator = .Flags.Has(15)
	.MessagesEnabled = .Flags.Has(17)
	.CanChangeMessagesEnabled = .Flags.Has(18)
	.Min = .Flags.Has(19)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field participants_count: %w", )
		}
		.ParticipantsCount = 
	}
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field title: %w", )
		}
		.Title = 
	}
	if .Flags.Has(4) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field stream_dc_id: %w", )
		}
		.StreamDCID = 
	}
	if .Flags.Has(5) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field record_start_date: %w", )
		}
		.RecordStartDate = 
	}
	if .Flags.Has(7) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field schedule_date: %w", )
		}
		.ScheduleDate = 
	}
	if .Flags.Has(10) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field unmuted_video_count: %w", )
		}
		.UnmutedVideoCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field unmuted_video_limit: %w", )
		}
		.UnmutedVideoLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field version: %w", )
		}
		.Version = 
	}
	if .Flags.Has(16) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field invite_link: %w", )
		}
		.InviteLink = 
	}
	if .Flags.Has(20) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field send_paid_messages_stars: %w", )
		}
		.SendPaidMessagesStars = 
	}
	if .Flags.Has(21) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode groupCall#efb2b617: field default_send_as: %w", )
		}
		.DefaultSendAs = 
	}
	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)
}

// SetConference sets value of Conference conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(14)
		.Conference = true
	} else {
		.Flags.Unset(14)
		.Conference = false
	}
}

// GetConference returns value of Conference conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(14)
}

// SetCreator sets value of Creator conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(15)
		.Creator = true
	} else {
		.Flags.Unset(15)
		.Creator = false
	}
}

// GetCreator returns value of Creator conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(15)
}

// SetMessagesEnabled sets value of MessagesEnabled conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(17)
		.MessagesEnabled = true
	} else {
		.Flags.Unset(17)
		.MessagesEnabled = false
	}
}

// GetMessagesEnabled returns value of MessagesEnabled conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(17)
}

// SetCanChangeMessagesEnabled sets value of CanChangeMessagesEnabled conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(18)
		.CanChangeMessagesEnabled = true
	} else {
		.Flags.Unset(18)
		.CanChangeMessagesEnabled = false
	}
}

// GetCanChangeMessagesEnabled returns value of CanChangeMessagesEnabled conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(18)
}

// SetMin sets value of Min conditional field.
func ( *GroupCall) ( bool) {
	if  {
		.Flags.Set(19)
		.Min = true
	} else {
		.Flags.Unset(19)
		.Min = false
	}
}

// GetMin returns value of Min conditional field.
func ( *GroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(19)
}

// 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
}

// SetInviteLink sets value of InviteLink conditional field.
func ( *GroupCall) ( string) {
	.Flags.Set(16)
	.InviteLink = 
}

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

// SetSendPaidMessagesStars sets value of SendPaidMessagesStars conditional field.
func ( *GroupCall) ( int64) {
	.Flags.Set(20)
	.SendPaidMessagesStars = 
}

// GetSendPaidMessagesStars returns value of SendPaidMessagesStars conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(20) {
		return , false
	}
	return .SendPaidMessagesStars, true
}

// SetDefaultSendAs sets value of DefaultSendAs conditional field.
func ( *GroupCall) ( PeerClass) {
	.Flags.Set(21)
	.DefaultSendAs = 
}

// GetDefaultSendAs returns value of DefaultSendAs conditional field and
// boolean which is true if field was set.
func ( *GroupCall) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(21) {
		return , false
	}
	return .DefaultSendAs, true
}

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

// GroupCallClass represents GroupCall generic type.
//
// See https://core.telegram.org/type/GroupCall for reference.
//
// Constructors:
//   - [GroupCallDiscarded]
//   - [GroupCall]
//
// Example:
//
//	g, err := tg.DecodeGroupCall(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.GroupCallDiscarded: // groupCallDiscarded#7780bcb4
//	case *tg.GroupCall: // groupCall#efb2b617
//	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#efb2b617.
		 := 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()
}