2020-11-06 23:19:54 +03:00
|
|
|
package view
|
|
|
|
|
|
|
|
import "github.com/muety/wakapi/models"
|
|
|
|
|
|
|
|
type SettingsViewModel struct {
|
|
|
|
User *models.User
|
|
|
|
LanguageMappings []*models.LanguageMapping
|
2021-01-21 02:26:52 +03:00
|
|
|
Aliases []*SettingsVMCombinedAlias
|
2021-06-12 11:44:19 +03:00
|
|
|
Labels []*SettingsVMCombinedLabel
|
|
|
|
Projects []string
|
2021-12-16 14:39:41 +03:00
|
|
|
ApiKey string
|
2020-11-06 23:19:54 +03:00
|
|
|
Success string
|
|
|
|
Error string
|
|
|
|
}
|
|
|
|
|
2021-01-21 02:26:52 +03:00
|
|
|
type SettingsVMCombinedAlias struct {
|
|
|
|
Key string
|
|
|
|
Type uint8
|
|
|
|
Values []string
|
|
|
|
}
|
|
|
|
|
2021-06-12 11:44:19 +03:00
|
|
|
type SettingsVMCombinedLabel struct {
|
|
|
|
Key string
|
|
|
|
Values []string
|
|
|
|
}
|
|
|
|
|
2020-11-06 23:19:54 +03:00
|
|
|
func (s *SettingsViewModel) WithSuccess(m string) *SettingsViewModel {
|
|
|
|
s.Success = m
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *SettingsViewModel) WithError(m string) *SettingsViewModel {
|
|
|
|
s.Error = m
|
|
|
|
return s
|
|
|
|
}
|