[create-pull-request] automated change (#90)
Co-authored-by: joshuaspence <joshuaspence@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
adcc9a2556
commit
8f0bac78f6
7
unifi/setting_auto_speedtest.generated.go
generated
7
unifi/setting_auto_speedtest.generated.go
generated
@@ -27,15 +27,13 @@ type SettingAutoSpeedtest struct {
|
||||
|
||||
Key string `json:"key"`
|
||||
|
||||
Enabled bool `json:"enabled"`
|
||||
Interval int `json:"interval,omitempty"` // ^(1[2-9]|[2-9][0-9]|[1-9][0-9]{2,3})$
|
||||
CronExpr string `json:"cron_expr,omitempty"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (dst *SettingAutoSpeedtest) UnmarshalJSON(b []byte) error {
|
||||
type Alias SettingAutoSpeedtest
|
||||
aux := &struct {
|
||||
Interval emptyStringInt `json:"interval"`
|
||||
|
||||
*Alias
|
||||
}{
|
||||
Alias: (*Alias)(dst),
|
||||
@@ -45,7 +43,6 @@ func (dst *SettingAutoSpeedtest) UnmarshalJSON(b []byte) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to unmarshal alias: %w", err)
|
||||
}
|
||||
dst.Interval = int(aux.Interval)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user