Use --latest
This commit is contained in:
124
unifi/device.generated.go
generated
124
unifi/device.generated.go
generated
@@ -27,60 +27,72 @@ type Device struct {
|
|||||||
|
|
||||||
MAC string `json:"mac,omitempty"`
|
MAC string `json:"mac,omitempty"`
|
||||||
|
|
||||||
AtfEnabled bool `json:"atf_enabled,omitempty"`
|
AtfEnabled bool `json:"atf_enabled,omitempty"`
|
||||||
BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g
|
BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g
|
||||||
BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
||||||
BaresipEnabled bool `json:"baresip_enabled,omitempty"`
|
BaresipEnabled bool `json:"baresip_enabled,omitempty"`
|
||||||
BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]*
|
||||||
ConfigNetwork DeviceConfigNetwork `json:"config_network,omitempty"`
|
ConfigNetwork DeviceConfigNetwork `json:"config_network,omitempty"`
|
||||||
DPIEnabled bool `json:"dpi_enabled,omitempty"`
|
DPIEnabled bool `json:"dpi_enabled,omitempty"`
|
||||||
Disabled bool `json:"disabled,omitempty"`
|
Disabled bool `json:"disabled,omitempty"`
|
||||||
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+|
|
Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+|
|
||||||
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"`
|
Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"`
|
||||||
EthernetOverrides []DeviceEthernetOverrides `json:"ethernet_overrides,omitempty"`
|
EthernetOverrides []DeviceEthernetOverrides `json:"ethernet_overrides,omitempty"`
|
||||||
FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"`
|
FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"`
|
||||||
HeightInMeters float64 `json:"heightInMeters,omitempty"`
|
HeightInMeters float64 `json:"heightInMeters,omitempty"`
|
||||||
JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"`
|
Hostname string `json:"hostname,omitempty"` // .{1,128}
|
||||||
LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100
|
JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"`
|
||||||
LcmBrightnessOverride bool `json:"lcm_brightness_override,omitempty"`
|
LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100
|
||||||
LcmIDleTimeout int `json:"lcm_idle_timeout,omitempty"` // [1-9][0-9]|[1-9][0-9][0-9]|[1-2][0-9][0-9][0-9]|3[0-5][0-9][0-9]|3600
|
LcmBrightnessOverride bool `json:"lcm_brightness_override,omitempty"`
|
||||||
LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"`
|
LcmIDleTimeout int `json:"lcm_idle_timeout,omitempty"` // [1-9][0-9]|[1-9][0-9][0-9]|[1-2][0-9][0-9][0-9]|3[0-5][0-9][0-9]|3600
|
||||||
LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"`
|
LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"`
|
||||||
LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50}
|
LcmNightModeBegins string `json:"lcm_night_mode_begins,omitempty"` // (^$)|(^(0[1-9])|(1[0-9])|(2[0-3])):([0-5][0-9]$)
|
||||||
LedOverride string `json:"led_override,omitempty"` // default|on|off
|
LcmNightModeEnds string `json:"lcm_night_mode_ends,omitempty"` // (^$)|(^(0[1-9])|(1[0-9])|(2[0-3])):([0-5][0-9]$)
|
||||||
LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$
|
LcmSettingsRestrictedAccess bool `json:"lcm_settings_restricted_access,omitempty"`
|
||||||
LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$
|
LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"`
|
||||||
Locked bool `json:"locked,omitempty"`
|
LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50}
|
||||||
LteApn string `json:"lte_apn,omitempty"` // .{1,128}
|
LedOverride string `json:"led_override,omitempty"` // default|on|off
|
||||||
LteExtAnt bool `json:"lte_ext_ant,omitempty"`
|
LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$
|
||||||
LtePoe bool `json:"lte_poe,omitempty"`
|
LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$
|
||||||
LteSimPin int `json:"lte_sim_pin,omitempty"`
|
Locked bool `json:"locked,omitempty"`
|
||||||
LteSoftLimit int `json:"lte_soft_limit,omitempty"`
|
LteApn string `json:"lte_apn,omitempty"` // .{1,128}
|
||||||
MapID string `json:"map_id,omitempty"`
|
LteAuthType string `json:"lte_auth_type,omitempty"` // PAP|CHAP|PAP-CHAP|NONE
|
||||||
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"`
|
LteDataLimitEnabled bool `json:"lte_data_limit_enabled,omitempty"`
|
||||||
MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+
|
LteDataWarningEnabled bool `json:"lte_data_warning_enabled,omitempty"`
|
||||||
Name string `json:"name,omitempty"` // .{1,128}
|
LteExtAnt bool `json:"lte_ext_ant,omitempty"`
|
||||||
OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off
|
LteHardLimit int `json:"lte_hard_limit,omitempty"`
|
||||||
OutletEnabled bool `json:"outlet_enabled,omitempty"`
|
LtePassword string `json:"lte_password,omitempty"`
|
||||||
OutletOverrides []DeviceOutletOverrides `json:"outlet_overrides,omitempty"`
|
LtePoe bool `json:"lte_poe,omitempty"`
|
||||||
PortOverrides []DevicePortOverrides `json:"port_overrides,omitempty"`
|
LteRoamingAllowed bool `json:"lte_roaming_allowed,omitempty"`
|
||||||
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
|
LteSimPin int `json:"lte_sim_pin,omitempty"`
|
||||||
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"`
|
LteSoftLimit int `json:"lte_soft_limit,omitempty"`
|
||||||
RADIUSProfileID string `json:"radiusprofile_id,omitempty"`
|
LteUsername string `json:"lte_username,omitempty"`
|
||||||
RadioTable []DeviceRadioTable `json:"radio_table,omitempty"`
|
MapID string `json:"map_id,omitempty"`
|
||||||
ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off
|
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"`
|
||||||
RpsOverride DeviceRpsOverride `json:"rps_override,omitempty"`
|
MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+
|
||||||
SnmpContact string `json:"snmp_contact,omitempty"` // .{0,255}
|
Name string `json:"name,omitempty"` // .{0,128}
|
||||||
SnmpLocation string `json:"snmp_location,omitempty"` // .{0,255}
|
OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off
|
||||||
StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
|
OutletEnabled bool `json:"outlet_enabled,omitempty"`
|
||||||
StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled
|
OutletOverrides []DeviceOutletOverrides `json:"outlet_overrides,omitempty"`
|
||||||
SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"`
|
OutletPowerCycleEnabled bool `json:"outlet_power_cycle_enabled,omitempty"`
|
||||||
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
|
PortOverrides []DevicePortOverrides `json:"port_overrides,omitempty"`
|
||||||
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
|
PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps
|
||||||
WLANOverrides []DeviceWLANOverrides `json:"wlan_overrides,omitempty"`
|
PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"`
|
||||||
X float64 `json:"x,omitempty"`
|
RADIUSProfileID string `json:"radiusprofile_id,omitempty"`
|
||||||
XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
|
RadioTable []DeviceRadioTable `json:"radio_table,omitempty"`
|
||||||
Y float64 `json:"y,omitempty"`
|
ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off
|
||||||
|
RpsOverride DeviceRpsOverride `json:"rps_override,omitempty"`
|
||||||
|
SnmpContact string `json:"snmp_contact,omitempty"` // .{0,255}
|
||||||
|
SnmpLocation string `json:"snmp_location,omitempty"` // .{0,255}
|
||||||
|
StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
|
||||||
|
StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled
|
||||||
|
SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"`
|
||||||
|
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
|
||||||
|
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
|
||||||
|
WLANOverrides []DeviceWLANOverrides `json:"wlan_overrides,omitempty"`
|
||||||
|
X float64 `json:"x,omitempty"`
|
||||||
|
XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]*
|
||||||
|
Y float64 `json:"y,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *Device) UnmarshalJSON(b []byte) error {
|
func (dst *Device) UnmarshalJSON(b []byte) error {
|
||||||
@@ -89,6 +101,7 @@ func (dst *Device) UnmarshalJSON(b []byte) error {
|
|||||||
LcmBrightness emptyStringInt `json:"lcm_brightness"`
|
LcmBrightness emptyStringInt `json:"lcm_brightness"`
|
||||||
LcmIDleTimeout emptyStringInt `json:"lcm_idle_timeout"`
|
LcmIDleTimeout emptyStringInt `json:"lcm_idle_timeout"`
|
||||||
LedOverrideColorBrightness emptyStringInt `json:"led_override_color_brightness"`
|
LedOverrideColorBrightness emptyStringInt `json:"led_override_color_brightness"`
|
||||||
|
LteHardLimit emptyStringInt `json:"lte_hard_limit"`
|
||||||
LteSimPin emptyStringInt `json:"lte_sim_pin"`
|
LteSimPin emptyStringInt `json:"lte_sim_pin"`
|
||||||
LteSoftLimit emptyStringInt `json:"lte_soft_limit"`
|
LteSoftLimit emptyStringInt `json:"lte_soft_limit"`
|
||||||
Volume emptyStringInt `json:"volume"`
|
Volume emptyStringInt `json:"volume"`
|
||||||
@@ -105,6 +118,7 @@ func (dst *Device) UnmarshalJSON(b []byte) error {
|
|||||||
dst.LcmBrightness = int(aux.LcmBrightness)
|
dst.LcmBrightness = int(aux.LcmBrightness)
|
||||||
dst.LcmIDleTimeout = int(aux.LcmIDleTimeout)
|
dst.LcmIDleTimeout = int(aux.LcmIDleTimeout)
|
||||||
dst.LedOverrideColorBrightness = int(aux.LedOverrideColorBrightness)
|
dst.LedOverrideColorBrightness = int(aux.LedOverrideColorBrightness)
|
||||||
|
dst.LteHardLimit = int(aux.LteHardLimit)
|
||||||
dst.LteSimPin = int(aux.LteSimPin)
|
dst.LteSimPin = int(aux.LteSimPin)
|
||||||
dst.LteSoftLimit = int(aux.LteSoftLimit)
|
dst.LteSoftLimit = int(aux.LteSoftLimit)
|
||||||
dst.Volume = int(aux.Volume)
|
dst.Volume = int(aux.Volume)
|
||||||
@@ -381,7 +395,7 @@ type DeviceWLANOverrides struct {
|
|||||||
VLAN int `json:"vlan,omitempty"` // [2-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-8][0-9]|409[0-5]|^$
|
VLAN int `json:"vlan,omitempty"` // [2-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-8][0-9]|409[0-5]|^$
|
||||||
VLANEnabled bool `json:"vlan_enabled,omitempty"`
|
VLANEnabled bool `json:"vlan_enabled,omitempty"`
|
||||||
WLANID string `json:"wlan_id,omitempty"` // [\d\w]+
|
WLANID string `json:"wlan_id,omitempty"` // [\d\w]+
|
||||||
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64}
|
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,255}|[0-9a-fA-F]{64}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *DeviceWLANOverrides) UnmarshalJSON(b []byte) error {
|
func (dst *DeviceWLANOverrides) UnmarshalJSON(b []byte) error {
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ package unifi
|
|||||||
|
|
||||||
// This will generate the *.generated.go files in this package for the specified
|
// This will generate the *.generated.go files in this package for the specified
|
||||||
// Unifi controller version.
|
// Unifi controller version.
|
||||||
//go:generate go run ../fields/ -version-base-dir=../fields/ 6.0.43
|
//go:generate go run ../fields/ -version-base-dir=../fields/ -latest
|
||||||
//go:generate gofmt -w -s ./
|
//go:generate gofmt -w -s ./
|
||||||
|
|||||||
36
unifi/network.generated.go
generated
36
unifi/network.generated.go
generated
@@ -106,8 +106,11 @@ type Network struct {
|
|||||||
IPV6RaValidLifetime int `json:"ipv6_ra_valid_lifetime,omitempty"` // ^([0-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-8][0-9]{4}|9[0-8][0-9]{3}|99[0-8][0-9]{2}|999[0-8][0-9]|9999[0-9]|[1-8][0-9]{5}|9[0-8][0-9]{4}|99[0-8][0-9]{3}|999[0-8][0-9]{2}|9999[0-8][0-9]|99999[0-9]|[1-8][0-9]{6}|9[0-8][0-9]{5}|99[0-8][0-9]{4}|999[0-8][0-9]{3}|9999[0-8][0-9]{2}|99999[0-8][0-9]|999999[0-9]|[12][0-9]{7}|30[0-9]{6}|31[0-4][0-9]{5}|315[0-2][0-9]{4}|3153[0-5][0-9]{3}|31536000)$|^$
|
IPV6RaValidLifetime int `json:"ipv6_ra_valid_lifetime,omitempty"` // ^([0-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-8][0-9]{4}|9[0-8][0-9]{3}|99[0-8][0-9]{2}|999[0-8][0-9]|9999[0-9]|[1-8][0-9]{5}|9[0-8][0-9]{4}|99[0-8][0-9]{3}|999[0-8][0-9]{2}|9999[0-8][0-9]|99999[0-9]|[1-8][0-9]{6}|9[0-8][0-9]{5}|99[0-8][0-9]{4}|999[0-8][0-9]{3}|9999[0-8][0-9]{2}|99999[0-8][0-9]|999999[0-9]|[12][0-9]{7}|30[0-9]{6}|31[0-4][0-9]{5}|315[0-2][0-9]{4}|3153[0-5][0-9]{3}|31536000)$|^$
|
||||||
IPV6Subnet string `json:"ipv6_subnet,omitempty"`
|
IPV6Subnet string `json:"ipv6_subnet,omitempty"`
|
||||||
IsNAT bool `json:"is_nat"`
|
IsNAT bool `json:"is_nat"`
|
||||||
L2TpInterface string `json:"l2tp_interface,omitempty"` // wan|wan2
|
L2TpInterface string `json:"l2tp_interface,omitempty"` // wan|wan2
|
||||||
|
L2TpLocalWANIP string `json:"l2tp_local_wan_ip,omitempty"` // ^any$|^(([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])$
|
||||||
LteLanEnabled bool `json:"lte_lan_enabled"`
|
LteLanEnabled bool `json:"lte_lan_enabled"`
|
||||||
|
MACOverride string `json:"mac_override"` // (^$|^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$)
|
||||||
|
MACOverrideEnabled bool `json:"mac_override_enabled"`
|
||||||
NATOutboundIPAddresses []NetworkNATOutboundIPAddresses `json:"nat_outbound_ip_addresses,omitempty"`
|
NATOutboundIPAddresses []NetworkNATOutboundIPAddresses `json:"nat_outbound_ip_addresses,omitempty"`
|
||||||
Name string `json:"name,omitempty"` // .{1,128}
|
Name string `json:"name,omitempty"` // .{1,128}
|
||||||
NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?
|
NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?
|
||||||
@@ -147,14 +150,15 @@ type Network struct {
|
|||||||
WANGateway string `json:"wan_gateway"` // ^(([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])$|^$
|
WANGateway string `json:"wan_gateway"` // ^(([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])$|^$
|
||||||
WANGatewayV6 string `json:"wan_gateway_v6"` // ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
WANGatewayV6 string `json:"wan_gateway_v6"` // ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||||
WANIP string `json:"wan_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])$
|
WANIP string `json:"wan_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])$
|
||||||
WANIPAliases []string `json:"wan_ip_aliases,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])\/([1-9]|[1-2][0-9]|30)$|^$
|
WANIPAliases []string `json:"wan_ip_aliases,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])\/([8-9]|[1-2][0-9]|3[0-2])$|^$
|
||||||
WANIPV6 string `json:"wan_ipv6"` // ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
WANIPV6 string `json:"wan_ipv6"` // ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$|^$
|
||||||
WANLoadBalanceType string `json:"wan_load_balance_type,omitempty"` // failover-only|weighted
|
WANLoadBalanceType string `json:"wan_load_balance_type,omitempty"` // failover-only|weighted
|
||||||
WANLoadBalanceWeight int `json:"wan_load_balance_weight,omitempty"` // [1-9]|[1-9][0-9]
|
WANLoadBalanceWeight int `json:"wan_load_balance_weight,omitempty"` // [1-9]|[1-9][0-9]
|
||||||
WANNetmask string `json:"wan_netmask,omitempty"` // ^((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0)|255\.(0|128|192|224|240|248|252|254)))))$
|
WANNetmask string `json:"wan_netmask,omitempty"` // ^((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0)|255\.(0|128|192|224|240|248|252|254)))))$
|
||||||
WANNetworkGroup string `json:"wan_networkgroup,omitempty"` // WAN[2]?|WAN_LTE_FAILOVER
|
WANNetworkGroup string `json:"wan_networkgroup,omitempty"` // WAN[2]?|WAN_LTE_FAILOVER
|
||||||
WANPrefixlen int `json:"wan_prefixlen,omitempty"` // ^([1-9]|[1-8][0-9]|9[0-9]|1[01][0-9]|12[0-8])$|^$
|
WANPrefixlen int `json:"wan_prefixlen,omitempty"` // ^([1-9]|[1-8][0-9]|9[0-9]|1[01][0-9]|12[0-8])$|^$
|
||||||
WANSmartqDownRate int `json:"wan_smartq_down_rate,omitempty"` // [0-9]{1,6}|1000000
|
WANProviderCapabilities NetworkWANProviderCapabilities `json:"wan_provider_capabilities,omitempty"`
|
||||||
|
WANSmartqDownRate int `json:"wan_smartq_down_rate,omitempty"` // [0-9]{1,6}|1000000
|
||||||
WANSmartqEnabled bool `json:"wan_smartq_enabled"`
|
WANSmartqEnabled bool `json:"wan_smartq_enabled"`
|
||||||
WANSmartqUpRate int `json:"wan_smartq_up_rate,omitempty"` // [0-9]{1,6}|1000000
|
WANSmartqUpRate int `json:"wan_smartq_up_rate,omitempty"` // [0-9]{1,6}|1000000
|
||||||
WANType string `json:"wan_type,omitempty"` // disabled|dhcp|static|pppoe
|
WANType string `json:"wan_type,omitempty"` // disabled|dhcp|static|pppoe
|
||||||
@@ -278,6 +282,32 @@ func (dst *NetworkWANDHCPOptions) UnmarshalJSON(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NetworkWANProviderCapabilities struct {
|
||||||
|
DownloadKilobitsPerSecond int `json:"download_kilobits_per_second,omitempty"` // ^[1-9][0-9]*$
|
||||||
|
UploadKilobitsPerSecond int `json:"upload_kilobits_per_second,omitempty"` // ^[1-9][0-9]*$
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dst *NetworkWANProviderCapabilities) UnmarshalJSON(b []byte) error {
|
||||||
|
type Alias NetworkWANProviderCapabilities
|
||||||
|
aux := &struct {
|
||||||
|
DownloadKilobitsPerSecond emptyStringInt `json:"download_kilobits_per_second"`
|
||||||
|
UploadKilobitsPerSecond emptyStringInt `json:"upload_kilobits_per_second"`
|
||||||
|
|
||||||
|
*Alias
|
||||||
|
}{
|
||||||
|
Alias: (*Alias)(dst),
|
||||||
|
}
|
||||||
|
|
||||||
|
err := json.Unmarshal(b, &aux)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to unmarshal alias: %w", err)
|
||||||
|
}
|
||||||
|
dst.DownloadKilobitsPerSecond = int(aux.DownloadKilobitsPerSecond)
|
||||||
|
dst.UploadKilobitsPerSecond = int(aux.UploadKilobitsPerSecond)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Client) listNetwork(ctx context.Context, site string) ([]Network, error) {
|
func (c *Client) listNetwork(ctx context.Context, site string) ([]Network, error) {
|
||||||
var respBody struct {
|
var respBody struct {
|
||||||
Meta meta `json:"meta"`
|
Meta meta `json:"meta"`
|
||||||
|
|||||||
2
unifi/routing.generated.go
generated
2
unifi/routing.generated.go
generated
@@ -26,6 +26,8 @@ type Routing struct {
|
|||||||
NoEdit bool `json:"attr_no_edit,omitempty"`
|
NoEdit bool `json:"attr_no_edit,omitempty"`
|
||||||
|
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
GatewayDevice string `json:"gateway_device,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$
|
||||||
|
GatewayType string `json:"gateway_type,omitempty"` // default|switch
|
||||||
Name string `json:"name,omitempty"` // .{1,128}
|
Name string `json:"name,omitempty"` // .{1,128}
|
||||||
StaticRouteDistance int `json:"static-route_distance,omitempty"` // ^[1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]$|^$
|
StaticRouteDistance int `json:"static-route_distance,omitempty"` // ^[1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]$|^$
|
||||||
StaticRouteInterface string `json:"static-route_interface"` // WAN1|WAN2|[\d\w]+|^$
|
StaticRouteInterface string `json:"static-route_interface"` // WAN1|WAN2|[\d\w]+|^$
|
||||||
|
|||||||
5
unifi/setting_super_mgmt.generated.go
generated
5
unifi/setting_super_mgmt.generated.go
generated
@@ -67,8 +67,11 @@ type SettingSuperMgmt struct {
|
|||||||
LiveUpdates string `json:"live_updates,omitempty"` // disabled|live|auto
|
LiveUpdates string `json:"live_updates,omitempty"` // disabled|live|auto
|
||||||
MinimumUsableHdSpace int `json:"minimum_usable_hd_space,omitempty"`
|
MinimumUsableHdSpace int `json:"minimum_usable_hd_space,omitempty"`
|
||||||
MinimumUsableSdSpace int `json:"minimum_usable_sd_space,omitempty"`
|
MinimumUsableSdSpace int `json:"minimum_usable_sd_space,omitempty"`
|
||||||
|
MultipleSitesEnabled bool `json:"multiple_sites_enabled"`
|
||||||
OverrideInformHost bool `json:"override_inform_host"`
|
OverrideInformHost bool `json:"override_inform_host"`
|
||||||
StoreEnabled string `json:"store_enabled,omitempty"` // disabled|super-only|everyone
|
OverrideInformHostLocation string `json:"override_inform_host_location,omitempty"`
|
||||||
|
OverrideInformHostType string `json:"override_inform_host_type,omitempty"` // unifi-os|custom
|
||||||
|
StoreEnabled string `json:"store_enabled,omitempty"` // disabled|super-only|everyone
|
||||||
TimeSeriesPerClientStatsEnabled bool `json:"time_series_per_client_stats_enabled"`
|
TimeSeriesPerClientStatsEnabled bool `json:"time_series_per_client_stats_enabled"`
|
||||||
XSshPassword string `json:"x_ssh_password,omitempty"`
|
XSshPassword string `json:"x_ssh_password,omitempty"`
|
||||||
XSshUsername string `json:"x_ssh_username,omitempty"`
|
XSshUsername string `json:"x_ssh_username,omitempty"`
|
||||||
|
|||||||
2
unifi/version.generated.go
generated
2
unifi/version.generated.go
generated
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
package unifi
|
package unifi
|
||||||
|
|
||||||
const UnifiVersion = "6.0.43"
|
const UnifiVersion = "6.2.26"
|
||||||
|
|||||||
85
unifi/wlan.generated.go
generated
85
unifi/wlan.generated.go
generated
@@ -47,6 +47,7 @@ type WLAN struct {
|
|||||||
IappEnabled bool `json:"iapp_enabled"`
|
IappEnabled bool `json:"iapp_enabled"`
|
||||||
IsGuest bool `json:"is_guest"`
|
IsGuest bool `json:"is_guest"`
|
||||||
L2Isolation bool `json:"l2_isolation"`
|
L2Isolation bool `json:"l2_isolation"`
|
||||||
|
LogLevel string `json:"log_level,omitempty"`
|
||||||
MACFilterEnabled bool `json:"mac_filter_enabled"`
|
MACFilterEnabled bool `json:"mac_filter_enabled"`
|
||||||
MACFilterList []string `json:"mac_filter_list,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
|
MACFilterList []string `json:"mac_filter_list,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
|
||||||
MACFilterPolicy string `json:"mac_filter_policy,omitempty"` // allow|deny
|
MACFilterPolicy string `json:"mac_filter_policy,omitempty"` // allow|deny
|
||||||
@@ -69,16 +70,23 @@ type WLAN struct {
|
|||||||
No2GhzOui bool `json:"no2ghz_oui"`
|
No2GhzOui bool `json:"no2ghz_oui"`
|
||||||
P2P bool `json:"p2p"`
|
P2P bool `json:"p2p"`
|
||||||
P2PCrossConnect bool `json:"p2p_cross_connect"`
|
P2PCrossConnect bool `json:"p2p_cross_connect"`
|
||||||
PMFMode string `json:"pmf_mode,omitempty"` // disabled|optional|required
|
PMFCipher string `json:"pmf_cipher,omitempty"` // auto|aes-128-cmac|bip-gmac-256
|
||||||
Priority string `json:"priority,omitempty"` // medium|high|low
|
PMFMode string `json:"pmf_mode,omitempty"` // disabled|optional|required
|
||||||
|
Priority string `json:"priority,omitempty"` // medium|high|low
|
||||||
ProxyArp bool `json:"proxy_arp"`
|
ProxyArp bool `json:"proxy_arp"`
|
||||||
RADIUSDasEnabled bool `json:"radius_das_enabled"`
|
RADIUSDasEnabled bool `json:"radius_das_enabled"`
|
||||||
|
RADIUSFilterIDEnabled bool `json:"radius_filter_id_enabled"`
|
||||||
RADIUSMACAuthEnabled bool `json:"radius_mac_auth_enabled"`
|
RADIUSMACAuthEnabled bool `json:"radius_mac_auth_enabled"`
|
||||||
RADIUSMACaclEmptyPassword bool `json:"radius_macacl_empty_password"`
|
RADIUSMACaclEmptyPassword bool `json:"radius_macacl_empty_password"`
|
||||||
RADIUSMACaclFormat string `json:"radius_macacl_format,omitempty"` // none_lower|hyphen_lower|colon_lower|none_upper|hyphen_upper|colon_upper
|
RADIUSMACaclFormat string `json:"radius_macacl_format,omitempty"` // none_lower|hyphen_lower|colon_lower|none_upper|hyphen_upper|colon_upper
|
||||||
RADIUSProfileID string `json:"radiusprofile_id"`
|
RADIUSProfileID string `json:"radiusprofile_id"`
|
||||||
RoamClusterID int `json:"roam_cluster_id,omitempty"` // [0-9]|[1-2][0-9]|[3][0-1]|^$
|
RoamClusterID int `json:"roam_cluster_id,omitempty"` // [0-9]|[1-2][0-9]|[3][0-1]|^$
|
||||||
RrmEnabled bool `json:"rrm_enabled"`
|
RrmEnabled bool `json:"rrm_enabled"`
|
||||||
|
SaeAntiClogging int `json:"sae_anti_clogging,omitempty"`
|
||||||
|
SaeGroups []int `json:"sae_groups,omitempty"`
|
||||||
|
SaePsk []WLANSaePsk `json:"sae_psk,omitempty"`
|
||||||
|
SaePskVLANRequired bool `json:"sae_psk_vlan_required"`
|
||||||
|
SaeSync int `json:"sae_sync,omitempty"`
|
||||||
Schedule []string `json:"schedule,omitempty"` // (sun|mon|tue|wed|thu|fri|sat)(\-(sun|mon|tue|wed|thu|fri|sat))?\|([0-2][0-9][0-5][0-9])\-([0-2][0-9][0-5][0-9])
|
Schedule []string `json:"schedule,omitempty"` // (sun|mon|tue|wed|thu|fri|sat)(\-(sun|mon|tue|wed|thu|fri|sat))?\|([0-2][0-9][0-5][0-9])\-([0-2][0-9][0-5][0-9])
|
||||||
ScheduleEnabled bool `json:"schedule_enabled"`
|
ScheduleEnabled bool `json:"schedule_enabled"`
|
||||||
ScheduleReversed bool `json:"schedule_reversed"`
|
ScheduleReversed bool `json:"schedule_reversed"`
|
||||||
@@ -92,28 +100,36 @@ type WLAN struct {
|
|||||||
WEPIDX int `json:"wep_idx,omitempty"` // [1-4]
|
WEPIDX int `json:"wep_idx,omitempty"` // [1-4]
|
||||||
WLANBand string `json:"wlan_band,omitempty"` // 2g|5g|both
|
WLANBand string `json:"wlan_band,omitempty"` // 2g|5g|both
|
||||||
WLANGroupID string `json:"wlangroup_id"`
|
WLANGroupID string `json:"wlangroup_id"`
|
||||||
WPAEnc string `json:"wpa_enc,omitempty"` // auto|ccmp
|
WPA3Enhanced192 bool `json:"wpa3_enhanced_192"`
|
||||||
WPAMode string `json:"wpa_mode,omitempty"` // auto|wpa1|wpa2
|
WPA3FastRoaming bool `json:"wpa3_fast_roaming"`
|
||||||
XIappKey string `json:"x_iapp_key,omitempty"` // [0-9A-Fa-f]{32}
|
WPA3Support bool `json:"wpa3_support"`
|
||||||
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64}
|
WPA3Transition bool `json:"wpa3_transition"`
|
||||||
|
WPAEnc string `json:"wpa_enc,omitempty"` // auto|ccmp|gcmp|ccmp-256|gcmp-256
|
||||||
|
WPAMode string `json:"wpa_mode,omitempty"` // auto|wpa1|wpa2
|
||||||
|
WPAPskRADIUS string `json:"wpa_psk_radius,omitempty"` // disabled|optional|required
|
||||||
|
XIappKey string `json:"x_iapp_key,omitempty"` // [0-9A-Fa-f]{32}
|
||||||
|
XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,255}|[0-9a-fA-F]{64}
|
||||||
XWEP string `json:"x_wep,omitempty"`
|
XWEP string `json:"x_wep,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *WLAN) UnmarshalJSON(b []byte) error {
|
func (dst *WLAN) UnmarshalJSON(b []byte) error {
|
||||||
type Alias WLAN
|
type Alias WLAN
|
||||||
aux := &struct {
|
aux := &struct {
|
||||||
DTIMNa emptyStringInt `json:"dtim_na"`
|
DTIMNa emptyStringInt `json:"dtim_na"`
|
||||||
DTIMNg emptyStringInt `json:"dtim_ng"`
|
DTIMNg emptyStringInt `json:"dtim_ng"`
|
||||||
GroupRekey emptyStringInt `json:"group_rekey"`
|
GroupRekey emptyStringInt `json:"group_rekey"`
|
||||||
MinrateNaBeaconRateKbps emptyStringInt `json:"minrate_na_beacon_rate_kbps"`
|
MinrateNaBeaconRateKbps emptyStringInt `json:"minrate_na_beacon_rate_kbps"`
|
||||||
MinrateNaDataRateKbps emptyStringInt `json:"minrate_na_data_rate_kbps"`
|
MinrateNaDataRateKbps emptyStringInt `json:"minrate_na_data_rate_kbps"`
|
||||||
MinrateNaMgmtRateKbps emptyStringInt `json:"minrate_na_mgmt_rate_kbps"`
|
MinrateNaMgmtRateKbps emptyStringInt `json:"minrate_na_mgmt_rate_kbps"`
|
||||||
MinrateNgBeaconRateKbps emptyStringInt `json:"minrate_ng_beacon_rate_kbps"`
|
MinrateNgBeaconRateKbps emptyStringInt `json:"minrate_ng_beacon_rate_kbps"`
|
||||||
MinrateNgDataRateKbps emptyStringInt `json:"minrate_ng_data_rate_kbps"`
|
MinrateNgDataRateKbps emptyStringInt `json:"minrate_ng_data_rate_kbps"`
|
||||||
MinrateNgMgmtRateKbps emptyStringInt `json:"minrate_ng_mgmt_rate_kbps"`
|
MinrateNgMgmtRateKbps emptyStringInt `json:"minrate_ng_mgmt_rate_kbps"`
|
||||||
RoamClusterID emptyStringInt `json:"roam_cluster_id"`
|
RoamClusterID emptyStringInt `json:"roam_cluster_id"`
|
||||||
VLAN emptyStringInt `json:"vlan"`
|
SaeAntiClogging emptyStringInt `json:"sae_anti_clogging"`
|
||||||
WEPIDX emptyStringInt `json:"wep_idx"`
|
SaeGroups []emptyStringInt `json:"sae_groups"`
|
||||||
|
SaeSync emptyStringInt `json:"sae_sync"`
|
||||||
|
VLAN emptyStringInt `json:"vlan"`
|
||||||
|
WEPIDX emptyStringInt `json:"wep_idx"`
|
||||||
|
|
||||||
*Alias
|
*Alias
|
||||||
}{
|
}{
|
||||||
@@ -134,14 +150,47 @@ func (dst *WLAN) UnmarshalJSON(b []byte) error {
|
|||||||
dst.MinrateNgDataRateKbps = int(aux.MinrateNgDataRateKbps)
|
dst.MinrateNgDataRateKbps = int(aux.MinrateNgDataRateKbps)
|
||||||
dst.MinrateNgMgmtRateKbps = int(aux.MinrateNgMgmtRateKbps)
|
dst.MinrateNgMgmtRateKbps = int(aux.MinrateNgMgmtRateKbps)
|
||||||
dst.RoamClusterID = int(aux.RoamClusterID)
|
dst.RoamClusterID = int(aux.RoamClusterID)
|
||||||
|
dst.SaeAntiClogging = int(aux.SaeAntiClogging)
|
||||||
|
dst.SaeGroups = make([]int, len(aux.SaeGroups))
|
||||||
|
for i, v := range aux.SaeGroups {
|
||||||
|
dst.SaeGroups[i] = int(v)
|
||||||
|
}
|
||||||
|
dst.SaeSync = int(aux.SaeSync)
|
||||||
dst.VLAN = int(aux.VLAN)
|
dst.VLAN = int(aux.VLAN)
|
||||||
dst.WEPIDX = int(aux.WEPIDX)
|
dst.WEPIDX = int(aux.WEPIDX)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type WLANSaePsk struct {
|
||||||
|
ID string `json:"id"` // .{0,128}
|
||||||
|
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
|
||||||
|
Psk string `json:"psk,omitempty"` // [\x20-\x7E]{8,255}
|
||||||
|
VLAN int `json:"vlan,omitempty"` // [0-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-8][0-9]|409[0-5]|^$
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dst *WLANSaePsk) UnmarshalJSON(b []byte) error {
|
||||||
|
type Alias WLANSaePsk
|
||||||
|
aux := &struct {
|
||||||
|
VLAN emptyStringInt `json:"vlan"`
|
||||||
|
|
||||||
|
*Alias
|
||||||
|
}{
|
||||||
|
Alias: (*Alias)(dst),
|
||||||
|
}
|
||||||
|
|
||||||
|
err := json.Unmarshal(b, &aux)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to unmarshal alias: %w", err)
|
||||||
|
}
|
||||||
|
dst.VLAN = int(aux.VLAN)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type WLANScheduleWithDuration struct {
|
type WLANScheduleWithDuration struct {
|
||||||
DurationMinutes int `json:"duration_minutes,omitempty"` // ^[1-9][0-9]*$
|
DurationMinutes int `json:"duration_minutes,omitempty"` // ^[1-9][0-9]*$
|
||||||
|
Name string `json:"name,omitempty"` // .*
|
||||||
StartDaysOfWeek []string `json:"start_days_of_week,omitempty"` // ^(sun|mon|tue|wed|thu|fri|sat)$
|
StartDaysOfWeek []string `json:"start_days_of_week,omitempty"` // ^(sun|mon|tue|wed|thu|fri|sat)$
|
||||||
StartHour int `json:"start_hour,omitempty"` // ^(1?[0-9])|(2[0-3])$
|
StartHour int `json:"start_hour,omitempty"` // ^(1?[0-9])|(2[0-3])$
|
||||||
StartMinute int `json:"start_minute,omitempty"` // ^[0-5]?[0-9]$
|
StartMinute int `json:"start_minute,omitempty"` // ^[0-5]?[0-9]$
|
||||||
|
|||||||
Reference in New Issue
Block a user