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

// WalletGetTransactionsByMsgHashRequest represents TL type `wallet.getTransactionsByMsgHash#a6bb795d`.
//
// See https://core.telegram.org/method/wallet.getTransactionsByMsgHash for reference.
type WalletGetTransactionsByMsgHashRequest struct {
	// MsgHash field of WalletGetTransactionsByMsgHashRequest.
	MsgHash []string
}

// WalletGetTransactionsByMsgHashRequestTypeID is TL type id of WalletGetTransactionsByMsgHashRequest.
const WalletGetTransactionsByMsgHashRequestTypeID = 0xa6bb795d

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

func ( *WalletGetTransactionsByMsgHashRequest) () bool {
	if  == nil {
		return true
	}
	if !(.MsgHash == nil) {
		return false
	}

	return true
}

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

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

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

// TypeName returns name of type in TL schema.
func (*WalletGetTransactionsByMsgHashRequest) () string {
	return "wallet.getTransactionsByMsgHash"
}

// TypeInfo returns info about TL type.
func ( *WalletGetTransactionsByMsgHashRequest) () tdp.Type {
	 := tdp.Type{
		Name: "wallet.getTransactionsByMsgHash",
		ID:   WalletGetTransactionsByMsgHashRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "MsgHash",
			SchemaName: "msg_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WalletGetTransactionsByMsgHashRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode wallet.getTransactionsByMsgHash#a6bb795d as nil")
	}
	.PutID(WalletGetTransactionsByMsgHashRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WalletGetTransactionsByMsgHashRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode wallet.getTransactionsByMsgHash#a6bb795d as nil")
	}
	.PutVectorHeader(len(.MsgHash))
	for ,  := range .MsgHash {
		.PutString()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *WalletGetTransactionsByMsgHashRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode wallet.getTransactionsByMsgHash#a6bb795d to nil")
	}
	if  := .ConsumeID(WalletGetTransactionsByMsgHashRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode wallet.getTransactionsByMsgHash#a6bb795d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *WalletGetTransactionsByMsgHashRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode wallet.getTransactionsByMsgHash#a6bb795d to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode wallet.getTransactionsByMsgHash#a6bb795d: field msg_hash: %w", )
		}

		if  > 0 {
			.MsgHash = make([]string, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .String()
			if  != nil {
				return fmt.Errorf("unable to decode wallet.getTransactionsByMsgHash#a6bb795d: field msg_hash: %w", )
			}
			.MsgHash = append(.MsgHash, )
		}
	}
	return nil
}

// GetMsgHash returns value of MsgHash field.
func ( *WalletGetTransactionsByMsgHashRequest) () ( []string) {
	if  == nil {
		return
	}
	return .MsgHash
}

// WalletGetTransactionsByMsgHash invokes method wallet.getTransactionsByMsgHash#a6bb795d returning error if any.
//
// See https://core.telegram.org/method/wallet.getTransactionsByMsgHash for reference.
func ( *Client) ( context.Context,  []string) (*WalletTransactions, error) {
	var  WalletTransactions

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