Files
go-unifi/codegen/customizations.yml
Mateusz Filipowicz fadc5ada8b feat: add client customization option (#20)
* feat: add client customization

* chore: fix linting

* feat: allow excluding client function by resource name
2025-02-16 23:00:05 +01:00

102 lines
2.7 KiB
YAML

---
customizations:
client:
excludeResources:
- "Setting*" # Exclude all resources that start with "Setting"
functions:
- name: "Login"
comment: "Login logs in to the controller. Useful only for user/password authentication."
returns:
- "error"
- name: "Logout"
comment: "Logout logs out from the controller."
returns:
- "error"
- name: "BaseURL"
comment: "BaseURL returns the base URL of the controller."
returns:
- "string"
- name: "AdoptDevice"
comment: "AdoptDevice adopts a device by MAC address."
resourceName: "Device"
params:
- name: "ctx"
type: "context.Context"
- name: "site"
type: "string"
- name: "mac"
type: "string"
returns:
- "error"
resources:
Account:
fields:
IP:
omitEmpty: true
NetworkID:
omitEmpty: true
ChannelPlan:
fields:
Channel:
ifFieldType: "string"
customUnmarshalType: "numberOrString"
BackupChannel:
ifFieldType: "string"
customUnmarshalType: "numberOrString"
TxPower:
ifFieldType: "string"
customUnmarshalType: "numberOrString"
Device:
fields:
_all:
omitEmpty: true
X:
fieldType: "float64"
Y:
fieldType: "float64"
StpPriority:
fieldType: "string"
customUnmarshalType: "numberOrString"
Ht:
fieldType: "int"
Channel:
customUnmarshalType: "numberOrString"
ifFieldType: "string"
BackupChannel:
customUnmarshalType: "numberOrString"
ifFieldType: "string"
TxPower:
customUnmarshalType: "numberOrString"
ifFieldType: "string"
LteExtAnt:
customUnmarshalType: "booleanishString"
LtePoe:
customUnmarshalType: "booleanishString"
PortOverrides:
omitEmpty: false
Network:
fields:
InternetAccessEnabled:
ifFieldType: "bool"
customUnmarshalType: "*bool"
customUnmarshalFunc: "emptyBoolToTrue"
IntraNetworkAccessEnabled:
ifFieldType: "bool"
customUnmarshalType: "*bool"
customUnmarshalFunc: "emptyBoolToTrue"
WANUsername:
omitEmpty: true
XWANPassword:
omitEmpty: true
User:
fields:
Blocked:
fieldType: "bool"
LastSeen:
fieldType: "int"
customUnmarshalType: "emptyStringInt"
WLAN:
fields:
ScheduleWithDuration:
omitEmpty: false