status-go/protocol/requests/upsert_switcher_card.go

21 lines
441 B
Go
Raw Permalink Normal View History

2023-01-05 16:11:57 +00:00
package requests
import "errors"
var ErrUpsertSwitcherCardInvalidCardID = errors.New("upsert-switcher-card: invalid card id")
type UpsertSwitcherCard struct {
CardID string `json:"cardId,omitempty"`
Type int `json:"type"`
Clock uint64 `json:"clock"`
ScreenID string `json:"screenId"`
}
func (a *UpsertSwitcherCard) Validate() error {
if len(a.CardID) == 0 {
return ErrUpsertSwitcherCardInvalidCardID
}
return nil
}