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

// ContactsEditCloseFriendsRequest represents TL type `contacts.editCloseFriends#ba6705f0`.
// Edit the close friends list, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/privacy
//
// See https://core.telegram.org/method/contacts.editCloseFriends for reference.
type ContactsEditCloseFriendsRequest struct {
	// Full list of user IDs of close friends, see here¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/privacy
	ID []int64
}

// ContactsEditCloseFriendsRequestTypeID is TL type id of ContactsEditCloseFriendsRequest.
const ContactsEditCloseFriendsRequestTypeID = 0xba6705f0

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *ContactsEditCloseFriendsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.editCloseFriends#ba6705f0 as nil")
	}
	.PutID(ContactsEditCloseFriendsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ContactsEditCloseFriendsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.editCloseFriends#ba6705f0 as nil")
	}
	.PutVectorHeader(len(.ID))
	for ,  := range .ID {
		.PutLong()
	}
	return nil
}

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

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

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

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

// ContactsEditCloseFriends invokes method contacts.editCloseFriends#ba6705f0 returning error if any.
// Edit the close friends list, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/privacy
//
// See https://core.telegram.org/method/contacts.editCloseFriends for reference.
func ( *Client) ( context.Context,  []int64) (bool, error) {
	var  BoolBox

	 := &ContactsEditCloseFriendsRequest{
		ID: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}