Omit empty fields

This commit is contained in:
Kalle Carlbark 2022-02-14 15:35:08 +01:00
parent b3138a42e5
commit 63c2a86871
No known key found for this signature in database

View file

@ -14,23 +14,23 @@ type VirtualizationInterfacesService service
// NewVirtualizationInterface is used for creating a new virtualization interface
type NewVirtualizationInterface struct {
CustomFields interface{} `json:"custom_fields"`
CustomFields *interface{} `json:"custom_fields,omitempty"`
Name string `json:"name"`
Mode string `json:"mode"`
Description string `json:"description"`
MACAddress string `json:"mac_address"`
Tags []struct {
Mode string `json:"mode,omitempty"`
Description string `json:"description,omitempty"`
MACAddress string `json:"mac_address,omitempty"`
Tags *[]struct {
Name string `json:"name"`
Slug string `json:"slug"`
Color string `json:"color"`
} `json:"tags"`
TaggedVLANs []int `json:"tagged_vlans"`
Bridge int `json:"bridge"`
Parent int `json:"parent"`
UntaggedVLAN int `json:"untagged_vlan"`
MTU int `json:"mtu"`
} `json:"tags,omitempty"`
TaggedVLANs *[]int `json:"tagged_vlans,omitempty"`
Bridge int `json:"bridge,omitempty"`
Parent int `json:"parent,omitempty"`
UntaggedVLAN int `json:"untagged_vlan,omitempty"`
MTU int `json:"mtu,omitempty"`
VirtualMachine int `json:"virtual_machine"`
Enabled bool `json:"enabled"`
Enabled bool `json:"enabled,omitempty"`
}
// VirtualizationInterfaces is a list of interfaces