Omit empty NetworkID in account resource (#59)

* Omit empty NetworkID in account

* Run `go generate`

* Fix tests

Co-authored-by: Joshua Spence <josh@joshuaspence.com>
This commit is contained in:
Oskar
2022-01-31 05:58:42 +01:00
committed by GitHub
parent 5351452eca
commit 3e7bd072ea
8 changed files with 104 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ type Account struct {
IP string `json:"ip,omitempty"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
Name string `json:"name,omitempty"` // ^[^"' ]+$
NetworkID string `json:"networkconf_id"`
NetworkID string `json:"networkconf_id,omitempty"`
TunnelConfigType string `json:"tunnel_config_type,omitempty"` // vpn|802.1x|custom
TunnelMediumType int `json:"tunnel_medium_type,omitempty"` // [1-9]|1[0-5]|^$
TunnelType int `json:"tunnel_type,omitempty"` // [1-9]|1[0-3]|^$