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

@@ -14,11 +14,11 @@ func TestAccountMarshalJSON(t *testing.T) {
acc unifi.Account
}{
"empty strings": {
`{"vlan":"","tunnel_type":"","tunnel_medium_type":"","networkconf_id":""}`,
`{"vlan":"","tunnel_type":"","tunnel_medium_type":""}`,
unifi.Account{},
},
"response": {
`{"vlan":10,"tunnel_type":1,"tunnel_medium_type":1,"networkconf_id":""}`,
`{"vlan":10,"tunnel_type":1,"tunnel_medium_type":1}`,
unifi.Account{
VLAN: 10,
TunnelType: 1,