status-go/protocol/requests/invite_users_to_community.go

28 lines
632 B
Go
Raw Normal View History

2021-01-11 10:32:51 +00:00
package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrInviteUsersToCommunityInvalidID = errors.New("invite-users-to-community: invalid id")
var ErrInviteUsersToCommunityEmptyUsers = errors.New("invite-users-to-community: empty users")
type InviteUsersToCommunity struct {
2021-05-14 10:55:42 +00:00
CommunityID types.HexBytes `json:"communityId"`
Users []types.HexBytes `json:"users"`
2021-01-11 10:32:51 +00:00
}
func (j *InviteUsersToCommunity) Validate() error {
if len(j.CommunityID) == 0 {
return ErrInviteUsersToCommunityInvalidID
}
if len(j.Users) == 0 {
return ErrInviteUsersToCommunityEmptyUsers
}
return nil
}