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

// AccountInvalidateSignInCodesRequest represents TL type `account.invalidateSignInCodes#ca8ae8ba`.
// Invalidate the specified login codes, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/auth#invalidating-login-codes
//
// See https://core.telegram.org/method/account.invalidateSignInCodes for reference.
type AccountInvalidateSignInCodesRequest struct {
	// The login codes to invalidate.
	Codes []string
}

// AccountInvalidateSignInCodesRequestTypeID is TL type id of AccountInvalidateSignInCodesRequest.
const AccountInvalidateSignInCodesRequestTypeID = 0xca8ae8ba

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

func ( *AccountInvalidateSignInCodesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Codes == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountInvalidateSignInCodesRequest from given interface.
func ( *AccountInvalidateSignInCodesRequest) ( interface {
	() ( []string)
}) {
	.Codes = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountInvalidateSignInCodesRequest) () string {
	return "account.invalidateSignInCodes"
}

// TypeInfo returns info about TL type.
func ( *AccountInvalidateSignInCodesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.invalidateSignInCodes",
		ID:   AccountInvalidateSignInCodesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Codes",
			SchemaName: "codes",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountInvalidateSignInCodesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.invalidateSignInCodes#ca8ae8ba as nil")
	}
	.PutID(AccountInvalidateSignInCodesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountInvalidateSignInCodesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.invalidateSignInCodes#ca8ae8ba as nil")
	}
	.PutVectorHeader(len(.Codes))
	for ,  := range .Codes {
		.PutString()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountInvalidateSignInCodesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.invalidateSignInCodes#ca8ae8ba to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode account.invalidateSignInCodes#ca8ae8ba: field codes: %w", )
		}

		if  > 0 {
			.Codes = make([]string, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .String()
			if  != nil {
				return fmt.Errorf("unable to decode account.invalidateSignInCodes#ca8ae8ba: field codes: %w", )
			}
			.Codes = append(.Codes, )
		}
	}
	return nil
}

// GetCodes returns value of Codes field.
func ( *AccountInvalidateSignInCodesRequest) () ( []string) {
	if  == nil {
		return
	}
	return .Codes
}

// AccountInvalidateSignInCodes invokes method account.invalidateSignInCodes#ca8ae8ba returning error if any.
// Invalidate the specified login codes, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/auth#invalidating-login-codes
//
// See https://core.telegram.org/method/account.invalidateSignInCodes for reference.
func ( *Client) ( context.Context,  []string) (bool, error) {
	var  BoolBox

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