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

// AuthRequestPasswordRecoveryRequest represents TL type `auth.requestPasswordRecovery#d897bc66`.
// Request recovery code of a 2FA password¹, only for accounts with a recovery email
// configured².
//
// Links:
//  1. https://core.telegram.org/api/srp
//  2. https://core.telegram.org/api/srp#email-verification
//
// See https://core.telegram.org/method/auth.requestPasswordRecovery for reference.
type AuthRequestPasswordRecoveryRequest struct {
}

// AuthRequestPasswordRecoveryRequestTypeID is TL type id of AuthRequestPasswordRecoveryRequest.
const AuthRequestPasswordRecoveryRequestTypeID = 0xd897bc66

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

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

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *AuthRequestPasswordRecoveryRequest) () tdp.Type {
	 := tdp.Type{
		Name: "auth.requestPasswordRecovery",
		ID:   AuthRequestPasswordRecoveryRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *AuthRequestPasswordRecoveryRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.requestPasswordRecovery#d897bc66 as nil")
	}
	.PutID(AuthRequestPasswordRecoveryRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthRequestPasswordRecoveryRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.requestPasswordRecovery#d897bc66 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AuthRequestPasswordRecoveryRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.requestPasswordRecovery#d897bc66 to nil")
	}
	return nil
}

// AuthRequestPasswordRecovery invokes method auth.requestPasswordRecovery#d897bc66 returning error if any.
// Request recovery code of a 2FA password¹, only for accounts with a recovery email
// configured².
//
// Links:
//  1. https://core.telegram.org/api/srp
//  2. https://core.telegram.org/api/srp#email-verification
//
// Possible errors:
//
//	400 PASSWORD_EMPTY: The provided password is empty.
//	400 PASSWORD_RECOVERY_NA: No email was set, can't recover password via email.
//
// See https://core.telegram.org/method/auth.requestPasswordRecovery for reference.
func ( *Client) ( context.Context) (*AuthPasswordRecovery, error) {
	var  AuthPasswordRecovery

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