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

// AccountDeleteSecureValueRequest represents TL type `account.deleteSecureValue#b880bc4b`.
// Delete stored Telegram Passport¹ documents, for more info see the passport docs »²
//
// Links:
//  1. https://core.telegram.org/passport
//  2. https://core.telegram.org/passport/encryption#encryption
//
// See https://core.telegram.org/method/account.deleteSecureValue for reference.
type AccountDeleteSecureValueRequest struct {
	// Document types to delete
	Types []SecureValueTypeClass
}

// AccountDeleteSecureValueRequestTypeID is TL type id of AccountDeleteSecureValueRequest.
const AccountDeleteSecureValueRequestTypeID = 0xb880bc4b

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

func ( *AccountDeleteSecureValueRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Types == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountDeleteSecureValueRequest from given interface.
func ( *AccountDeleteSecureValueRequest) ( interface {
	() ( []SecureValueTypeClass)
}) {
	.Types = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountDeleteSecureValueRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.deleteSecureValue",
		ID:   AccountDeleteSecureValueRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Types",
			SchemaName: "types",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountDeleteSecureValueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.deleteSecureValue#b880bc4b as nil")
	}
	.PutID(AccountDeleteSecureValueRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountDeleteSecureValueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.deleteSecureValue#b880bc4b as nil")
	}
	.PutVectorHeader(len(.Types))
	for ,  := range .Types {
		if  == nil {
			return fmt.Errorf("unable to encode account.deleteSecureValue#b880bc4b: field types element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode account.deleteSecureValue#b880bc4b: field types element with index %d: %w", , )
		}
	}
	return nil
}

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

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

		if  > 0 {
			.Types = make([]SecureValueTypeClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeSecureValueType()
			if  != nil {
				return fmt.Errorf("unable to decode account.deleteSecureValue#b880bc4b: field types: %w", )
			}
			.Types = append(.Types, )
		}
	}
	return nil
}

// GetTypes returns value of Types field.
func ( *AccountDeleteSecureValueRequest) () ( []SecureValueTypeClass) {
	if  == nil {
		return
	}
	return .Types
}

// MapTypes returns field Types wrapped in SecureValueTypeClassArray helper.
func ( *AccountDeleteSecureValueRequest) () ( SecureValueTypeClassArray) {
	return SecureValueTypeClassArray(.Types)
}

// AccountDeleteSecureValue invokes method account.deleteSecureValue#b880bc4b returning error if any.
// Delete stored Telegram Passport¹ documents, for more info see the passport docs »²
//
// Links:
//  1. https://core.telegram.org/passport
//  2. https://core.telegram.org/passport/encryption#encryption
//
// See https://core.telegram.org/method/account.deleteSecureValue for reference.
func ( *Client) ( context.Context,  []SecureValueTypeClass) (bool, error) {
	var  BoolBox

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