Update to network version 9.0.114

This commit is contained in:
2025-04-14 12:03:26 +02:00
parent 73d68d5ac1
commit bce4a5bdfd
16 changed files with 685 additions and 225 deletions

230
unifi/wlan.generated.go generated
View File

@@ -41,11 +41,12 @@ type WLAN struct {
DTIMNg int `json:"dtim_ng,omitempty"` // ^([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
ElementAdopt bool `json:"element_adopt"`
Enabled bool `json:"enabled"`
EnhancedIot bool `json:"enhanced_iot"`
FastRoamingEnabled bool `json:"fast_roaming_enabled"`
GroupRekey int `json:"group_rekey,omitempty"` // ^(0|[6-9][0-9]|[1-9][0-9]{2,3}|[1-7][0-9]{4}|8[0-5][0-9]{3}|86[0-3][0-9][0-9]|86400)$
HideSSID bool `json:"hide_ssid"`
Hotspot2 WLANHotspot2 `json:"hotspot2,omitempty"`
Hotspot2ConfEnabled bool `json:"hotspot2conf_enabled"`
Hotspot2ConfID string `json:"hotspot2conf_id"`
IappEnabled bool `json:"iapp_enabled"`
IsGuest bool `json:"is_guest"`
L2Isolation bool `json:"l2_isolation"`
@@ -65,6 +66,8 @@ type WLAN struct {
Name string `json:"name,omitempty"` // .{1,32}
NameCombineEnabled bool `json:"name_combine_enabled"`
NameCombineSuffix string `json:"name_combine_suffix,omitempty"` // .{0,8}
NasIDentifier string `json:"nas_identifier,omitempty"` // .{0,48}
NasIDentifierType string `json:"nas_identifier_type,omitempty"` // ap_name|ap_mac|bssid|site_name|custom
NetworkID string `json:"networkconf_id"`
No2GhzOui bool `json:"no2ghz_oui"`
OptimizeIotWifiConnectivity bool `json:"optimize_iot_wifi_connectivity"`
@@ -160,6 +163,188 @@ func (dst *WLAN) UnmarshalJSON(b []byte) error {
return nil
}
type WLANCapab struct {
Port int `json:"port,omitempty"` // ^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])|$
Protocol string `json:"protocol,omitempty"` // icmp|tcp_udp|tcp|udp|esp
Status string `json:"status,omitempty"` // closed|open|unknown
}
func (dst *WLANCapab) UnmarshalJSON(b []byte) error {
type Alias WLANCapab
aux := &struct {
Port emptyStringInt `json:"port"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.Port = int(aux.Port)
return nil
}
type WLANCellularNetworkList struct {
CountryCode int `json:"country_code,omitempty"` // [1-9]{1}[0-9]{0,3}
Mcc int `json:"mcc,omitempty"`
Mnc int `json:"mnc,omitempty"`
Name string `json:"name,omitempty"` // .{1,128}
}
func (dst *WLANCellularNetworkList) UnmarshalJSON(b []byte) error {
type Alias WLANCellularNetworkList
aux := &struct {
CountryCode emptyStringInt `json:"country_code"`
Mcc emptyStringInt `json:"mcc"`
Mnc emptyStringInt `json:"mnc"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.CountryCode = int(aux.CountryCode)
dst.Mcc = int(aux.Mcc)
dst.Mnc = int(aux.Mnc)
return nil
}
type WLANFriendlyName struct {
Language string `json:"language,omitempty"` // [a-z]{3}
Text string `json:"text,omitempty"` // .{1,128}
}
func (dst *WLANFriendlyName) UnmarshalJSON(b []byte) error {
type Alias WLANFriendlyName
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
type WLANHotspot2 struct {
Capab []WLANCapab `json:"capab,omitempty"`
CellularNetworkList []WLANCellularNetworkList `json:"cellular_network_list,omitempty"`
DomainNameList []string `json:"domain_name_list,omitempty"` // .{1,128}
FriendlyName []WLANFriendlyName `json:"friendly_name,omitempty"`
IPaddrTypeAvailV4 int `json:"ipaddr_type_avail_v4,omitempty"` // 0|1|2|3|4|5|6|7
IPaddrTypeAvailV6 int `json:"ipaddr_type_avail_v6,omitempty"` // 0|1|2
MetricsDownlinkLoad int `json:"metrics_downlink_load,omitempty"`
MetricsDownlinkLoadSet bool `json:"metrics_downlink_load_set"`
MetricsDownlinkSpeed int `json:"metrics_downlink_speed,omitempty"`
MetricsDownlinkSpeedSet bool `json:"metrics_downlink_speed_set"`
MetricsInfoAtCapacity bool `json:"metrics_info_at_capacity"`
MetricsInfoLinkStatus string `json:"metrics_info_link_status,omitempty"` // up|down|test
MetricsInfoSymmetric bool `json:"metrics_info_symmetric"`
MetricsMeasurement int `json:"metrics_measurement,omitempty"`
MetricsMeasurementSet bool `json:"metrics_measurement_set"`
MetricsStatus bool `json:"metrics_status"`
MetricsUplinkLoad int `json:"metrics_uplink_load,omitempty"`
MetricsUplinkLoadSet bool `json:"metrics_uplink_load_set"`
MetricsUplinkSpeed int `json:"metrics_uplink_speed,omitempty"`
MetricsUplinkSpeedSet bool `json:"metrics_uplink_speed_set"`
NaiRealmList []WLANNaiRealmList `json:"nai_realm_list,omitempty"`
NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15
RoamingConsortiumList []WLANRoamingConsortiumList `json:"roaming_consortium_list,omitempty"`
VenueGroup int `json:"venue_group,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11
VenueName []WLANVenueName `json:"venue_name,omitempty"`
VenueType int `json:"venue_type,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15
}
func (dst *WLANHotspot2) UnmarshalJSON(b []byte) error {
type Alias WLANHotspot2
aux := &struct {
IPaddrTypeAvailV4 emptyStringInt `json:"ipaddr_type_avail_v4"`
IPaddrTypeAvailV6 emptyStringInt `json:"ipaddr_type_avail_v6"`
MetricsDownlinkLoad emptyStringInt `json:"metrics_downlink_load"`
MetricsDownlinkSpeed emptyStringInt `json:"metrics_downlink_speed"`
MetricsMeasurement emptyStringInt `json:"metrics_measurement"`
MetricsUplinkLoad emptyStringInt `json:"metrics_uplink_load"`
MetricsUplinkSpeed emptyStringInt `json:"metrics_uplink_speed"`
NetworkType emptyStringInt `json:"network_type"`
VenueGroup emptyStringInt `json:"venue_group"`
VenueType emptyStringInt `json:"venue_type"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.IPaddrTypeAvailV4 = int(aux.IPaddrTypeAvailV4)
dst.IPaddrTypeAvailV6 = int(aux.IPaddrTypeAvailV6)
dst.MetricsDownlinkLoad = int(aux.MetricsDownlinkLoad)
dst.MetricsDownlinkSpeed = int(aux.MetricsDownlinkSpeed)
dst.MetricsMeasurement = int(aux.MetricsMeasurement)
dst.MetricsUplinkLoad = int(aux.MetricsUplinkLoad)
dst.MetricsUplinkSpeed = int(aux.MetricsUplinkSpeed)
dst.NetworkType = int(aux.NetworkType)
dst.VenueGroup = int(aux.VenueGroup)
dst.VenueType = int(aux.VenueType)
return nil
}
type WLANNaiRealmList struct {
AuthIDs []int `json:"auth_ids,omitempty"` // 0|1|2|3|4|5
AuthVals []int `json:"auth_vals,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10
EapMethod int `json:"eap_method,omitempty"` // 13|21|18|23|50
Encoding int `json:"encoding,omitempty"` // 0|1
Name string `json:"name,omitempty"` // .{1,128}
Status bool `json:"status"`
}
func (dst *WLANNaiRealmList) UnmarshalJSON(b []byte) error {
type Alias WLANNaiRealmList
aux := &struct {
AuthIDs []emptyStringInt `json:"auth_ids"`
AuthVals []emptyStringInt `json:"auth_vals"`
EapMethod emptyStringInt `json:"eap_method"`
Encoding emptyStringInt `json:"encoding"`
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.AuthIDs = make([]int, len(aux.AuthIDs))
for i, v := range aux.AuthIDs {
dst.AuthIDs[i] = int(v)
}
dst.AuthVals = make([]int, len(aux.AuthVals))
for i, v := range aux.AuthVals {
dst.AuthVals[i] = int(v)
}
dst.EapMethod = int(aux.EapMethod)
dst.Encoding = int(aux.Encoding)
return nil
}
type WLANPrivatePresharedKeys struct {
NetworkID string `json:"networkconf_id"`
Password string `json:"password,omitempty"` // [\x20-\x7E]{8,255}
@@ -181,6 +366,27 @@ func (dst *WLANPrivatePresharedKeys) UnmarshalJSON(b []byte) error {
return nil
}
type WLANRoamingConsortiumList struct {
Name string `json:"name,omitempty"` // .{1,128}
Oid string `json:"oid,omitempty"` // .{1,128}
}
func (dst *WLANRoamingConsortiumList) UnmarshalJSON(b []byte) error {
type Alias WLANRoamingConsortiumList
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
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})$
@@ -238,6 +444,28 @@ func (dst *WLANScheduleWithDuration) UnmarshalJSON(b []byte) error {
return nil
}
type WLANVenueName struct {
Language string `json:"language,omitempty"` // [a-z]{0,3}
Name string `json:"name,omitempty"`
Url string `json:"url,omitempty"`
}
func (dst *WLANVenueName) UnmarshalJSON(b []byte) error {
type Alias WLANVenueName
aux := &struct {
*Alias
}{
Alias: (*Alias)(dst),
}
err := json.Unmarshal(b, &aux)
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
return nil
}
func (c *Client) listWLAN(ctx context.Context, site string) ([]WLAN, error) {
var respBody struct {
Meta meta `json:"meta"`