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

// ContactsDeleteContactsRequest represents TL type `contacts.deleteContacts#96a0e00`.
// Deletes several contacts from the list.
//
// See https://core.telegram.org/method/contacts.deleteContacts for reference.
type ContactsDeleteContactsRequest struct {
	// User ID list
	ID []InputUserClass
}

// ContactsDeleteContactsRequestTypeID is TL type id of ContactsDeleteContactsRequest.
const ContactsDeleteContactsRequestTypeID = 0x96a0e00

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

func ( *ContactsDeleteContactsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.ID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ContactsDeleteContactsRequest from given interface.
func ( *ContactsDeleteContactsRequest) ( interface {
	() ( []InputUserClass)
}) {
	.ID = .()
}

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

// TypeName returns name of type in TL schema.
func (*ContactsDeleteContactsRequest) () string {
	return "contacts.deleteContacts"
}

// TypeInfo returns info about TL type.
func ( *ContactsDeleteContactsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "contacts.deleteContacts",
		ID:   ContactsDeleteContactsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ContactsDeleteContactsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.deleteContacts#96a0e00 as nil")
	}
	.PutID(ContactsDeleteContactsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ContactsDeleteContactsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.deleteContacts#96a0e00 as nil")
	}
	.PutVectorHeader(len(.ID))
	for ,  := range .ID {
		if  == nil {
			return fmt.Errorf("unable to encode contacts.deleteContacts#96a0e00: field id element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode contacts.deleteContacts#96a0e00: field id element with index %d: %w", , )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *ContactsDeleteContactsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode contacts.deleteContacts#96a0e00 to nil")
	}
	if  := .ConsumeID(ContactsDeleteContactsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode contacts.deleteContacts#96a0e00: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *ContactsDeleteContactsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode contacts.deleteContacts#96a0e00 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode contacts.deleteContacts#96a0e00: field id: %w", )
		}

		if  > 0 {
			.ID = make([]InputUserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeInputUser()
			if  != nil {
				return fmt.Errorf("unable to decode contacts.deleteContacts#96a0e00: field id: %w", )
			}
			.ID = append(.ID, )
		}
	}
	return nil
}

// GetID returns value of ID field.
func ( *ContactsDeleteContactsRequest) () ( []InputUserClass) {
	if  == nil {
		return
	}
	return .ID
}

// MapID returns field ID wrapped in InputUserClassArray helper.
func ( *ContactsDeleteContactsRequest) () ( InputUserClassArray) {
	return InputUserClassArray(.ID)
}

// ContactsDeleteContacts invokes method contacts.deleteContacts#96a0e00 returning error if any.
// Deletes several contacts from the list.
//
// See https://core.telegram.org/method/contacts.deleteContacts for reference.
func ( *Client) ( context.Context,  []InputUserClass) (UpdatesClass, error) {
	var  UpdatesBox

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