Commit Graph

20 Commits

Author SHA1 Message Date
Joshua Spence
64a73cdd4b Fix linter issues 2021-06-29 17:43:00 -04:00
Joshua Spence
2f7eee3a6a Add dev_id_override to user 2021-06-18 15:39:41 -04:00
Joshua Spence
dd685c0447 Fix type of x_ssh_keys
The `unifi_settings_mgmt` resource fails for me with the following error:

```
Error: unable to decode body: GET s/default/get/setting/mgmt unable to unmarshal alias: json: cannot unmarshal object into Go struct field .x_ssh_keys of type string
```

My `x_ssh_keys` looks like this:

```
[
  {
    "name": "Laptop",
    "type": "ssh-rsa",
    "key": "REDACTED",
    "comment": "REDACTED",
    "date": "2021-02-25T08:26:04Z",
    "fingerprint": "REDACTED"
  }
]
```
2021-06-16 09:28:49 -04:00
James Stephenson
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
Paul Tyng
4ab4036985 Bump to 6.0.43, use go generate
Also moved fetching of JSON information to Go for cross-OS usage.
2021-04-09 09:51:50 -04:00
Paul Tyng
9c60a9de6f Change to string for auto support 2021-03-20 11:30:10 -04:00
Paul Tyng
abc676f62b Add support for 6.0.23 2020-10-20 10:10:32 -04:00
Ben Davies
df937016b0 Moved handling of string response to int using the existing emptyStringInt method as part of UnmarshalJSON as per Pauls suggestion 2020-10-09 13:42:28 -04:00
Ben Davies
e7f9c5eb97 Added WAN egress qos fix 2020-10-09 13:42:28 -04:00
James Stephenson
6203ee9620 Renaming PortConf to PortProfile; cleanup Device API func names 2020-10-09 08:56:24 -04:00
James Stephenson
e93f92a066 Expose Device API 2020-10-09 08:56:24 -04:00
James Stephenson
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 Stephenson
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
Paul Tyng
5726e0ab76 sort ascending 2020-08-27 21:52:32 -04:00
James Stephenson
47fa522aba Expose the Account API (RADIUS users)
* Adds Account CRUD API
* Enahnces `emptyStringInt` with a predicate for dynamically setting
  which value should be interpreted as a blank JSON payload
2020-08-27 21:48:13 -04:00
Paul Tyng
8e63bffebb Generate from 5.12.72 fields 2020-05-20 22:01:47 -04:00
Paul Tyng
d076e78005 Add context support 2020-03-26 16:12:52 -04:00
Paul Tyng
19709dff50 Add support for IP on User 2020-02-19 10:32:44 -05:00
Paul Tyng
1f8ef07e63 Cleanup firewall rule names 2020-01-12 10:30:42 -05:00
Paul Tyng
435ecf9d6f Initial version
Extracted from paultyng/terraform-provider-unifi@ef25893f14
2020-01-10 14:31:12 -05:00