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

// PhoneDeleteConferenceCallParticipantsRequest represents TL type `phone.deleteConferenceCallParticipants#8ca60525`.
// Remove participants from a conference call¹.
// Exactly one of the only_left and kick flags must be set.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#conference-calls
//
// See https://core.telegram.org/method/phone.deleteConferenceCallParticipants for reference.
type PhoneDeleteConferenceCallParticipantsRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether this is a removal of members that already left the conference call.
	OnlyLeft bool
	// Whether this is a forced removal of active members in a conference call.
	Kick bool
	// The conference call.
	Call InputGroupCallClass
	// IDs of users to remove.
	IDs []int64
	// The block containing an appropriate e2e.chain.changeSetGroupState event¹
	//
	// Links:
	//  1) https://core.telegram.org/api/end-to-end/group-calls
	Block []byte
}

// PhoneDeleteConferenceCallParticipantsRequestTypeID is TL type id of PhoneDeleteConferenceCallParticipantsRequest.
const PhoneDeleteConferenceCallParticipantsRequestTypeID = 0x8ca60525

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

func ( *PhoneDeleteConferenceCallParticipantsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.OnlyLeft == false) {
		return false
	}
	if !(.Kick == false) {
		return false
	}
	if !(.Call == nil) {
		return false
	}
	if !(.IDs == nil) {
		return false
	}
	if !(.Block == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PhoneDeleteConferenceCallParticipantsRequest from given interface.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( interface {
	() ( bool)
	() ( bool)
	() ( InputGroupCallClass)
	() ( []int64)
	() ( []byte)
}) {
	.OnlyLeft = .()
	.Kick = .()
	.Call = .()
	.IDs = .()
	.Block = .()
}

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

// TypeName returns name of type in TL schema.
func (*PhoneDeleteConferenceCallParticipantsRequest) () string {
	return "phone.deleteConferenceCallParticipants"
}

// TypeInfo returns info about TL type.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "phone.deleteConferenceCallParticipants",
		ID:   PhoneDeleteConferenceCallParticipantsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "OnlyLeft",
			SchemaName: "only_left",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Kick",
			SchemaName: "kick",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "IDs",
			SchemaName: "ids",
		},
		{
			Name:       "Block",
			SchemaName: "block",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () {
	if !(.OnlyLeft == false) {
		.Flags.Set(0)
	}
	if !(.Kick == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.deleteConferenceCallParticipants#8ca60525 as nil")
	}
	.PutID(PhoneDeleteConferenceCallParticipantsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.deleteConferenceCallParticipants#8ca60525 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field flags: %w", )
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field call: %w", )
	}
	.PutVectorHeader(len(.IDs))
	for ,  := range .IDs {
		.PutLong()
	}
	.PutBytes(.Block)
	return nil
}

// Decode implements bin.Decoder.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.deleteConferenceCallParticipants#8ca60525 to nil")
	}
	if  := .ConsumeID(PhoneDeleteConferenceCallParticipantsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.deleteConferenceCallParticipants#8ca60525 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field flags: %w", )
		}
	}
	.OnlyLeft = .Flags.Has(0)
	.Kick = .Flags.Has(1)
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field ids: %w", )
		}

		if  > 0 {
			.IDs = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field ids: %w", )
			}
			.IDs = append(.IDs, )
		}
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field block: %w", )
		}
		.Block = 
	}
	return nil
}

// SetOnlyLeft sets value of OnlyLeft conditional field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( bool) {
	if  {
		.Flags.Set(0)
		.OnlyLeft = true
	} else {
		.Flags.Unset(0)
		.OnlyLeft = false
	}
}

// GetOnlyLeft returns value of OnlyLeft conditional field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetKick sets value of Kick conditional field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) ( bool) {
	if  {
		.Flags.Set(1)
		.Kick = true
	} else {
		.Flags.Unset(1)
		.Kick = false
	}
}

// GetKick returns value of Kick conditional field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetCall returns value of Call field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetIDs returns value of IDs field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () ( []int64) {
	if  == nil {
		return
	}
	return .IDs
}

// GetBlock returns value of Block field.
func ( *PhoneDeleteConferenceCallParticipantsRequest) () ( []byte) {
	if  == nil {
		return
	}
	return .Block
}

// PhoneDeleteConferenceCallParticipants invokes method phone.deleteConferenceCallParticipants#8ca60525 returning error if any.
// Remove participants from a conference call¹.
// Exactly one of the only_left and kick flags must be set.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#conference-calls
//
// Possible errors:
//
//	400 GROUPCALL_INVALID: The specified group call is invalid.
//
// See https://core.telegram.org/method/phone.deleteConferenceCallParticipants for reference.
func ( *Client) ( context.Context,  *PhoneDeleteConferenceCallParticipantsRequest) (UpdatesClass, error) {
	var  UpdatesBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Updates, nil
}