You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gen_account.go
    path of file: ./repos/go-ethereum/core/types
    
    the code of the file until where you have to start completion: // Code generated by github.com/fjl/gencodec. DO NOT EDIT.

package types

im
    
func (a *Account) UnmarshalJSON(input []byte) error {
	type Account struct {
		Code       *hexutil.Bytes              `json:"code,omitempty"`
		Storage    map[storageJSON]storageJSON `json:"storage,omitempty"`
		Balance    *math.HexOrDecimal256       `json:"balance" gencodec:"required"`
		Nonce      *math.HexOrDecimal64        `json:"nonce,omitempty"`
		PrivateKey *hexutil.Bytes              `json:"secretKey,omitempty"`
	}
	var dec Account
	if err := json.Unmarshal(input, &dec); err != nil {
		return err
	}
	if dec.Code != nil {
		a.Code = *dec.Code
	}
	if dec.Storage != nil {
		a.Storage = make(map[common.Hash]common.Hash, len(dec.Storage))
		for k, v := range dec.Storage {
			a.Storage[common.Hash(k)] = common.Hash(v)
		}
	}
	if dec.Balance == nil {
		return errors.New("missing required field 'balance' for Account")
	}
	a.Balance = (*big.Int)(dec.Balance)
	if dec.Nonce != nil {
		a.Nonce = uint64(*dec.Nonce)
	}
	if dec.PrivateKey != nil {
		a.PrivateKey = *dec.PrivateKey
	}
	return nil
}