From bee58f48d4d06b5b0e5eabdb8f01984ddc9177d6 Mon Sep 17 00:00:00 2001 From: James Stephenson Date: Wed, 2 Sep 2020 17:35:14 -0400 Subject: [PATCH] Regenerated types so that sub-types are not embedded. This allows callers to create complex payloads; for example, to create a Device type for a Unifi Switch with PortOverrides, the caller needs to create these sub-types, which is not possible when it's purely embedded. --- unifi/channel_plan.generated.go | 76 ++++---- unifi/dashboard.generated.go | 22 +-- unifi/device.generated.go | 288 ++++++++++++++++-------------- unifi/hotspot_2_conf.generated.go | 209 ++++++++++++---------- unifi/radius_profile.generated.go | 40 +++-- unifi/schedule_task.generated.go | 26 +-- unifi/setting_ips.generated.go | 86 +++++---- unifi/spatial_record.generated.go | 22 ++- 8 files changed, 420 insertions(+), 349 deletions(-) diff --git a/unifi/channel_plan.generated.go b/unifi/channel_plan.generated.go index cc71614..3e5c0a0 100644 --- a/unifi/channel_plan.generated.go +++ b/unifi/channel_plan.generated.go @@ -23,39 +23,49 @@ type ChannelPlan struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - ApBlacklistedChannels []struct { - Channel int `json:"channel,omitempty"` // 36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196 - MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ - Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} - } `json:"ap_blacklisted_channels,omitempty"` - ConfSource string `json:"conf_source,omitempty"` // manual|radio-ai - Coupling []struct { - Rssi int `json:"rssi,omitempty"` - Source string `json:"source,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ - Target string `json:"target,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ - } `json:"coupling,omitempty"` - Date string `json:"date"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z?$ - Fitness float64 `json:"fitness,omitempty"` - Note string `json:"note,omitempty"` // .{0,1024} - Radio string `json:"radio,omitempty"` // na|ng|ng\+na - RadioTable []struct { - BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto - Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto - DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ - Name string `json:"name,omitempty"` // [a-z]*[0-9]* - TxPower string `json:"tx_power,omitempty"` // [\d]+|auto - TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom - Width int `json:"width,omitempty"` // 20|40|80|160 - } `json:"radio_table,omitempty"` - Satisfaction float64 `json:"satisfaction,omitempty"` - SatisfactionTable []struct { - DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ - Satisfaction float64 `json:"satisfaction,omitempty"` - } `json:"satisfaction_table,omitempty"` - SiteBlacklistedChannels []struct { - Channel int `json:"channel,omitempty"` // 36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196 - Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} - } `json:"site_blacklisted_channels,omitempty"` + ApBlacklistedChannels []ChannelPlan_ApBlacklistedChannels `json:"ap_blacklisted_channels,omitempty"` + ConfSource string `json:"conf_source,omitempty"` // manual|radio-ai + Coupling []ChannelPlan_Coupling `json:"coupling,omitempty"` + Date string `json:"date"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z?$ + Fitness float64 `json:"fitness,omitempty"` + Note string `json:"note,omitempty"` // .{0,1024} + Radio string `json:"radio,omitempty"` // na|ng|ng\+na + RadioTable []ChannelPlan_RadioTable `json:"radio_table,omitempty"` + Satisfaction float64 `json:"satisfaction,omitempty"` + SatisfactionTable []ChannelPlan_SatisfactionTable `json:"satisfaction_table,omitempty"` + SiteBlacklistedChannels []ChannelPlan_SiteBlacklistedChannels `json:"site_blacklisted_channels,omitempty"` +} + +type ChannelPlan_ApBlacklistedChannels struct { + Channel int `json:"channel,omitempty"` // 36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196 + MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ + Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} +} + +type ChannelPlan_Coupling struct { + Rssi int `json:"rssi,omitempty"` + Source string `json:"source,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ + Target string `json:"target,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}).*$ +} + +type ChannelPlan_RadioTable struct { + BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto + Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto + DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ + Name string `json:"name,omitempty"` // [a-z]*[0-9]* + TxPower string `json:"tx_power,omitempty"` // [\d]+|auto + TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom + Width int `json:"width,omitempty"` // 20|40|80|160 +} + +type ChannelPlan_SatisfactionTable struct { + DeviceMAC string `json:"device_mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ + Satisfaction float64 `json:"satisfaction,omitempty"` +} + +type ChannelPlan_SiteBlacklistedChannels struct { + Channel int `json:"channel,omitempty"` // 36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196 + Timestamp int `json:"timestamp,omitempty"` // [1-9][0-9]{12} } func (c *Client) listChannelPlan(ctx context.Context, site string) ([]ChannelPlan, error) { diff --git a/unifi/dashboard.generated.go b/unifi/dashboard.generated.go index c005a83..464c20a 100644 --- a/unifi/dashboard.generated.go +++ b/unifi/dashboard.generated.go @@ -23,16 +23,18 @@ type Dashboard struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - ControllerVersion string `json:"controller_version,omitempty"` - Desc string `json:"desc,omitempty"` - IsPublic bool `json:"is_public"` - Modules []struct { - Config string `json:"config,omitempty"` - ID string `json:"id"` - ModuleID string `json:"module_id"` - Restrictions string `json:"restrictions,omitempty"` - } `json:"modules,omitempty"` - Name string `json:"name,omitempty"` + ControllerVersion string `json:"controller_version,omitempty"` + Desc string `json:"desc,omitempty"` + IsPublic bool `json:"is_public"` + Modules []Dashboard_Modules `json:"modules,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dashboard_Modules struct { + Config string `json:"config,omitempty"` + ID string `json:"id"` + ModuleID string `json:"module_id"` + Restrictions string `json:"restrictions,omitempty"` } func (c *Client) listDashboard(ctx context.Context, site string) ([]Dashboard, error) { diff --git a/unifi/device.generated.go b/unifi/device.generated.go index c2c669f..2041187 100644 --- a/unifi/device.generated.go +++ b/unifi/device.generated.go @@ -23,142 +23,158 @@ type Device struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - AtfEnabled bool `json:"atf_enabled,omitempty"` - BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g - BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* - BaresipEnabled bool `json:"baresip_enabled,omitempty"` - BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* - ConfigNetwork struct { - BondingEnabled bool `json:"bonding_enabled,omitempty"` - DNS1 string `json:"dns1,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])$|^(([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]))$|^$ - DNS2 string `json:"dns2,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])$|^(([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]))$|^$ - DNSsuffix string `json:"dnssuffix,omitempty"` - Gateway string `json:"gateway,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])$|^$ - 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])$ - Netmask string `json:"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)))))$ - Type string `json:"type,omitempty"` // dhcp|static - } `json:"config_network,omitempty"` - DPIEnabled bool `json:"dpi_enabled,omitempty"` - Disabled bool `json:"disabled,omitempty"` - Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+| - Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"` - EthernetOverrides []struct { - Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2} - NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]? - } `json:"ethernet_overrides,omitempty"` - FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"` - HeightInMeters float64 `json:"heightInMeters,omitempty"` - JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"` - LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100 - LcmBrightnessOverride bool `json:"lcm_brightness_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 - LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"` - LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"` - LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50} - LedOverride string `json:"led_override,omitempty"` // default|on|off - LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$ - LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$ - Locked bool `json:"locked,omitempty"` - LteExtAnt bool `json:"lte_ext_ant,omitempty"` - LtePoe bool `json:"lte_poe,omitempty"` - LteSoftLimit int `json:"lte_soft_limit,omitempty"` - MapID string `json:"map_id,omitempty"` - MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"` - MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+ - Name string `json:"name,omitempty"` // .{1,128} - OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off - OutletCycleEnabled bool `json:"outlet_cycle_enabled,omitempty"` - OutletOverrides []struct { - Index int `json:"index,omitempty"` - RelayState bool `json:"relay_state,omitempty"` - } `json:"outlet_overrides,omitempty"` - PortOverrides []struct { - AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-6] - Autoneg bool `json:"autoneg,omitempty"` - Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host - EgressRateLimitKbps int `json:"egress_rate_limit_kbps,omitempty"` // 6[4-9]|[7-9][0-9]|[1-9][0-9]{2,6} - EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"` - FullDuplex bool `json:"full_duplex,omitempty"` - Isolation bool `json:"isolation,omitempty"` - LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"` - LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"` - MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] - Name string `json:"name,omitempty"` // .{0,128} - OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate - PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off - PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] - PortSecurityEnabled bool `json:"port_security_enabled,omitempty"` - PortSecurityMACAddress []string `json:"port_security_mac_address,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$ - PortconfID string `json:"portconf_id,omitempty"` // [\d\w]+ - PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100 - PriorityQueue2Level int `json:"priority_queue2_level,omitempty"` // [0-9]|[1-9][0-9]|100 - PriorityQueue3Level int `json:"priority_queue3_level,omitempty"` // [0-9]|[1-9][0-9]|100 - PriorityQueue4Level int `json:"priority_queue4_level,omitempty"` // [0-9]|[1-9][0-9]|100 - Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000 - StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"` - StormctrlBroadcastastLevel int `json:"stormctrl_bcast_level,omitempty"` // [0-9]|[1-9][0-9]|100 - StormctrlBroadcastastRate int `json:"stormctrl_bcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 - StormctrlMcastEnabled bool `json:"stormctrl_mcast_enabled,omitempty"` - StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100 - StormctrlMcastRate int `json:"stormctrl_mcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 - StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate - StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"` - StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100 - StormctrlUcastRate int `json:"stormctrl_ucast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 - StpPortMode bool `json:"stp_port_mode,omitempty"` - } `json:"port_overrides,omitempty"` - PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps - PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"` - RADIUSProfileID string `json:"radiusprofile_id,omitempty"` - RadioTable []struct { - AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9]) - AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9] - BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto - Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto - HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"` - Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160 - MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$ - MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"` - Name string `json:"name,omitempty"` - Radio string `json:"radio,omitempty"` // ng|na|ad - SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$ - SensLevelEnabled bool `json:"sens_level_enabled,omitempty"` - TxPower string `json:"tx_power,omitempty"` // [\d]+|auto - TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom - VwireEnabled bool `json:"vwire_enabled,omitempty"` - WLANGroupID string `json:"wlangroup_id,omitempty"` // [\d\w]+ - } `json:"radio_table,omitempty"` - ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off - RpsOverride struct { - PowerManagementMode string `json:"power_management_mode,omitempty"` // dynamic|static - RpsPortTable []struct { - Name string `json:"name,omitempty"` // .{0,32} - PortIDX int `json:"port_idx,omitempty"` // [1-6] - PortMode string `json:"port_mode,omitempty"` // auto|force_active|manual|disabled - } `json:"rps_port_table,omitempty"` - } `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 []struct { - Enabled bool `json:"enabled,omitempty"` - Name string `json:"name,omitempty"` // .{1,32} - NameCombineEnabled bool `json:"name_combine_enabled,omitempty"` - NameCombineSuffix string `json:"name_combine_suffix,omitempty"` // .{0,8} - Radio string `json:"radio,omitempty"` // ng|na - RadioName string `json:"radio_name,omitempty"` - 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"` - WLANID string `json:"wlan_id,omitempty"` // [\d\w]+ - XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64} - } `json:"wlan_overrides,omitempty"` - X int `json:"x,omitempty"` - XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]* - Y int `json:"y,omitempty"` + AtfEnabled bool `json:"atf_enabled,omitempty"` + BandsteeringMode string `json:"bandsteering_mode,omitempty"` // off|equal|prefer_5g + BaresipAuthUser string `json:"baresip_auth_user,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* + BaresipEnabled bool `json:"baresip_enabled,omitempty"` + BaresipExtension string `json:"baresip_extension,omitempty"` // ^\+?[a-zA-Z0-9_.\-!~*'()]* + ConfigNetwork Device_ConfigNetwork `json:"config_network,omitempty"` + DPIEnabled bool `json:"dpi_enabled,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Dot1XFallbackNetworkID string `json:"dot1x_fallback_networkconf_id,omitempty"` // [\d\w]+| + Dot1XPortctrlEnabled bool `json:"dot1x_portctrl_enabled,omitempty"` + EthernetOverrides []Device_EthernetOverrides `json:"ethernet_overrides,omitempty"` + FlowctrlEnabled bool `json:"flowctrl_enabled,omitempty"` + HeightInMeters float64 `json:"heightInMeters,omitempty"` + JumboframeEnabled bool `json:"jumboframe_enabled,omitempty"` + LcmBrightness int `json:"lcm_brightness,omitempty"` // [1-9]|[1-9][0-9]|100 + LcmBrightnessOverride bool `json:"lcm_brightness_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 + LcmIDleTimeoutOverride bool `json:"lcm_idle_timeout_override,omitempty"` + LcmTrackerEnabled bool `json:"lcm_tracker_enabled,omitempty"` + LcmTrackerSeed string `json:"lcm_tracker_seed,omitempty"` // .{0,50} + LedOverride string `json:"led_override,omitempty"` // default|on|off + LedOverrideColor string `json:"led_override_color,omitempty"` // ^#(?:[0-9a-fA-F]{3}){1,2}$ + LedOverrideColorBrightness int `json:"led_override_color_brightness,omitempty"` // ^[0-9][0-9]?$|^100$ + Locked bool `json:"locked,omitempty"` + LteExtAnt bool `json:"lte_ext_ant,omitempty"` + LtePoe bool `json:"lte_poe,omitempty"` + LteSoftLimit int `json:"lte_soft_limit,omitempty"` + MapID string `json:"map_id,omitempty"` + MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"` + MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+ + Name string `json:"name,omitempty"` // .{1,128} + OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off + OutletCycleEnabled bool `json:"outlet_cycle_enabled,omitempty"` + OutletOverrides []Device_OutletOverrides `json:"outlet_overrides,omitempty"` + PortOverrides []Device_PortOverrides `json:"port_overrides,omitempty"` + PowerSourceCtrl string `json:"power_source_ctrl,omitempty"` // auto|8023af|8023at|8023bt-type3|8023bt-type4|pasv24|poe-injector|ac|adapter|dc|rps + PowerSourceCtrlEnabled bool `json:"power_source_ctrl_enabled,omitempty"` + RADIUSProfileID string `json:"radiusprofile_id,omitempty"` + RadioTable []Device_RadioTable `json:"radio_table,omitempty"` + ResetbtnEnabled string `json:"resetbtn_enabled,omitempty"` // on|off + RpsOverride Device_RpsOverride `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 []Device_WLANOverrides `json:"wlan_overrides,omitempty"` + X int `json:"x,omitempty"` + XBaresipPassword string `json:"x_baresip_password,omitempty"` // ^[a-zA-Z0-9_.\-!~*'()]* + Y int `json:"y,omitempty"` +} + +type Device_ConfigNetwork struct { + BondingEnabled bool `json:"bonding_enabled,omitempty"` + DNS1 string `json:"dns1,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])$|^(([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]))$|^$ + DNS2 string `json:"dns2,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])$|^(([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]))$|^$ + DNSsuffix string `json:"dnssuffix,omitempty"` + Gateway string `json:"gateway,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])$|^$ + 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])$ + Netmask string `json:"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)))))$ + Type string `json:"type,omitempty"` // dhcp|static +} + +type Device_EthernetOverrides struct { + Ifname string `json:"ifname,omitempty"` // eth[0-9]{1,2} + NetworkGroup string `json:"networkgroup,omitempty"` // LAN[2-8]?|WAN[2]? +} + +type Device_OutletOverrides struct { + Index int `json:"index,omitempty"` + RelayState bool `json:"relay_state,omitempty"` +} + +type Device_PortOverrides struct { + AggregateNumPorts int `json:"aggregate_num_ports,omitempty"` // [2-6] + Autoneg bool `json:"autoneg,omitempty"` + Dot1XCtrl string `json:"dot1x_ctrl,omitempty"` // auto|force_authorized|force_unauthorized|mac_based|multi_host + EgressRateLimitKbps int `json:"egress_rate_limit_kbps,omitempty"` // 6[4-9]|[7-9][0-9]|[1-9][0-9]{2,6} + EgressRateLimitKbpsEnabled bool `json:"egress_rate_limit_kbps_enabled,omitempty"` + FullDuplex bool `json:"full_duplex,omitempty"` + Isolation bool `json:"isolation,omitempty"` + LldpmedEnabled bool `json:"lldpmed_enabled,omitempty"` + LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled,omitempty"` + MirrorPortIDX int `json:"mirror_port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] + Name string `json:"name,omitempty"` // .{0,128} + OpMode string `json:"op_mode,omitempty"` // switch|mirror|aggregate + PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off + PortIDX int `json:"port_idx,omitempty"` // [1-9]|[1-4][0-9]|5[0-2] + PortSecurityEnabled bool `json:"port_security_enabled,omitempty"` + PortSecurityMACAddress []string `json:"port_security_mac_address,omitempty"` // ^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$ + PortconfID string `json:"portconf_id,omitempty"` // [\d\w]+ + PriorityQueue1Level int `json:"priority_queue1_level,omitempty"` // [0-9]|[1-9][0-9]|100 + PriorityQueue2Level int `json:"priority_queue2_level,omitempty"` // [0-9]|[1-9][0-9]|100 + PriorityQueue3Level int `json:"priority_queue3_level,omitempty"` // [0-9]|[1-9][0-9]|100 + PriorityQueue4Level int `json:"priority_queue4_level,omitempty"` // [0-9]|[1-9][0-9]|100 + Speed int `json:"speed,omitempty"` // 10|100|1000|2500|5000|10000|20000|25000|40000|50000|100000 + StormctrlBroadcastastEnabled bool `json:"stormctrl_bcast_enabled,omitempty"` + StormctrlBroadcastastLevel int `json:"stormctrl_bcast_level,omitempty"` // [0-9]|[1-9][0-9]|100 + StormctrlBroadcastastRate int `json:"stormctrl_bcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 + StormctrlMcastEnabled bool `json:"stormctrl_mcast_enabled,omitempty"` + StormctrlMcastLevel int `json:"stormctrl_mcast_level,omitempty"` // [0-9]|[1-9][0-9]|100 + StormctrlMcastRate int `json:"stormctrl_mcast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 + StormctrlType string `json:"stormctrl_type,omitempty"` // level|rate + StormctrlUcastEnabled bool `json:"stormctrl_ucast_enabled,omitempty"` + StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100 + StormctrlUcastRate int `json:"stormctrl_ucast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 + StpPortMode bool `json:"stp_port_mode,omitempty"` +} + +type Device_RadioTable struct { + AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9]) + AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9] + BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto + Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto + HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"` + Ht int `json:"ht,omitempty"` // 20|40|80|160|1080|2160 + MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$ + MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"` + Name string `json:"name,omitempty"` + Radio string `json:"radio,omitempty"` // ng|na|ad + SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$ + SensLevelEnabled bool `json:"sens_level_enabled,omitempty"` + TxPower string `json:"tx_power,omitempty"` // [\d]+|auto + TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom + VwireEnabled bool `json:"vwire_enabled,omitempty"` + WLANGroupID string `json:"wlangroup_id,omitempty"` // [\d\w]+ +} + +type Device_RpsOverride struct { + PowerManagementMode string `json:"power_management_mode,omitempty"` // dynamic|static + RpsPortTable []Device_RpsPortTable `json:"rps_port_table,omitempty"` +} + +type Device_RpsPortTable struct { + Name string `json:"name,omitempty"` // .{0,32} + PortIDX int `json:"port_idx,omitempty"` // [1-6] + PortMode string `json:"port_mode,omitempty"` // auto|force_active|manual|disabled +} + +type Device_WLANOverrides struct { + Enabled bool `json:"enabled,omitempty"` + Name string `json:"name,omitempty"` // .{1,32} + NameCombineEnabled bool `json:"name_combine_enabled,omitempty"` + NameCombineSuffix string `json:"name_combine_suffix,omitempty"` // .{0,8} + Radio string `json:"radio,omitempty"` // ng|na + RadioName string `json:"radio_name,omitempty"` + 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"` + WLANID string `json:"wlan_id,omitempty"` // [\d\w]+ + XPassphrase string `json:"x_passphrase,omitempty"` // [\x20-\x7E]{8,63}|[0-9a-fA-F]{64} } func (c *Client) listDevice(ctx context.Context, site string) ([]Device, error) { diff --git a/unifi/hotspot_2_conf.generated.go b/unifi/hotspot_2_conf.generated.go index b29c744..88f922d 100644 --- a/unifi/hotspot_2_conf.generated.go +++ b/unifi/hotspot_2_conf.generated.go @@ -23,100 +23,121 @@ type Hotspot2Conf struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - ApIsolate bool `json:"ap_isolate"` - Capab []struct { - Port string `json:"port,omitempty"` // (([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5]))+(,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])){0,14} - Protocol string `json:"protocol,omitempty"` // icmp|tcp_udp|tcp|udp - Status string `json:"status,omitempty"` // closed|open|unknown - } `json:"capab,omitempty"` - CellularNetworkList []struct { - Mcc int `json:"mcc,omitempty"` - Mnc int `json:"mnc,omitempty"` - Name string `json:"name,omitempty"` // .{1,128} - } `json:"cellular_network_list,omitempty"` - DeauthReqTimeout int `json:"deauth_req_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 - DisableDgaf bool `json:"disable_dgaf"` - DomainNameList []string `json:"domain_name_list,omitempty"` // .{1,128} - FriendlyName []struct { - Language string `json:"language,omitempty"` // [a-z]{3} - Text string `json:"text,omitempty"` // .{1,128} - } `json:"friendly_name,omitempty"` - GasComebackDelay int `json:"gas_comeback_delay,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]|300 - Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$ - Icons []struct { - Data string `json:"data,omitempty"` - Filename string `json:"filename,omitempty"` // .{1,256} - Height int `json:"height,omitempty"` - Language string `json:"language,omitempty"` // [a-z]{3} - Media string `json:"media,omitempty"` // .{1,256} - Name string `json:"name,omitempty"` // .{1,256} - Size int `json:"size,omitempty"` - Width int `json:"width,omitempty"` - } `json:"icons,omitempty"` - MetricsDownlinkLoad int `json:"metrics_downlink_load,omitempty"` - MetricsDownlinkSpeed int `json:"metrics_downlink_speed,omitempty"` - MetricsInfo string `json:"metrics_info,omitempty"` // [0-9A-Fa-f]{1,2} - MetricsMeasurement int `json:"metrics_measurement,omitempty"` - MetricsStatus bool `json:"metrics_status"` - MetricsUplinkLoad int `json:"metrics_uplink_load,omitempty"` - MetricsUplinkSpeed int `json:"metrics_uplink_speed,omitempty"` - NaiRealmList []struct { - AuthIDs string `json:"auth_ids,omitempty"` - AuthVals string `json:"auth_vals,omitempty"` - 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"` - } `json:"nai_realm_list,omitempty"` - Name string `json:"name,omitempty"` // .{1,128} - NetworkAccessAsra bool `json:"network_access_asra"` - NetworkAccessEsr bool `json:"network_access_esr"` - NetworkAccessInternet bool `json:"network_access_internet"` - NetworkAccessUesa bool `json:"network_access_uesa"` - NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15 - Osu []struct { - Description []struct { - Language string `json:"language,omitempty"` // [a-z]{3} - Text string `json:"text,omitempty"` // .{1,128} - } `json:"description,omitempty"` - FriendlyName []struct { - Language string `json:"language,omitempty"` // [a-z]{3} - Text string `json:"text,omitempty"` // .{1,128} - } `json:"friendly_name,omitempty"` - Icon []struct { - Name string `json:"name,omitempty"` // .{1,128} - } `json:"icon,omitempty"` - MethodOmaDm bool `json:"method_oma_dm"` - MethodSoapXmlSpp bool `json:"method_soap_xml_spp"` - Nai string `json:"nai,omitempty"` - Nai2 string `json:"nai2,omitempty"` - OperatingClass string `json:"operating_class,omitempty"` // [0-9A-Fa-f]{12} - ServerUri string `json:"server_uri,omitempty"` - } `json:"osu,omitempty"` - OsuSSID string `json:"osu_ssid"` - P2P bool `json:"p2p"` - ProxyArp bool `json:"proxy_arp"` - QOSMapDcsp []struct { - High int `json:"high,omitempty"` - Low int `json:"low,omitempty"` - } `json:"qos_map_dcsp,omitempty"` - QOSMapExceptions []struct { - Dcsp int `json:"dcsp,omitempty"` - Up int `json:"up,omitempty"` // [0-7] - } `json:"qos_map_exceptions,omitempty"` - QOSMapStatus bool `json:"qos_map_status"` - RoamingConsortiumList []struct { - Name string `json:"name,omitempty"` // .{1,128} - Oid string `json:"oid,omitempty"` // .{1,128} - } `json:"roaming_consortium_list,omitempty"` - TCFilename string `json:"t_c_filename,omitempty"` // .{1,256} - TCTimestamp int `json:"t_c_timestamp,omitempty"` - VenueGroup int `json:"venue_group,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11 - VenueName []struct { - Language string `json:"language,omitempty"` // [a-z]{3} - Name string `json:"name,omitempty"` // .{1,128} - } `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 + ApIsolate bool `json:"ap_isolate"` + Capab []Hotspot2Conf_Capab `json:"capab,omitempty"` + CellularNetworkList []Hotspot2Conf_CellularNetworkList `json:"cellular_network_list,omitempty"` + DeauthReqTimeout int `json:"deauth_req_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 + DisableDgaf bool `json:"disable_dgaf"` + DomainNameList []string `json:"domain_name_list,omitempty"` // .{1,128} + FriendlyName []Hotspot2Conf_FriendlyName `json:"friendly_name,omitempty"` + GasComebackDelay int `json:"gas_comeback_delay,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]|300 + Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$ + Icons []Hotspot2Conf_Icons `json:"icons,omitempty"` + MetricsDownlinkLoad int `json:"metrics_downlink_load,omitempty"` + MetricsDownlinkSpeed int `json:"metrics_downlink_speed,omitempty"` + MetricsInfo string `json:"metrics_info,omitempty"` // [0-9A-Fa-f]{1,2} + MetricsMeasurement int `json:"metrics_measurement,omitempty"` + MetricsStatus bool `json:"metrics_status"` + MetricsUplinkLoad int `json:"metrics_uplink_load,omitempty"` + MetricsUplinkSpeed int `json:"metrics_uplink_speed,omitempty"` + NaiRealmList []Hotspot2Conf_NaiRealmList `json:"nai_realm_list,omitempty"` + Name string `json:"name,omitempty"` // .{1,128} + NetworkAccessAsra bool `json:"network_access_asra"` + NetworkAccessEsr bool `json:"network_access_esr"` + NetworkAccessInternet bool `json:"network_access_internet"` + NetworkAccessUesa bool `json:"network_access_uesa"` + NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15 + Osu []Hotspot2Conf_Osu `json:"osu,omitempty"` + OsuSSID string `json:"osu_ssid"` + P2P bool `json:"p2p"` + ProxyArp bool `json:"proxy_arp"` + QOSMapDcsp []Hotspot2Conf_QOSMapDcsp `json:"qos_map_dcsp,omitempty"` + QOSMapExceptions []Hotspot2Conf_QOSMapExceptions `json:"qos_map_exceptions,omitempty"` + QOSMapStatus bool `json:"qos_map_status"` + RoamingConsortiumList []Hotspot2Conf_RoamingConsortiumList `json:"roaming_consortium_list,omitempty"` + TCFilename string `json:"t_c_filename,omitempty"` // .{1,256} + TCTimestamp int `json:"t_c_timestamp,omitempty"` + VenueGroup int `json:"venue_group,omitempty"` // 0|1|2|3|4|5|6|7|8|9|10|11 + VenueName []Hotspot2Conf_VenueName `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 +} + +type Hotspot2Conf_Capab struct { + Port string `json:"port,omitempty"` // (([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5]))+(,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])|,([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])){0,14} + Protocol string `json:"protocol,omitempty"` // icmp|tcp_udp|tcp|udp + Status string `json:"status,omitempty"` // closed|open|unknown +} + +type Hotspot2Conf_CellularNetworkList struct { + Mcc int `json:"mcc,omitempty"` + Mnc int `json:"mnc,omitempty"` + Name string `json:"name,omitempty"` // .{1,128} +} + +type Hotspot2Conf_Description struct { + Language string `json:"language,omitempty"` // [a-z]{3} + Text string `json:"text,omitempty"` // .{1,128} +} + +type Hotspot2Conf_FriendlyName struct { + Language string `json:"language,omitempty"` // [a-z]{3} + Text string `json:"text,omitempty"` // .{1,128} +} + +type Hotspot2Conf_Icon struct { + Name string `json:"name,omitempty"` // .{1,128} +} + +type Hotspot2Conf_Icons struct { + Data string `json:"data,omitempty"` + Filename string `json:"filename,omitempty"` // .{1,256} + Height int `json:"height,omitempty"` + Language string `json:"language,omitempty"` // [a-z]{3} + Media string `json:"media,omitempty"` // .{1,256} + Name string `json:"name,omitempty"` // .{1,256} + Size int `json:"size,omitempty"` + Width int `json:"width,omitempty"` +} + +type Hotspot2Conf_NaiRealmList struct { + AuthIDs string `json:"auth_ids,omitempty"` + AuthVals string `json:"auth_vals,omitempty"` + 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"` +} + +type Hotspot2Conf_Osu struct { + Description []Hotspot2Conf_Description `json:"description,omitempty"` + FriendlyName []Hotspot2Conf_FriendlyName `json:"friendly_name,omitempty"` + Icon []Hotspot2Conf_Icon `json:"icon,omitempty"` + MethodOmaDm bool `json:"method_oma_dm"` + MethodSoapXmlSpp bool `json:"method_soap_xml_spp"` + Nai string `json:"nai,omitempty"` + Nai2 string `json:"nai2,omitempty"` + OperatingClass string `json:"operating_class,omitempty"` // [0-9A-Fa-f]{12} + ServerUri string `json:"server_uri,omitempty"` +} + +type Hotspot2Conf_QOSMapDcsp struct { + High int `json:"high,omitempty"` + Low int `json:"low,omitempty"` +} + +type Hotspot2Conf_QOSMapExceptions struct { + Dcsp int `json:"dcsp,omitempty"` + Up int `json:"up,omitempty"` // [0-7] +} + +type Hotspot2Conf_RoamingConsortiumList struct { + Name string `json:"name,omitempty"` // .{1,128} + Oid string `json:"oid,omitempty"` // .{1,128} +} + +type Hotspot2Conf_VenueName struct { + Language string `json:"language,omitempty"` // [a-z]{3} + Name string `json:"name,omitempty"` // .{1,128} } func (c *Client) listHotspot2Conf(ctx context.Context, site string) ([]Hotspot2Conf, error) { diff --git a/unifi/radius_profile.generated.go b/unifi/radius_profile.generated.go index 7348f47..1a881f4 100644 --- a/unifi/radius_profile.generated.go +++ b/unifi/radius_profile.generated.go @@ -23,24 +23,28 @@ type RADIUSProfile struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - AccountingEnabled bool `json:"accounting_enabled"` - AcctServers []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])$ - Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ - XSecret string `json:"x_secret,omitempty"` - } `json:"acct_servers,omitempty"` - AuthServers []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])$ - Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ - XSecret string `json:"x_secret,omitempty"` - } `json:"auth_servers,omitempty"` - InterimUpdateEnabled bool `json:"interim_update_enabled"` - InterimUpdateInterval int `json:"interim_update_interval,omitempty"` // ^([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)$ - Name string `json:"name,omitempty"` // .{1,128} - UseUsgAcctServer bool `json:"use_usg_acct_server"` - UseUsgAuthServer bool `json:"use_usg_auth_server"` - VLANEnabled bool `json:"vlan_enabled"` - VLANWLANMode string `json:"vlan_wlan_mode,omitempty"` // disabled|optional|required + AccountingEnabled bool `json:"accounting_enabled"` + AcctServers []RADIUSProfile_AcctServers `json:"acct_servers,omitempty"` + AuthServers []RADIUSProfile_AuthServers `json:"auth_servers,omitempty"` + InterimUpdateEnabled bool `json:"interim_update_enabled"` + InterimUpdateInterval int `json:"interim_update_interval,omitempty"` // ^([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)$ + Name string `json:"name,omitempty"` // .{1,128} + UseUsgAcctServer bool `json:"use_usg_acct_server"` + UseUsgAuthServer bool `json:"use_usg_auth_server"` + VLANEnabled bool `json:"vlan_enabled"` + VLANWLANMode string `json:"vlan_wlan_mode,omitempty"` // disabled|optional|required +} + +type RADIUSProfile_AcctServers 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])$ + Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ + XSecret string `json:"x_secret,omitempty"` +} + +type RADIUSProfile_AuthServers 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])$ + Port int `json:"port,omitempty"` // ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-4][0-9]{2}|[6][5][5][0-2][0-9]|[6][5][5][3][0-5])$|^$ + XSecret string `json:"x_secret,omitempty"` } func (c *Client) listRADIUSProfile(ctx context.Context, site string) ([]RADIUSProfile, error) { diff --git a/unifi/schedule_task.generated.go b/unifi/schedule_task.generated.go index 3a57f1d..2edc3cb 100644 --- a/unifi/schedule_task.generated.go +++ b/unifi/schedule_task.generated.go @@ -23,18 +23,20 @@ type ScheduleTask struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - Action string `json:"action,omitempty"` // stream|upgrade - AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"` - BroadcastgroupID string `json:"broadcastgroup_id"` - CronExpr string `json:"cron_expr,omitempty"` - ExecuteOnlyOnce bool `json:"execute_only_once"` - MediafileID string `json:"mediafile_id"` - Name string `json:"name,omitempty"` - SampleFilename string `json:"sample_filename,omitempty"` - StreamType string `json:"stream_type,omitempty"` // media|sample - UpgradeTargets []struct { - MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ - } `json:"upgrade_targets,omitempty"` + Action string `json:"action,omitempty"` // stream|upgrade + AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"` + BroadcastgroupID string `json:"broadcastgroup_id"` + CronExpr string `json:"cron_expr,omitempty"` + ExecuteOnlyOnce bool `json:"execute_only_once"` + MediafileID string `json:"mediafile_id"` + Name string `json:"name,omitempty"` + SampleFilename string `json:"sample_filename,omitempty"` + StreamType string `json:"stream_type,omitempty"` // media|sample + UpgradeTargets []ScheduleTask_UpgradeTargets `json:"upgrade_targets,omitempty"` +} + +type ScheduleTask_UpgradeTargets struct { + MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ } func (c *Client) listScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error) { diff --git a/unifi/setting_ips.generated.go b/unifi/setting_ips.generated.go index 6b4244c..6cfd0ee 100644 --- a/unifi/setting_ips.generated.go +++ b/unifi/setting_ips.generated.go @@ -25,43 +25,55 @@ type SettingIps struct { Key string `json:"key"` - DNSFiltering bool `json:"dns_filtering"` - DNSFilters []struct { - Filter string `json:"filter,omitempty"` // security|adult|family - NetworkID string `json:"network_id"` - Version string `json:"version,omitempty"` // v4|v6 - } `json:"dns_filters,omitempty"` - EnabledCategories []string `json:"enabled_categories,omitempty"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|spamhaus|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-trojan|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm - EndpointScanning bool `json:"endpoint_scanning"` - Honeypot []struct { - IPAddress string `json:"ip_address,omitempty"` - NetworkID string `json:"network_id"` - Version string `json:"version,omitempty"` // v4|v6 - } `json:"honeypot,omitempty"` - HoneypotEnabled bool `json:"honeypot_enabled"` - IPsMode string `json:"ips_mode,omitempty"` // ids|ips|ipsInline|disabled - RestrictIPAddresses bool `json:"restrict_ip_addresses"` - RestrictTor bool `json:"restrict_tor"` - RestrictTorrents bool `json:"restrict_torrents"` - Suppression struct { - Alerts []struct { - Category string `json:"category,omitempty"` - Gid int `json:"gid,omitempty"` - ID int `json:"id,omitempty"` - Signature string `json:"signature,omitempty"` - Tracking []struct { - Direction string `json:"direction,omitempty"` // both|src|dest - Mode string `json:"mode,omitempty"` // ip|subnet|network - Value string `json:"value,omitempty"` - } `json:"tracking,omitempty"` - Type string `json:"type,omitempty"` // all|track - } `json:"alerts,omitempty"` - Whitelist []struct { - Direction string `json:"direction,omitempty"` // both|src|dest - Mode string `json:"mode,omitempty"` // ip|subnet|network - Value string `json:"value,omitempty"` - } `json:"whitelist,omitempty"` - } `json:"suppression,omitempty"` + DNSFiltering bool `json:"dns_filtering"` + DNSFilters []SettingIps_DNSFilters `json:"dns_filters,omitempty"` + EnabledCategories []string `json:"enabled_categories,omitempty"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|spamhaus|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-trojan|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm + EndpointScanning bool `json:"endpoint_scanning"` + Honeypot []SettingIps_Honeypot `json:"honeypot,omitempty"` + HoneypotEnabled bool `json:"honeypot_enabled"` + IPsMode string `json:"ips_mode,omitempty"` // ids|ips|ipsInline|disabled + RestrictIPAddresses bool `json:"restrict_ip_addresses"` + RestrictTor bool `json:"restrict_tor"` + RestrictTorrents bool `json:"restrict_torrents"` + Suppression SettingIps_Suppression `json:"suppression,omitempty"` +} + +type SettingIps_Alerts struct { + Category string `json:"category,omitempty"` + Gid int `json:"gid,omitempty"` + ID int `json:"id,omitempty"` + Signature string `json:"signature,omitempty"` + Tracking []SettingIps_Tracking `json:"tracking,omitempty"` + Type string `json:"type,omitempty"` // all|track +} + +type SettingIps_DNSFilters struct { + Filter string `json:"filter,omitempty"` // security|adult|family + NetworkID string `json:"network_id"` + Version string `json:"version,omitempty"` // v4|v6 +} + +type SettingIps_Honeypot struct { + IPAddress string `json:"ip_address,omitempty"` + NetworkID string `json:"network_id"` + Version string `json:"version,omitempty"` // v4|v6 +} + +type SettingIps_Suppression struct { + Alerts []SettingIps_Alerts `json:"alerts,omitempty"` + Whitelist []SettingIps_Whitelist `json:"whitelist,omitempty"` +} + +type SettingIps_Tracking struct { + Direction string `json:"direction,omitempty"` // both|src|dest + Mode string `json:"mode,omitempty"` // ip|subnet|network + Value string `json:"value,omitempty"` +} + +type SettingIps_Whitelist struct { + Direction string `json:"direction,omitempty"` // both|src|dest + Mode string `json:"mode,omitempty"` // ip|subnet|network + Value string `json:"value,omitempty"` } func (c *Client) getSettingIps(ctx context.Context, site string) (*SettingIps, error) { diff --git a/unifi/spatial_record.generated.go b/unifi/spatial_record.generated.go index 82b5926..8fc2966 100644 --- a/unifi/spatial_record.generated.go +++ b/unifi/spatial_record.generated.go @@ -23,15 +23,19 @@ type SpatialRecord struct { NoDelete bool `json:"attr_no_delete,omitempty"` NoEdit bool `json:"attr_no_edit,omitempty"` - Devices []struct { - MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ - Position struct { - X float64 `json:"x,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) - Y float64 `json:"y,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) - Z float64 `json:"z,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) - } `json:"position,omitempty"` - } `json:"devices,omitempty"` - Name string `json:"name,omitempty"` // .{1,128} + Devices []SpatialRecord_Devices `json:"devices,omitempty"` + Name string `json:"name,omitempty"` // .{1,128} +} + +type SpatialRecord_Devices struct { + MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$ + Position SpatialRecord_Position `json:"position,omitempty"` +} + +type SpatialRecord_Position struct { + X float64 `json:"x,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) + Y float64 `json:"y,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) + Z float64 `json:"z,omitempty"` // (^([-]?[\d]+)$)|(^([-]?[\d]+[.]?[\d]+)$) } func (c *Client) listSpatialRecord(ctx context.Context, site string) ([]SpatialRecord, error) {