mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 14:16:21 +00:00
28 lines
555 B
Go
28 lines
555 B
Go
|
package requests
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
ErrImportDiscordCommunityMissingFilesToImport = errors.New("import-discord-community: missing files to import")
|
||
|
)
|
||
|
|
||
|
type ImportDiscordCommunity struct {
|
||
|
CreateCommunity
|
||
|
FilesToImport []string
|
||
|
From int64
|
||
|
}
|
||
|
|
||
|
func (u *ImportDiscordCommunity) Validate() error {
|
||
|
if len(u.FilesToImport) == 0 {
|
||
|
return ErrImportDiscordCommunityMissingFilesToImport
|
||
|
}
|
||
|
|
||
|
return u.CreateCommunity.Validate()
|
||
|
}
|
||
|
|
||
|
func (u *ImportDiscordCommunity) ToCreateCommunityRequest() *CreateCommunity {
|
||
|
return &u.CreateCommunity
|
||
|
}
|