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

// AccountResetPasswordRequest represents TL type `account.resetPassword#9308ce1b`.
// Initiate a 2FA password reset: can only be used if the user is already logged-in, see
// here for more info »¹
//
// Links:
//  1. https://core.telegram.org/api/srp#password-reset
//
// See https://core.telegram.org/method/account.resetPassword for reference.
type AccountResetPasswordRequest struct {
}

// AccountResetPasswordRequestTypeID is TL type id of AccountResetPasswordRequest.
const AccountResetPasswordRequestTypeID = 0x9308ce1b

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

func ( *AccountResetPasswordRequest) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *AccountResetPasswordRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.resetPassword",
		ID:   AccountResetPasswordRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountResetPasswordRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.resetPassword#9308ce1b as nil")
	}
	.PutID(AccountResetPasswordRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountResetPasswordRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.resetPassword#9308ce1b as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountResetPasswordRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.resetPassword#9308ce1b to nil")
	}
	return nil
}

// AccountResetPassword invokes method account.resetPassword#9308ce1b returning error if any.
// Initiate a 2FA password reset: can only be used if the user is already logged-in, see
// here for more info »¹
//
// Links:
//  1. https://core.telegram.org/api/srp#password-reset
//
// Possible errors:
//
//	400 PASSWORD_EMPTY: The provided password is empty.
//
// See https://core.telegram.org/method/account.resetPassword for reference.
func ( *Client) ( context.Context) (AccountResetPasswordResultClass, error) {
	var  AccountResetPasswordResultBox

	 := &AccountResetPasswordRequest{}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .ResetPasswordResult, nil
}