func (d Data) Validate() error {
	if len(strings.TrimSpace(d.Application)) == 0 {
		return fmt.Errorf("application name cannot be empty or blank")
	}
	if len(strings.TrimSpace(d.Username)) == 0 {
		return fmt.Errorf("application username cannot be empty or blank")
	}
	return nil
}
Validate returns an error if the instance does not contain valid data
package types
import (
	"encoding/hex"
	"fmt"
	"strings"
	"time"
	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
)
func NewApplicationLink(
	user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time,
) ApplicationLink {
	return ApplicationLink{
		User:          user,
		Data:          data,
		State:         state,
		OracleRequest: oracleRequest,
		Result:        result,
		CreationTime:  creationTime,
	}
}
func (l ApplicationLink) Validate() error {
	_, err := sdk.AccAddressFromBech32(l.User)
	if err != nil {
		return fmt.Errorf("invalid user address: %s", err)
	}
	err = l.Data.Validate()
	if err != nil {
		return err
	}
	err = l.OracleRequest.Validate()
	if err != nil {
		return err
	}
	if l.Result != nil {
		err = l.Result.Validate()
		if err != nil {
			return err
		}
	}
	if l.CreationTime.IsZero() {
		return fmt.Errorf("invalid creation time: %s", l.CreationTime)
	}
	return nil
}
func (l *ApplicationLink) IsVerificationOngoing() bool {
	return l.State == ApplicationLinkStateInitialized || l.State == AppLinkStateVerificationStarted
}
func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte {
	return cdc.MustMarshal(&link)
}
func MustUnmarshalApplicationLink(cdc codec.BinaryCodec, bz []byte) ApplicationLink {
	var link ApplicationLink
	cdc.MustUnmarshal(bz, &link)
	return link
}
func NewData(application, username string) Data {
	return Data{
		Application: application,
		Username:    username,
	}
}