Commit Graph

21 Commits

Author SHA1 Message Date
Mateusz Filipowicz
bdc73a9811 docs: fix invalid godoc for generated settings methods 2025-03-02 22:27:49 +01:00
Mateusz Filipowicz
bbc373a354 fix: explicitly set Setting key when updating a settings (#37) 2025-02-23 14:00:19 +01:00
Mateusz Filipowicz
7b35725921 feat(experimental): add support for reading and updating all settings (#25) 2025-02-18 07:43:04 +01:00
Mateusz Filipowicz
dca894e8e7 feat: use Client interface instead of client struct when interacting with UniFi SDK (#21)
* feat: use Client interface instead of client struct when interacting with UniFi SDK

Breaking change!

* chore: linting

* chore: linting
2025-02-17 09:38:41 +01:00
Mateusz Filipowicz
53bb1a13b9 feat: generate fields validation and use it when sending requests to API (#7)
* feat: generate fields validation and use it when issuing requests to API with soft (default) or hard modes

* chore: apply linter fixes

* feat: enable field validation on int fields

* feat: add validation for ^[\w]+$ fields

* feat: add validation for MAC address fields

* fix: trim wrappers for all comments

* feat: add validation for IPv4, IPv6 and IP(IPv4/IPv6) fields

* feat: add validation for numeric, non-zero based fields

* fix: one of validation can contain dot (.) sign in values

* feat: add second notation of MAC address validation

* fix: one of validation can start with ^( and end with )$

* feat: add option to disable validation and use soft validation by default

* chore: fix test

* docs: add readme about client-side validation
2025-02-09 21:08:21 +01:00
Mateusz Filipowicz
d79f581c1f chore: apply linter fixes 2025-02-09 01:51:47 +01:00
Mateusz Filipowicz
f79f21c4ad feat: new, more customizable client supporting API Key and user/password authentication 2025-02-09 01:51:47 +01:00
github-actions[bot]
525ebe5e22 [create-pull-request] automated change (#239)
Co-authored-by: joshuaspence <234676+joshuaspence@users.noreply.github.com>
2025-01-07 11:50:37 +11:00
github-actions[bot]
b0330e377b [create-pull-request] automated change (#156)
Co-authored-by: joshuaspence <234676+joshuaspence@users.noreply.github.com>
2024-11-12 19:20:44 +11:00
Joshua Spence
d2cc2013b7 Forgot to run go generate (#75) 2022-05-16 14:48:27 +10:00
Joshua Spence
09e0556344 Add back mdns_enabled (#73) 2022-05-16 13:56:45 +10:00
github-actions[bot]
9d4150d235 [create-pull-request] automated change (#63)
Co-authored-by: joshuaspence <joshuaspence@users.noreply.github.com>
2022-03-06 09:47:34 +11:00
Joshua Spence
8d4ca5f389 Revert "Add controller version to generated files" (#47)
This reverts commit 13d5677bf3.
2021-09-24 07:21:34 +10:00
Joshua Spence
7d87194aef Update to latest controller version (#46)
* Update to latest controller version

* Fix tests
2021-09-21 23:26:12 +10:00
Paul Tyng
13d5677bf3 Add controller version to generated files 2021-08-31 09:02:23 -04:00
Kurt McAlpine
bd8898db77 Set d.Key for all settings updates 2021-04-09 09:51:50 -04:00
Hendrik "T4cC0re" Meyer
4aed7d703d Generate UnmarshalJSON to handle emptyStringInt types
This commit changes the code generator to generate a `UnmarshalJSON` for each
struct, so that if unmarshalled it properly handles UniFis varying integer values
via the `emptyStringInt` type.

Structs not including a field of `int` type will still have the function generated,
but it will effectively do nothing.

Fixes #18
2021-01-03 13:21:53 -05: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
d076e78005 Add context support 2020-03-26 16:12:52 -04: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