8 Commits
Author SHA1 Message Date
James StephensonandPaul Tyng fbed685c37 Fixing unmarshalling of numberOrString
New unmarshalling rules for fields which could be numeric or string
values were not properly typecasted upon being deserialized.

Cleaned up the api template file and moved custom unmarshalling type
logic into go code out of the template.
2021-04-16 13:41:01 -04:00
James StephensonandPaul Tyng 6203ee9620 Renaming PortConf to PortProfile; cleanup Device API func names 2020-10-09 08:56:24 -04:00
James StephensonandPaul Tyng 4b8ec1e2f8 Expose SettingRadius API 2020-10-09 08:56:24 -04:00
James StephensonandPaul Tyng 3f0b230368 Expose SettingUsg API 2020-10-09 08:56:24 -04:00
James StephensonandPaul Tyng 16c246525b 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
2020-09-10 08:50:21 -04:00
James StephensonandPaul Tyng fa5012f42a Updated types to 5.14.23 2020-09-10 08:50:21 -04:00
James StephensonandPaul Tyng bee58f48d4 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.
2020-09-10 08:50:21 -04:00
James StephensonandPaul Tyng 35eda4f67b Refactor type generator
* Allows for generating top-level types for any embedded struct so
  that sub-types can be properly instantiated from calling code
  * Specifying `-no-embedded-types` will generate top-level types
    rather than embedding the struct

* Refactored "Device" API
  * All fields set to `omitempty` because it describes all possible
    device types, so effectively any field could be omitted any time
  * Fixed `get` call for "Device" API; replacing `rest` with `stat`

* Generated `get` and `update` calls for `Setting*` APIs

* Added `5.14.23` JSON files
2020-09-10 08:50:21 -04:00