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

// AuthDropTempAuthKeysRequest represents TL type `auth.dropTempAuthKeys#8e48a188`.
// Delete all temporary authorization keys except for the ones specified
//
// See https://core.telegram.org/method/auth.dropTempAuthKeys for reference.
type AuthDropTempAuthKeysRequest struct {
	// The auth keys that shouldn't be dropped.
	ExceptAuthKeys []int64
}

// AuthDropTempAuthKeysRequestTypeID is TL type id of AuthDropTempAuthKeysRequest.
const AuthDropTempAuthKeysRequestTypeID = 0x8e48a188

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

func ( *AuthDropTempAuthKeysRequest) () bool {
	if  == nil {
		return true
	}
	if !(.ExceptAuthKeys == nil) {
		return false
	}

	return true
}

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

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

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

// TypeName returns name of type in TL schema.
func (*AuthDropTempAuthKeysRequest) () string {
	return "auth.dropTempAuthKeys"
}

// TypeInfo returns info about TL type.
func ( *AuthDropTempAuthKeysRequest) () tdp.Type {
	 := tdp.Type{
		Name: "auth.dropTempAuthKeys",
		ID:   AuthDropTempAuthKeysRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ExceptAuthKeys",
			SchemaName: "except_auth_keys",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AuthDropTempAuthKeysRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.dropTempAuthKeys#8e48a188 as nil")
	}
	.PutID(AuthDropTempAuthKeysRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthDropTempAuthKeysRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.dropTempAuthKeys#8e48a188 as nil")
	}
	.PutVectorHeader(len(.ExceptAuthKeys))
	for ,  := range .ExceptAuthKeys {
		.PutLong()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AuthDropTempAuthKeysRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.dropTempAuthKeys#8e48a188 to nil")
	}
	if  := .ConsumeID(AuthDropTempAuthKeysRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode auth.dropTempAuthKeys#8e48a188: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AuthDropTempAuthKeysRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.dropTempAuthKeys#8e48a188 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode auth.dropTempAuthKeys#8e48a188: field except_auth_keys: %w", )
		}

		if  > 0 {
			.ExceptAuthKeys = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode auth.dropTempAuthKeys#8e48a188: field except_auth_keys: %w", )
			}
			.ExceptAuthKeys = append(.ExceptAuthKeys, )
		}
	}
	return nil
}

// GetExceptAuthKeys returns value of ExceptAuthKeys field.
func ( *AuthDropTempAuthKeysRequest) () ( []int64) {
	if  == nil {
		return
	}
	return .ExceptAuthKeys
}

// AuthDropTempAuthKeys invokes method auth.dropTempAuthKeys#8e48a188 returning error if any.
// Delete all temporary authorization keys except for the ones specified
//
// See https://core.telegram.org/method/auth.dropTempAuthKeys for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  []int64) (bool, error) {
	var  BoolBox

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