Refactored field processing in generator.

* Allows for specifying more customizations per field in each type.
  Previously, the switch clause didn't allow sub-types to be modified, but
  that became a problem with some of the more complex types.

* Fixed several problematic fields in the Device resource

* Removed the underscore separator from generated type names
This commit is contained in:
James Stephenson
2020-09-06 16:10:45 -04:00
committed by Paul Tyng
parent fa5012f42a
commit 16c246525b
11 changed files with 455 additions and 396 deletions

View File

@@ -23,85 +23,85 @@ type Hotspot2Conf struct {
NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"`
AnqpDomainID int `json:"anqp_domain_id,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]|$
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"`
GasAdvanced bool `json:"gas_advanced"`
GasComebackDelay int `json:"gas_comeback_delay,omitempty"`
GasFragLimit int `json:"gas_frag_limit,omitempty"`
Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$
HessidUsed bool `json:"hessid_used"`
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
Icons []Hotspot2Conf_Icons `json:"icons,omitempty"`
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 []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"`
NetworkAuthType int `json:"network_auth_type,omitempty"` // -1|0|1|2|3
NetworkAuthUrl string `json:"network_auth_url,omitempty"`
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"`
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"`
SaveTimestamp string `json:"save_timestamp,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
AnqpDomainID int `json:"anqp_domain_id,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]|$
Capab []Hotspot2ConfCapab `json:"capab,omitempty"`
CellularNetworkList []Hotspot2ConfCellularNetworkList `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 []Hotspot2ConfFriendlyName `json:"friendly_name,omitempty"`
GasAdvanced bool `json:"gas_advanced"`
GasComebackDelay int `json:"gas_comeback_delay,omitempty"`
GasFragLimit int `json:"gas_frag_limit,omitempty"`
Hessid string `json:"hessid"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$
HessidUsed bool `json:"hessid_used"`
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
Icons []Hotspot2ConfIcons `json:"icons,omitempty"`
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 []Hotspot2ConfNaiRealmList `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"`
NetworkAuthType int `json:"network_auth_type,omitempty"` // -1|0|1|2|3
NetworkAuthUrl string `json:"network_auth_url,omitempty"`
NetworkType int `json:"network_type,omitempty"` // 0|1|2|3|4|5|14|15
Osu []Hotspot2ConfOsu `json:"osu,omitempty"`
OsuSSID string `json:"osu_ssid"`
QOSMapDcsp []Hotspot2ConfQOSMapDcsp `json:"qos_map_dcsp,omitempty"`
QOSMapExceptions []Hotspot2ConfQOSMapExceptions `json:"qos_map_exceptions,omitempty"`
QOSMapStatus bool `json:"qos_map_status"`
RoamingConsortiumList []Hotspot2ConfRoamingConsortiumList `json:"roaming_consortium_list,omitempty"`
SaveTimestamp string `json:"save_timestamp,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 []Hotspot2ConfVenueName `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 {
type Hotspot2ConfCapab 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
}
type Hotspot2Conf_CellularNetworkList struct {
type Hotspot2ConfCellularNetworkList struct {
Mcc int `json:"mcc,omitempty"`
Mnc int `json:"mnc,omitempty"`
Name string `json:"name,omitempty"` // .{1,128}
}
type Hotspot2Conf_Description struct {
type Hotspot2ConfDescription struct {
Language string `json:"language,omitempty"` // [a-z]{3}
Text string `json:"text,omitempty"` // .{1,128}
}
type Hotspot2Conf_FriendlyName struct {
type Hotspot2ConfFriendlyName struct {
Language string `json:"language,omitempty"` // [a-z]{3}
Text string `json:"text,omitempty"` // .{1,128}
}
type Hotspot2Conf_Icon struct {
type Hotspot2ConfIcon struct {
Name string `json:"name,omitempty"` // .{1,128}
}
type Hotspot2Conf_Icons struct {
type Hotspot2ConfIcons struct {
Data string `json:"data,omitempty"`
Filename string `json:"filename,omitempty"` // .{1,256}
Height int `json:"height,omitempty"`
@@ -112,7 +112,7 @@ type Hotspot2Conf_Icons struct {
Width int `json:"width,omitempty"`
}
type Hotspot2Conf_NaiRealmList struct {
type Hotspot2ConfNaiRealmList struct {
AuthIDs string `json:"auth_ids,omitempty"`
AuthVals string `json:"auth_vals,omitempty"`
EapMethod int `json:"eap_method,omitempty"` // 13|21|18|23|50
@@ -121,34 +121,34 @@ type Hotspot2Conf_NaiRealmList struct {
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 Hotspot2ConfOsu struct {
Description []Hotspot2ConfDescription `json:"description,omitempty"`
FriendlyName []Hotspot2ConfFriendlyName `json:"friendly_name,omitempty"`
Icon []Hotspot2ConfIcon `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 {
type Hotspot2ConfQOSMapDcsp struct {
High int `json:"high,omitempty"`
Low int `json:"low,omitempty"`
}
type Hotspot2Conf_QOSMapExceptions struct {
type Hotspot2ConfQOSMapExceptions struct {
Dcsp int `json:"dcsp,omitempty"`
Up int `json:"up,omitempty"` // [0-7]
}
type Hotspot2Conf_RoamingConsortiumList struct {
type Hotspot2ConfRoamingConsortiumList struct {
Name string `json:"name,omitempty"` // .{1,128}
Oid string `json:"oid,omitempty"` // .{1,128}
}
type Hotspot2Conf_VenueName struct {
type Hotspot2ConfVenueName struct {
Language string `json:"language,omitempty"` // [a-z]{3}
Name string `json:"name,omitempty"`
Url string `json:"url,omitempty"`